-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases.sh
125 lines (100 loc) · 2.89 KB
/
.aliases.sh
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
export EDITOR=vim
export GOPATH=~/programming/go
export PATH=~/bin:$GOPATH/bin:$PATH
SHELL=$(basename $(ps -h $$ | awk '{print $5}') 2>/dev/null)
case "$SHELL" in
bash)
;;
zsh)
;;
esac
screenfetch
PRIV_ALIASES="$HOME/.priv-aliases.sh"
[[ -f "$PRIV_ALIASES" ]] && . "$PRIV_ALIASES"
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/bin/virtualenvwrapper.sh
alias aliases='vim ~/.aliases.sh'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias o='xdg-open'
alias n='network'
alias v='vim'
alias h='history'
alias py='python'
alias py3='python3'
alias py2='python2'
alias ptp='ptpython'
alias pti='ptipython'
alias wo='workon'
eval $(thefuck --alias)
# INFO =====================
alias cpu='cat /proc/cpuinfo'
alias mem='cat /proc/meminfo'
# ==========================
# DIRECTORIES AND FILES ====
# delete all "*.pyc" files ;)
alias delpyc='find . -name "*.pyc" -delete'
# jump back n directories at a time
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias l='ls -CF'
# show hidden files only
alias l.='ls -d .* --color=auto'
alias ll.='ls -ld .* --color=auto'
alias lla='ls -Al'
# list all folders
alias lf='ls -Gl | grep ^d'
alias lsd='ls -Gal | grep ^d'
# make and cd into directory
function mcd() {
mkdir -p "$1" && cd "$1";
}
# safe rm
alias rm='rm -I'
# ==========================
# TERMINAL =================
alias c='clear'
psgrep() {
ps axuf | grep -v grep | grep "$@" -i --color=auto;
}
hgrep() {
history | grep -v grep | grep "$@" -i --color=auto;
}
# UBUNTU UPGRADE ===========
alias upgrade='sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get clean'
# ==========================
# USEFUL ALIAS FOR EXTRACT KNOW ARCHIVES
extract () {
set -o xtrace
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.tar.xz) tar xfJ $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
set +o xtrace
}
# ==========================
# OTHERS ============
# display weather :) (from icm)
alias wroclaw='display "http://www.meteo.pl/um/metco/mgram_pict.php?ntype=0u&row=436&col=181&lang=pl"'
# ===================