CLI config/dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
8.2 KiB

  1. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. # .aliases
  3. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. # Alias definitions for interactive shells. Should be able to be sourced from
  5. # (at least) bash and zsh rc files.
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. # Host-agnostic aliases
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  11. # Getting around
  12. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  13. alias u='cd ..'
  14. alias back='cd "$OLDPWD"'
  15. alias ls='ls --literal'
  16. alias ll='ls -lh'
  17. alias la='ls -A'
  18. alias list='ls -lhA'
  19. alias tree='tree -Chug'
  20. alias ds='du -hsc * | sort -h'
  21. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  22. # Safety
  23. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  24. alias mv='mv -i'
  25. alias cp='cp -i'
  26. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  27. # Avoid graphical environments when possible
  28. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  29. alias truecrypt='truecrypt -t'
  30. alias veracrypt='veracrypt -t'
  31. if [[ "${DISPLAY}" == localhost:?*.0 ]]; then
  32. alias vim='/usr/bin/vim -display localhost:0' # keep from launching X11 on OS X over SSH sessions
  33. fi
  34. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  35. # Quick setup and fixes
  36. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  37. alias xtv='xrandr --output HDMI-0 --auto --same-as DVI-I-1'
  38. alias mic='echo "Starting jack mic input..." && alsa_in -j mic -d hw:USB -r 192000 -c 2 -p 512 -n 3'
  39. alias gamepad="xboxdrv --silent --detach-kernel-driver --mimic-xpad" # run as root
  40. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  41. # Curses program settings
  42. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  43. alias todo='vim ~/.todo.tp'
  44. alias tclock='tty-clock -sctb -d 0 -a 10000000 -C 6 -f "%Y/%m/%d"'
  45. alias netmon="bmon -p eth1,eth0 -b -o curses:'nocolors;bgchar= '"
  46. alias kp="kpcli --kdb ~/Local/key/KeePass/master.kdbx --key ~/Local/key/master.key --histfile /dev/null"
  47. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  48. # Bitcoin mining
  49. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  50. alias mine='cudaminer --interactive=1 --algo=scrypt -o stratum+tcp://middlecoin.com:3333 -u 1HoqBstSjv5kZrEyyHCGjReRpLf3TWTLPS -p asdfgqwert'
  51. alias mine-intense='cudaminer --interactive=0 --algo=scrypt -o stratum+tcp://middlecoin.com:3333 -u 1HoqBstSjv5kZrEyyHCGjReRpLf3TWTLPS -p asdfgqwert'
  52. alias balance='curl http://www.middlecoin.com/allusers.html | grep -B 3 -A 3 1HoqBstSjv5kZrEyyHCGjReRpLf3TWTLPS'
  53. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  54. # Utilities
  55. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  56. alias batch-unzip='for i in *.zip; do newdir="$i:gs/.zip/"; mkdir "$newdir"; unzip -d "$newdir" "$i"; done'
  57. #alias scanimage='scanimage --format=tiff --device pixma:04A91747_80650C --resolution 300'
  58. alias scan-flatbed='scanimage --format=tiff --device "brother4:bus4;dev2" --resolution 600 --source FlatBed'
  59. alias scan-tray='scanimage --format=tiff --device "brother4:bus4;dev1" --resolution 600'
  60. alias merge_pdfs='gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf'
  61. alias rm-if-no-screen='for i in *; do if [ ! -e screens/"$i".jpg -a $i != "screens" ]; then rm -Iv $i; fi; done'
  62. alias pic-dirs-by-date='for i in *.NEF; do dirname=`ll --time-style=full-iso $i | awk '\''{ print $6 }'\''`; mkdir -p $dirname; mv -v $i $dirname; done'
  63. make_thumbs() { vcsi -g 5x4 -w 1920 -t --grid-spacing 0 "$*"; }
  64. make_thumbs_big() { vcsi -g 5x20 -w 1920 -t --grid-spacing 0 "$*"; }
  65. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  66. # Music info
  67. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  68. alias fp='for i in *.flac; do ffprobe $i 2>&1; done'
  69. alias fa='for i in *.flac; do ffprobe $i 2>&1 | grep -i artist; done'
  70. alias fcomp='for i in *.flac; do ffprobe $i 2>&1 | grep -i composer; done'
  71. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  72. # Visuals
  73. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  74. alias blah='while true; do head -c8 /dev/urandom; sleep 0.02; done | hexdump -C'
  75. alias matrix='unimatrix -afo -s 95 -l nssssSScCgGkkkkkkkk'
  76. alias pipes='/usr/bin/pipes -t 3 -f 60 -r 8000'
  77. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  78. # Sounds
  79. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  80. #alias engage='play -r 44100 -c2 -n synth whitenoise lowpass -1 120 lowpass -1 120 lowpass -1 120 gain +16'
  81. alias engage='play -c2 -n -t alsa synth whitenoise band -n 100 24 band -n 300 100 gain +16'
  82. play_midi() { fluidsynth -a alsa -m alsa_seq -j -g 2 -l -i /usr/share/soundfonts/FluidR3_GM.sf2 "$*"; }
  83. say() { echo "$@" | festival --tts; }
  84. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  85. # More terminal whimsy
  86. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  87. alias weather="curl http://wttr.in/Nashville"
  88. alias ponysay='ponysay -b round'
  89. alias ponythink='ponythink -b ascii'
  90. if [[ "$TERM" == rxvt-unicode-256color || "$TERM" == xterm-256color ]]; then
  91. alias catimg='catimg -t'
  92. fi
  93. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  94. # Enable color support
  95. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  96. if [ -x /usr/bin/dircolors ]; then
  97. eval "`dircolors -b`"
  98. alias ls='ls --color=auto --literal'
  99. alias diff='diff --color=auto'
  100. alias grep='grep --color=auto'
  101. alias fgrep='fgrep --color=auto'
  102. alias egrep='egrep --color=auto'
  103. export -UT LS_COLORS=$LS_COLORS'ow=34;7:' ls_colors
  104. fi
  105. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106. # Host-specific aliases
  107. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108. case "$hostenv" in
  109. ( cluster )
  110. alias open='gnome-open'
  111. alias freenodes="pbsnodes | grep 'opteron' -A3 -B3 | grep 'state = free' -A2 -B1 | less"
  112. alias qm="qstat -a | grep $USER"
  113. alias get_gpu_node="qsub -I -W group_list=nbody_gpu -l nodes=1:ppn=1:gpus=1 -l pmem=1000mb -l mem=1000mb -l walltime=3:00:00"
  114. alias checkrun="showq | grep $USER | tail -n 1 | awk '{print $1}' | xargs qcat"
  115. alias usage='mmlsquota --block-size auto'
  116. ;;
  117. ( astro )
  118. alias open='kde-open'
  119. export VUSPACEHOST=`echo $USER | cut -b 1`
  120. alias mountvuspace="/sbin/mount.cifs //vuspace-$VUSPACEHOST/user ~/vuspace -o username=$USER"
  121. alias umountvuspace="/sbin/umount.cifs ~/vuspace"
  122. ;;
  123. ( linux )
  124. alias open='kde-open5'
  125. alias ssh='eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && ssh'
  126. alias scp='eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && scp'
  127. my_git() {
  128. case $* in
  129. ( push* ) shift; eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && /usr/bin/git push "$@" ;;
  130. ( pull* ) shift; eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && /usr/bin/git pull "$@" ;;
  131. ( * ) /usr/bin/git "$@" ;;
  132. esac
  133. }
  134. alias git='my_git'
  135. alias usage='/home/djsissom/Local/src/comcast-bw/comcastBandwidth.py'
  136. ;;
  137. ( osx )
  138. #alias ls='ls -G'
  139. alias ls='ls --color=auto --literal'
  140. alias top='top -o cpu'
  141. alias ssh='if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && ssh'
  142. alias rsync='if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && rsync'
  143. alias man='man -M /usr/local/opt/coreutils/libexec/gnuman:$MANPATH'
  144. ;;
  145. esac
  146. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  147. # End
  148. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  149. # vi:syntax=sh filetype=sh