-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile_common
92 lines (74 loc) · 2.15 KB
/
profile_common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
#!/bin/zsh
# profile_common
# ====================================
# Author: Eunchong Kim
# Date: Aug. 2021
# Project: user-settings
# Description: common
# ====================================
#-----------------------------------------------
# Variables
#-----------------------------------------------
# add sbin
export PATH=$PATH:/usr/sbin:/sbin
# Add .local to PATH
export PATH=$PATH:~/.local/bin
# Set default editor
export EDITOR='vim'
# Set nodename for vimrc to know if it is icepp or cern
export NODENAME=`uname -n | cut -f2 -d'.'`
#-----------------------------------------------
# Source for WSL
#-----------------------------------------------
result=`cat /proc/version`
if [[ $result == *"icrosoft"* ]]; then # Include both 'microsoft' and 'Microsoft'
source $HOME/user-settings/wsl
fi
#-----------------------------------------------
# Alias
#-----------------------------------------------
# ls
alias ll='ls -l'
# Faster ssh X11 forwarding
alias ssh='ssh -XYC4 -c aes128-ctr'
# Git aliases
source $HOME/user-settings/git_aliases
# Grep exclude directory '.git'
alias grep='grep --exclude-dir=".git" --color'
# Python
alias py='time python3'
# Jupyter lab
alias jl='jupyter lab --no-browser --notebook-dir=~'
alias prjl='poetry run jupyter lab --no-browser --notebook-dir=~'
gprjl(){
cd ~/workspace/poetry-env
poetry run jupyter-lab --no-browser --notebook-dir=~ $@
}
# Activate poetry env
alias activate='source $(poetry env info --path)/bin/activate'
#-----------------------------------------------
# npm
#-----------------------------------------------
export PATH="$HOME/.npm/bin:$PATH"
#-----------------------------------------------
# Welcome message
#-----------------------------------------------
# Get shell type
shell_type=`ps -p$$ -ocmd=`
echo "Hello, $USER! Today is $(date)."
#echo "System Info: $(uptime)"
echo " _______________________"
echo "< You are on shell: $shell_type >"
echo -n " -----------------------"
cat <<< '
\
\
.--.
|o_o |
|:_/ |
// \ \
(| | )
/ \_ _/\`\
\___)=(___/
'