forked from lbesnard/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalias
197 lines (171 loc) · 7.51 KB
/
alias
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# quick way to get out of current directory ##
alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'
alias cc='ls -f | wc -l' # ls -f does not stat() and makes it faster
alias ccat='source-highlight --out-format=esc -o STDOUT -i'
alias chef_cd="cd $CHEF_DIR"
alias chef_private_cd="cd $CHEF_DIR/../chef-private"
alias chef_imos="chef_cd && rm -f private; ln -s ../chef-private private"
alias chef_po_box_start="chef_sample && ./bin/po-box.sh && vagrant ssh po"
alias chef_provision_laptop_from_remote='cd $DOTFILES; git reset-branch-like-remote; cd $GITHUB_DIR/chef_laptop; git reset-branch-like-remote; $GITHUB_DIR/chef_laptop/install.sh;'
alias chef_provision_laptop_from_local='cd $GITHUB_DIR/chef_laptop; $GITHUB_DIR/chef_laptop/install.sh'
alias chef_provision_po="chef_cd && vagrant provision po"
alias chef_sample="chef_cd && rm -f private; ln -s private-sample private"
alias clear_tmp="find /tmp -mtime +1 -and -not -exec fuser -s {} ';' -and -exec rm -Rf {} ';'"
alias copy='| xclip -sel clip'
alias data_services_cd="cd $CHEF_DIR/src/data-services"
alias display_docked=". /home/lbesnard/.screenlayout/work_screen2_thunder.sh && mouse_setting.sh"
alias dotfiles="cd $GITHUB_DIR/dotfiles"
alias egrep='egrep --color=auto'
alias elinks_google='elinks www.google.com.au'
alias fgrep='fgrep --color=auto'
alias g='git'
alias geoserver_cd="cd $CHEF_DIR/src/geoserver"
alias github_cd="cd $GITHUB_DIR"
alias grep='grep --color=auto'
alias iftop_wlan='iftop -i wlan0'
alias irssi='screen irssi'
alias killall='killall -SIGUSR1'
alias l='ls -CF'
alias la='ls -a'
alias latest_installed_pckg='cat /var/log/apt/history.log | grep "\ install\ "'
alias ll='ls -lh'
alias lll="ll | awk '{print $9}'"
alias lock_screen='gnome-screensaver-command --lock || xscreensaver-command -lock'
alias ls='ls --color=auto'
alias ls_recur="find . -type f -exec ls -l {} \; 2> /dev/null | sort -t' ' -k +6,6 -k +7,7"
alias ls_time='ls -lrt'
alias lynx='lynx -cfg=~/.lynx.cfg '
alias mac_wlan_random='sudo ifconfig wlp1s0 down && sudo macchanger -r wlp1s0 && sudo ifconfig wlp1s0 up'
alias music_player='mp3blaster'
alias nch='ncdump -h'
alias ports='netstat -tulanp' # open ports
alias project_officer_user='sudo -u projectofficer -s'
alias rsrc='source ~/.bashrc'
alias shutdown_now='sudo shutdown -h now'
alias split_flac_album='shnsplit -f *.cue -t %n-%t -o flac *.flac'
alias split_ape_album='shnsplit -f *.cue -t %n-%t -o flac *.ape'
alias split wv_album='shnsplit -f *.cue -t %n-%t -o flac *.vw'
alias ssh-add='ssh-add -t 10h'
#alias ssh_po="chef_sample && vagrant ssh po"
alias talend='/opt/TOS_DI-r96646-V5.1.3/TOS_DI-linux-gtk-x86_64'
alias trim="sed 's/^ *//;s/ *$//'"
alias harvesters_wp_cd='cd /opt/TOS_DI-r96646-V5.1.3/harvesters_wp/harvesters/workspace'
alias temperature='sensors;sudo hddtemp /dev/sda'
alias top='htop'
alias use_antigen='echo source ~/.zshrc.antigen > ~/.zshrc; exit'
alias use_zgen='echo source ~/.zshrc.zgen > ~/.zshrc; exit'
alias use_zplug='echo source ~/.zshrc.zplug > ~/.zshrc; exit'
alias vi='vim'
[ -f ~/.utas_vpnc.conf ] && alias vpn_utas_connect='sudo vpnc ~/.utas_vpnc.conf --local-port 0' && alias vpn_utas_disconnect='sudo vpnc-disconnect'
alias vpn_bfunk_start='cd $HOME/Nextcloud/Private/ovpns && sudo openvpn lbesnard.ovpn'
alias ssh_work='ssh `cat ~/Dropbox/work/ip_work`'
alias ssh_home='ssh `cat ~/Dropbox/work/ip_home`'
alias vim_plugin_install='vim +VundleClean +PluginInstall +qall'
alias wd='cd /media/lbesnard/Laurent_emII'
alias work_workspace='display_docked & tmux_start'
# timezone
alias tz_paris='TZ="Europe/Paris" date'
alias tz_hobart='TZ="Australia/Hobart" date'
alias tz_utc='TZ="UTC" date'
# beet
alias beet_genre_uniq_update="beet ls -f '\$genre' | sort -u > ~/.beets_genre"
if command -v dig > /dev/null; then
alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
alias mygeo="curl -w \"\\n\" http://api.hackertarget.com/geoip/\?q=\`myip\`"
fi
# POSTGRES
DBHOST='2-nec-hob.emii.org.au'
[ -f $HOME/.pgpass ] && alias psql-dbrc="psql -d harvest -h $DBHOST -U `cat $HOME/.pgpass | grep $DBHOST | cut -d':' -f4`"
DBHOST='dbprod.emii.org.au'
[ -f $HOME/.pgpass ] && alias psql-dbprod="psql -d harvest -h $DBHOST -U `cat $HOME/.pgpass | grep $DBHOST | cut -d':' -f4`"
DBHOST='10.11.12.13'
[ -f $HOME/.pgpass ] && alias psql-po="psql -d harvest -h $DBHOST -U `cat $HOME/.pgpass | grep $DBHOST | cut -d':' -f4`"
remove_space_from_filename_recur() {
find . -depth -name "* *" -execdir rename 's/ /_/g' "{}" \;
}
remove_file_extension() {
local file="$1"; shift
mv $file ${file%\.[^.]*}
}
ncdumph() {
command ncdump -h "$@" | less;
}
#export -f ncdumph
nc_checker_cf() {
command netcdf-checker -t=cf "$@" | less;
}
#export -f nc_checker_cf
nc_checker_imos() {
command netcdf-checker -t=imoscf "$@" | less;
}
#export -f nc_checker_imos
###########################
# music database + player #
###########################
alias update-music-db='updatedb -l 0 -o ~/.externalHD_music.db -U /media/lbesnard/music/Music/'
alias locate-external='locate -i -d ~/.externalHD_music.db'
# $1 - string to search for
function listen-to() {
listen_to="$1"; shift
local playlist=`mktemp`
locate-external "$listen_to" > $playlist
sed -i -r '/.mp3$|.wav$|.ogg$/!d' $playlist
mp3blaster --list $playlist
rm $playlist
}
#export -f listen-to
# source NETCDF tools
#[ -f $CHEF_DIR/src/data-services/lib/common/netcdf-utils.sh ] && source $CHEF_DIR/src/data-services/lib/common/netcdf-utils.sh
#[ -f $CHEF_DIR/src/data-services/lib/netcdf/netcdf-cf-imos-compliance.sh ] && source $CHEF_DIR/src/data-services/lib/netcdf/netcdf-cf-imos-compliance.sh
# paragliding
alias flightrecorder='cd $HOME/paragliding ; sudo flightrecorder && chown $USER:$USER *.IGC; rsync -avc $HOME/paragliding/ $HOME/Dropbox/paragliding_igc'
alias igc_viewer='gpligc'
alias riverHeight='python $GITHUB_DIR/River_Height_Tasmania/riverHeight.py && /usr/bin/elinks ~/Dropbox/Public/RiverStatusTasmania.html'
alias gpsdump_flymaster='cd $HOME/Downloads; ./gpsdump -gy -ca0 -lflight'
x(){
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "Unable to extract '$1'" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
python_venv_init () {
local venv_name=$1; shift
mkdir venv_name && cd venv_name;
sourve venv/vin/activate
xargs -a requirements.txt -n 1 pip install
}
alias pip_install_requirements='xargs -a requirements.txt -n 1 pip install'
kill_py () {
local python_script_name=$1; shift
kill -9 $(ps aux | grep '[p]ython.*${python_script_name}\.py'| awk '{print $2}')
}
function pdf2cbz(){
PDF_FILE="$1"; shift;
PDF_FILE_PATH=`readlink -f "$PDF_FILE"`;
PDF_FILE_NAME=`basename "$PDF_FILE_PATH"`;
PDF_FILE_DIRNAME=`dirname "$PDF_FILE_PATH"`;
temp_dir=`mktemp -d`;
pdfimages -j "$PDF_FILE_PATH" $temp_dir/page;
zip -jr "${PDF_FILE_PATH%.*}.cbz" $temp_dir/*;
mv "$PDF_FILE_PATH" "$PDF_FILE_DIRNAME"/."$PDF_FILE_NAME";
rm -Rf $temp_dir;
}