-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
663 lines (569 loc) · 19.4 KB
/
.bashrc
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -lF'
alias la='ls -A'
alias l='ls -CF'
# 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 definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
############################################################
## PERSONAL SETTINGS
############################################################
# and more some more ls aliases
alias lla='ls -lAF'
alias llh='ls -lh'
alias lah='ls -Ah'
alias lrt='ls -lrt'
alias lsa='ls -A'
# LaTeX, dvipdf, acroread
#alias lda='latex MHB_prl.tex && dvipdf MHB_prl.dvi && acroread MHB_prl.pdf &'
# acroread
function acro()
{
acroread $1 &
}
# qpdfview
function q()
{
qp $1 &
}
#grep aliases
# alias psgrep='ps -eo pid,user,ni,%cpu,%mem,time,etime,start,comm | grep -e PID -e'
function psgrep()
{
ps -eo pid,user,ni,%cpu,%mem,time,etime,start,comm | grep -e COMMAND -i -e $1
}
# convert endnote to ris
function enw2ris()
{
end2xml $1 | xml2ris > "${1/%enw/ris}"
}
function ris2bib()
{
ris2xml $1 | xml2bib > "${1/%ris/bib}"
}
# Set some generic aliases
alias o='less'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias ........='cd ../../../../../../..'
alias cd..='cd ..'
# emacs
#export EDITOR=emacsclient
#export ALTERNATE_EDITOR=""
#alias emacs='/usr/bin/emacsclient -a /usr/bin/emacs'
# start emacs with and a file as parameter and quit
function emacsandquit ()
{
emacs $1 &
}
alias e='emacsandquit'
alias nemacs='emacs -nw'
alias edit='emacs'
alias editemacsconfig='emacsandquit $HOME/.emacs.d/init.el'
alias ee='editemacsconfig'
# sourcing
alias bsource='source $HOME/.bashrc'
alias psource='source $HOME/.profile'
# Edit and reload .bashrd
alias editbashrc='emacs $HOME/.bashrc;source $HOME/.bashrc'
alias eb='editbashrc'
# Edit and reload .profile
alias editprofile='emacs $HOME/.profile;source $HOME/.profile'
alias ep='editprofile'
# MATLAB short cut
#alias ml='synclient HorizEdgeScroll=0 HorizTwoFingerScroll=0 && matlab -nosplash -desktop &'
alias ml='$HOME/bin/runMatlab.sh &'
alias mln='$HOME/bin/runMatlabConsole.sh'
#alias mln='matlab -nosplash -nodesktop -nodisplay'
# some ssh aliases
alias sufonoX='ssh [email protected]'
alias sufo='sufonoX -X'
alias stomo2noX='ssh [email protected]'
alias stomo2='stomo2noX -X'
alias steslanoX='ssh [email protected]'
alias stesla='steslanoX -X'
alias slasnoX='ssh [email protected]'
alias slas='slasnoX -X'
alias smoos='ssh -X [email protected]'
alias sitp='ssh -X [email protected]'
alias sanka8='ssh -XYp24 [email protected]'
alias sanka8noX='ssh -Xp24 [email protected]'
alias sjumo='ssh -X [email protected]'
alias sesrf='ssh -Xp5022 [email protected]'
alias skth='ssh -X [email protected]'
# port forwarding to computational server over anka8
function portforward ()
{
#local LOCALPORT=$1;
LOCALPORT=$1;
local SERVER=$2;
if [ -z "${2}" ]; then
SERVER=anka-tomo2;
fi
local SERVERLOGIN=$3;
if [ -z "${3}" ]; then
SERVERLOGIN=hp9361;
fi
local SECURECHANNEL=$4;
if [ -z "${4}" ]; then
SECURECHANNEL=anka8.anka.kit.edu;
fi
local SECURECHANNELPORT=$5;
if [ -z "${5}" ]; then
SECURECHANNELPORT=24;
fi
local SECURECHANNELUSER=$6;
if [ -z "${6}" ]; then
SECURECHANNELUSER=moosmann;
fi
if [ -z "${1}" ]; then
echo -e USAGE: portforward LOCALPORT SERVER SERVERLOGIN SECURECHANNEL SECURECHANNELPORT SECURECHANNELUSER \(DEFAULT: \$1 $SERVER $SERVERLOGIN $SECURECHANNEL $SECURECHANNELPORT $SECURECHANNELUSER\);
return
fi
# Establish tunnel
ssh -YX -f -L $LOCALPORT:$SERVER:22 $SECURECHANNELUSER@$SECURECHANNEL -p$SECURECHANNELPORT -N;
# Print information
echo -e Local port $LOCALPORT is forwarded to port 22 of server $SERVER via port $SECURECHANNELPORT of $SECURECHANNELUSER@$SECURECHANNEL;
}
# Login to porforwarded server
function slocal () {
local PORT=$1;
local USER=$2;
if [ -z "${2}" ]; then
USER=hp9361;
fi
if [ -z "${1}" ]; then
echo -e USAGE: slocal PORT USERNAME \(DEFAULT: \$1 $USER\) \(ssh -XYpPORT USERNAME@localhost\)
return
fi
echo -e Login of user $USER to localhost on port $PORT
ssh -XYp$PORT $USER@localhost
}
function slocalnoX () {
local PORT=$1;
local USER=$2;
if [ -z "${2}" ]; then
USER=hp9361;
fi
if [ -z "${1}" ]; then
echo -e USAGE: slocal PORT USERNAME \(DEFAULT: \$1 $USER\) \(ssh -XYpPORT USERNAME@localhost\)
return
fi
echo -e Login of user $USER to localhost on port $PORT
ssh -p$PORT $USER@localhost
}
#ssh -f -L 12345:anka-nc-gpu1:22 anka8.anka.kit.edu -p24 -N
# ssh function
function sncgpu ()
{
ssh -X hp9361@anka-nc-gpu$1.anka.kit.edu
}
function snccpu ()
{
ssh -X hp9361@anka-nc-cpu$1.anka.kit.edu
}
# ssh aliases for guake
alias ufo='guake -n UFO -r ufo -e sufo'
alias ufonoX='guake -n UFONOX -r ufonoX -e sufonoX'
alias tesla='guake -n TESLA -r tesla -e stesla'
alias teslanoX='guake -n TESLANOX -r teslanoX -e steslanoX'
alias tomo2='guake -n TOMO2 -r tomo2 -e stomo2'
alias tomo2noX='guake -n TOMO2NOX -r tomonoX -e stomo2noX'
alias las='guake -n LAS -r las -e slas'
alias lasnoX='guake -n LASNOX -r lasnoX -e slasnoX'
alias anka8='guake -n ANKA8 -r anka8 -e sanka8'
alias moschd='guake -n MOSCHD -r moschd -e smoschd'
alias esrf='guake -n ESRF -r esrf -e sesrf'
alias kth='guake -n KTH -r kth -e skth'
# ssh function for guake
function jumo ()
{
guake -n JUMO -r jumo -e sjumo
}
function ncgpu ()
{
local VAR=$1;
if [ -z "${1}" ]; then
VAR=$[RANDOM % 4 + 1];
fi
guake -n NCGPU$VAR -r ncgpu$VAR -e "ssh -X hp9361@anka-nc-gpu$VAR.anka.kit.edu"
}
function nccpu ()
{
local VAR=$1;
if [ -z "${1}" ]; then
VAR=$[RANDOM % 4 + 1];
fi
guake -n NCCPU$VAR -r nccpu$VAR -e "ssh -X hp9361@anka-nc-cpu$VAR.anka.kit.edu"
}
function ncgpunoX ()
{
local VAR=$1;
if [ -z "${1}" ]; then
VAR=$[RANDOM % 4 + 1];
fi
guake -n NCGPUNOX$VAR -r ncgpunoX$VAR -e "ssh hp9361@anka-nc-gpu$VAR.anka.kit.edu"
}
function nccpunoX ()
{
local VAR=$1;
if [ -z "${1}" ]; then
VAR=$[RANDOM % 4 + 1];
fi
guake -n NCCPUNOX$VAR -r nccpunoX$VAR -e "ssh hp9361@anka-nc-cpu$VAR.anka.kit.edu"
}
# sshfs
USERID=43637;#ID of hp9361
GROUPID=80605;#ANKA-universal-imaging-group
alias anka8_home='sshfs -p24 [email protected]:/home/moosman /home/hp9361/mounts/anka8_home -o uid=$USERID -o gid=$GROUPID'
alias tesla_home='sshfs [email protected]:/home/ws/hp9361 /home/hp9361/mounts/tesla_home -o uid=$USERID -o gid=$GROUPID'
alias tesla_lsdf='sshfs [email protected]:/mnt/tomoraid-LSDF /home/hp9361/mounts/tesla_lsdf -o uid=$USERID -o gid=$GROUPID'
alias tomo2_home='sshfs [email protected]:/home/ws/hp9361 /home/hp9361/mounts/tomo2_home -o uid=$USERID -o gid=$GROUPID'
alias tomo2_lsdf='sshfs [email protected]:/mnt/tomoraid-LSDF /home/hp9361/mounts/tomo2_lsdf -o uid=$USERID -o gid=$GROUPID'
alias las_home='sshfs [email protected]:/home/ws/hp9361 /home/hp9361/mounts/las_home -o uid=$USERID -o gid=$GROUPID'
alias las_lsdf='sshfs [email protected]:/mnt/tomoraid-LSDF /home/hp9361/mounts/las_lsdf -o uid=$USERID -o gid=$GROUPID'
alias nccpu4_home='sshfs [email protected]:/home/ws/hp9361 /home/hp9361/mounts/nccpu_home -o uid=$USERID -o gid=$GROUPID'
alias nccpu4_lsdf='sshfs [email protected]:/mnt/LSDF /home/hp9361/mounts/nccpu_lsdf -o uid=$USERID -o gid=$GROUPID'
alias moschd_home='sshfs [email protected]:/home/bembel /home/hp9361/mounts/home_moschd -o uid=$USERID -o gid=$GROUPID'
alias lsdf_tomo2='sshfs [email protected]:/mnt/tomoraid-LSDF /mnt/tomoraid-LSDF -o uid=$USERID -o gid=$GROUPID'
alias lsdf_tesla='sshfs [email protected]:/mnt/tomoraid-LSDF /mnt/tomoraid-LSDF -o uid=$USERID -o gid=$GROUPID'
alias lsdf_las='sshfs [email protected]:/mnt/tomoraid-LSDF /mnt/tomoraid-LSDF -o uid=$USERID -o gid=$GROUPID'
function lsdf_ncgpu ()
{
local VAR=$1;
if [ -z "${1}" ]; then
VAR=$[RANDOM % 4 + 1];
fi
echo "Mount LSDF on /mnt/LSDF/ using anka-nc-gpu$VAR.anka.kit.edu"
sshfs hp9361@anka-nc-gpu$VAR.anka.kit.edu:/mnt/tomoraid-LSDF /home/hp9361/mounts/ncgpu_lsdf -o uid=$USERID -o gid=$GROUPID
}
# mayavi2
# function mavi ()
# {
# mayavi2 -d $1 -m Outline -m GridPlane -m Axes -s "module_manager.scalar_lut_manager.show_scalar_bar = True"
# }
# function mavi2 ()
# {
# mayavi2 -d $1 -m Axes -m Outline -m ContourGridPlane -M newmanager -f Threshold -m SurfaceMap
# }
# gnuplot short cut
# alias gnuplot='gnuplot -persist -raise'
# function gnusplot ()
# {
# gb="'set pm3d map; splot \"$1\" binary;'"
# eval "gnuplot -e $gb"
# }
#alias xfiglatex='xfig -specialtext -latexfonts -startlatexFont default'
# ImageJ / Fiji
#alias imagej='$HOME/.imagej/ij'
#alias ij='imagej &'
alias imagej='$HOME/Software/ImageJ/ImageJ'
alias ij='imagej &'
alias fiji='$HOME/Software/Fiji.app/ImageJ-linux64'
alias fj='fiji &'
alias fiji_imagesequence='fiji --run "Image Sequence..."'
# top
alias topme='top -u $USER'
alias topm='topme'
# convert images of format $1 to fomrat $2
function imconverter ()
{
if [ -z "${1}" ]; then
echo -e USAGE: imconverter FORMAT1 FORMAT2
return
fi
echo -e \n'Convert' $1 'images to' $2 'images\n'
for file in *.$1;do convert "$file" "${file/%$1/$2}";done
}
alias convertimages='imconverter'
# convert videos of input format $1 to format msmpeg4 compatible with Microsoft Office 2010 64-bit
function vidconverter ()
{
if [ -z "${1}" ]; then
echo -e USAGE: vidconverter INPUTFORMAT BITRATE \(DEFAULT: vidconverter \$1 8000k\)
return
fi
if [ -z "${2}" ]; then
BITRATE=8000k
fi
for f in *.$1
do avconv -i $f -vcodec msmpeg4 -vb $BITRATE -an ${f/%$1/avi};
done
}
# create poster images from video
function posterimage ()
{
local file=$1
avconv -i $file -vframes 1 -an -f image2 -y ${file/.avi/}.jpg
}
function posterimagempg ()
{
local file=$1
ffmpeg -y -i $file -vframes 1 -ss 00:00:10 -an -vcodec png -f rawvideo ${file/.mpg/}.png
}
# cd aliases for LSDF directories
#if [ -f /mnt/tomoraid-LSDF/users/moosmann/bash_lsdf_aliases ]; then
# . /mnt/tomoraid-LSDF/users/moosmann/bash_lsdf_aliases
#fi
# mount and unmount mtp phone
#alias phone='jmtpfs ~/mounts/phone/'
#alias uphone='fusermount -u ~/mounts/phone'
# mount and unmount exfat partition
#alias exfat='sudo mount -t exfat /dev/mmcblk0p1 ~/mounts/exfat'
#alias uexfat='sudo umount ~/mounts/exfat'
# recursively count files in current folder
alias countfiles='echo -e "Current folder: $PWD\nNumber of files contained in current folder: ";find . -type f -print | wc -l'
# recursively count folders in current folder
function countdir ()
{
local OUTPUT;
OUTPUT=$(find . -type d | wc -l);
echo $OUTPUT-1 | bc
}
alias countfolders='countdir'
# connect smartphone camera via usb to laptop
#alias usbcam='adb forward tcp:4747 tcp:4747 && droidcam &'
# screen
alias screenl='screen -list'
alias screenr='screen -r'
# extract and compress using tar and gz
# Compress: tar -cvzf filename.tar.gz FILES_OR_DIRECTORIES
# Extract: tar -xvzf filename.tar.gz
alias tarc='tar -cvzf'
alias tarx='tar -xvzf'
# gnome-terminal alias
#alias max='gnome-terminal --maximize'
# tree command
alias treed='tree -d'
# CWI specific
# SSH
#alias scromba='ssh -XY [email protected]'
#alias scrombanoX='ssh -x [email protected]'
#alias cromba='$HOME/bin/open-new-tab-in-gnome-terminal && scromba'
#alias cormba_scratch1='sshfs [email protected]:/export/scratch1/moosmann $HOME/scratch1 -o uid=$USERID -o gid=$GROUPID'
#
# MATLAB short cut
#alias ml='$HOME/ASTRAToolbox/runMatlab.sh &'
#alias mln='$HOME/ASTRAToolbox/runMatlabConsole.sh'
#
# cd
#alias cdscratch='cd /export/scratch1/moosmann/'
# open files
#alias gnomeshorts='emacs $HOME/Documents/gnomeShorts.txt '&
#alias shorts='gnomeshorts'
alias wiki='emacs $HOME/wiki.txt &'
alias media='/usr/bin/libreoffice -o $HOME/Dropbox/doc_conf/media.ods &'
# start globus connect
alias globusconnect='~/bin/globusconnectpersonal-2.0.2/globusconnect &'
alias gb='globusconnect'
# define phd working directory in bash variable
pd=~/LATEX/phdthesis/
# open phdthesis.tex
#alias phd='cd ~/LATEX/phdthesis/;emacs phdthesis.tex&'
function phd ()
{
guake -n phd -r phd -e "cd ~/LATEX/phdthesis/ && e phdthesis.tex "
}
# fex belwue
alias fexsend='$HOME/bin/fex/fexsend'
alias fexget='$HOME/bin/fex/fexget'
# check 3D-support
alias checkunity3d='sudo /usr/lib/nux/unity_support_test -p'
# jabref
alias jr='jabref -s &'
# XOP
alias xop='/home/hp9361/Software/imaging/xop/xop2.3/xop &'
# cd aliases
alias cdphd='cd ~/LATEX/phdthesis'
alias cdfig='cd ~/LATEX/phdthesis/figures'
alias cdref='cd ~/Dropbox/REFERENCES'
alias cdrefile='cd ~/Dropbox/REFERENCES/Files'
alias cdlcr='cd ~/git-kth/LCR'
alias cdastra='cd /usr/local/astra'
alias cdpyastra='cd /usr/local/astra/python'
# Show graphics cards and drivers
alias lsvga='lspci | grep -i VGA'
alias lsvgakernel='lspci -knn | grep -A2 VGA'
alias catdriver='cat /proc/driver/nvidia/version'
# echo
alias echold_library_path='echo $LD_LIBRARY_PATH'
alias echolibrary_path='echo $LIBRARY_PATH'
alias echopath='echo $PATH'
alias echocudaroot='echo $CUDA_ROOT'
# CUDA version
alias cudaversion='nvcc --version'
# ParaView
#alias paraview='$HOME/Software/ParaView/ParaView-4.3.1-Linux-64bit/bin/paraview'
#alias pv='paraview'
# FreeSurfer Tutorial
function freesurfer_tutorial()
{
#Set variables to point FreeSurfer to data
export TUTORIAL_DATA=/media/datadrive/FreeSurfer_Tutorial_Datasets
export SUBJECTS_DIR=$TUTORIAL_DATA/buckner_data/tutorial_subjs/
source $FREESURFER_HOME/SetUpFreeSurfer.sh
cd $SUBJECTS_DIR
}
# X-server
alias xstop='sudo service lightdm stop'
alias xstart='sudo service lightdm restart'
# PyCharm
alias pycharm-professional='/usr/local/pycharm/bin/pycharm.sh'
alias pycharm-community='/usr/local/pycharm-community/bin/pycharm.sh'
#alias pycharm='pycharm-professional'
alias pycharm='pycharm-community'
# Install PyCharm
function installPyCharmCommunity(){
# Arguments and variables
local FILE=$1
local INSTALLDIR=$2
local SYMLINK=$3
local PYCHARM=${FILE%.tar.gz}
if [ -z "${2}" ]; then
INSTALLDIR=/usr/local/
fi
if [ -z "${3}" ]; then
SYMLINK=pycharm-community
fi
# Usage
if [ -z "${1}" ]; then
echo -e USAGE: installPyCharm TARGZFILE INSTALLDIR SYMLINKNAME \(DEFAULT: \$1 $INSTALLDIR $SYMLINK\);
return
fi
echo -e Unpack $FILE to $INSTALLDIR
sudo tar xfz $FILE --directory $INSTALLDIR
echo -e Remove symbolic link \'$SYMLINK\' to
readlink $INSTALLDIR$SYMLINK
sudo rm $INSTALLDIR$SYMLINK
echo -e Create new symbolic link \'$SYMLINK\' to $INSTALLDIR$PYCHARM:
sudo ln -rs $INSTALLDIR/$PYCHARM $INSTALLDIR$SYMLINK
readlink $INSTALLDIR$SYMLINK
echo -e To open PyCharm run pycharm.sh from the bin subdirectory:
ls $INSTALLDIR$SYMLINK/bin/pycharm.sh
echo Optionally, delete deprecated pycharm installations
}
# Spyder with multithread
alias spydermt='spyder --multithread &'
# git
alias gitShowTrackedFiles='git ls-tree -r master --name-only'
function gitStatus()
{
local cwd=$(pwd)
echo -e "\nConfig repo: .bashrc, .profile, bin, ..."
cd ~/
git status
echo -e "\nEmacs repo:"
cd ~/.emacs.d
git status
echo -e "\nMATLAB repo:"
cd ~/matlab
git status
echo -e "\n"
cd $cwd
}
# Restart ssh daemon sshd
#alias sshdrestart='sudo /etc/init.d/sshd restart'
#alias sshdrestart='sudo service ssh restart'
alias sshdrestart='sudo restart ssh'
# pip
alias pipUpgradeAllPythonPackages='pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs sudo -H pip install -U'
alias pipListOutdatePackages='pip list -o --allow-all-external'
# ubuntu version
alias ubuntuversion='lsb_release -a'
######################################################################
# temporary project links
alias cdhamburg='cd ~/latex/beamer/2015-08-17_Moosmann_Hamburg-Philipps'
alias hamburg='pdfpc ~/latex/beamer/2015-08-17_Moosmann_Hamburg-Philipps/hamburg.pdf'
alias lcr='emacs ~/latex/lcr/report.tex &'
alias tem='~/Software/TEM/TEM-simulator_1.3/src/TEM-simulator'