settings 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ##### My (demuredemeanor) bashrc sub source machine settings script
  2. # Uses tabstop=4; shiftwidth=4 tabs; foldmarker={{{,}}};
  3. # https://notabug.org/demure/dotfiles/
  4. # legacy repo http://github.com/demure/dotfiles
  5. # vim:set syntax=sh:
  6. ### Settings ### {{{
  7. ### Mac Settings ### {{{
  8. if [ $OSTYPE == 'darwin13' ]; then
  9. ### Mac Sourcing ### {{{
  10. __ssh_agent
  11. ## Add git completion
  12. if [ -f `brew --prefix`/etc/bash_completion ]; then
  13. source `brew --prefix`/etc/bash_completion
  14. fi
  15. ## Brew completion
  16. if [ -f `brew --prefix`/Library/Contributions/brew_bash_completion.sh ]; then
  17. source `brew --prefix`/Library/Contributions/brew_bash_completion.sh
  18. fi
  19. ### stderred ### {{{
  20. #if [ -f /Projects/git/stderred/build/libstderred.dylib${DYLD_INSERT_LIBRARIES:+:$DYLD_INSERT_LIBRARIES} ]; then
  21. #export DYLD_INSERT_LIBRARIES="/Projects/git/stderred/build/libstderred.dylib${DYLD_INSERT_LIBRARIES:+:$DYLD_INSERT_LIBRARIES}"
  22. ##export STDERRED_ESC_CODE=$(printf "\e[1;31m")
  23. #fi
  24. ### End stderred ### }}}
  25. ### End Mac Sourcing ### }}}
  26. ### Mac Aliases ### {{{
  27. if [[ $- == *i* ]]; then
  28. alias google='ping -c 1 www.google.com && growlnotify -m "google pinged"'
  29. alias ardrestart='sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -menu'
  30. alias vi='vim'
  31. alias fvreboot='sudo fdesetup authrestart'
  32. alias rebuild_open_with='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"'
  33. ## Aliases for nicing
  34. alias fast='sudo nice -n -10'
  35. alias slow='nice -n 20'
  36. ### End Mac Aliases ### }}}
  37. fi
  38. fi
  39. ### End Mac Settings ### }}}
  40. ### MA Settings ### {{{
  41. if [ $HOSTNAME == 'ma.sdf.org' ]; then
  42. export PATH=/usr/pkg/bin:/usr/local/bin:/usr/bin:/bin
  43. export TZ=EST5EDT
  44. source /etc/bash_completion.d/git ## Add git completion
  45. if [[ $- == *i* ]]; then
  46. alias bb='bboard'
  47. alias mutt='~/bin/mutt'
  48. unalias svi
  49. fi
  50. #__ssh_agent ## No longer main server
  51. fi
  52. ### End MA Settings ### }}}
  53. ### For pi ### {{{
  54. if [ $HOSTTYPE == 'arm' ]; then
  55. source /etc/bash_completion.d/git ## Add git completion
  56. if [[ $- == *i* ]]; then
  57. alias ls='ls --color=auto'
  58. alias vi='vim'
  59. alias vnc='vncserver :1 -geometry 1024x700 -depth 24'
  60. alias cdtrans='cd /var/lib/transmission-daemon/downloads'
  61. fi
  62. __ssh_agent
  63. fi
  64. ### End For pi ### }}}
  65. ### For iOS ### {{{
  66. if [ $OSTYPE == 'darwin9' ]; then
  67. if [[ $- == *i* ]]; then
  68. alias svi='sudo -E vi'
  69. fi
  70. fi
  71. ### End For iOS ### }}}
  72. ### For #!, and debian Including Laptop and Netbook ### {{{
  73. if [[ $MACHTYPE == 'x86_64-pc-linux-gnu' || $MACHTYPE == 'i486-pc-linux-gnu' ]]; then
  74. if [[ $- == *i* ]]; then
  75. alias ls='ls --color=auto'
  76. alias vi='vim'
  77. alias mp='mpv'
  78. alias ssht='sshuttle --dns -vr ma 0/0'
  79. alias hdmi-mirror='xrandr --output HDMI1 --mode 1360x768'
  80. alias hdmi-second='xrandr --output HDMI1 --mode 1360x768 --right-of LVDS1'
  81. alias hdmi-off='xrandr --output HDMI1 --off'
  82. alias sd-card='sudo setpci -s 00:1c.2 0x50.B=0x41'
  83. alias xc="xclip -selection c"
  84. alias www-logs='sudo lnav /var/log/nginx/access.log /var/log/nginx/error.log /var/log/fail2ban.log'
  85. export NVIM_HOME="$HOME/Dropbox/Notational Data"
  86. fi
  87. #if [[ $HOSTNAME != "vps-of-doom" ]]; then
  88. #__gpg_agent
  89. #fi
  90. __ssh_agent
  91. fi
  92. ### End For #! ### }}}
  93. ### For SDF Main Cluster ### {{{
  94. if [[ "$MACHTYPE" == "x86_64--netbsd" && "$OSTYPE" == "netbsd" ]]; then
  95. #LSCOLORS='exfxcxdxbxegedabagacad'
  96. export TZ=EST5EDT
  97. if [[ $- == *i* ]]; then
  98. alias help='/usr/local/bin/help'
  99. alias bb='bboard'
  100. alias cdircd='cd /sys/pkg/etc/unrealircd/'
  101. unalias svi
  102. #alias ls='colorls -G'
  103. fi
  104. fi
  105. ### End For SDF Main Cluster ### }}}
  106. ### For OpenWrt ### {{{
  107. if [ "$MACHTYPE" == "mips-openwrt-linux-gnu" ]; then
  108. alias opkgup="eval \$(opkg list_installed | sed 's/ - .*//' | sed 's/^/opkg upgrade /')"
  109. unalias vi
  110. unalias grep
  111. fi
  112. ### End For OpenWrt ### }}}
  113. ### Testing ### {{{
  114. ## Fix tmux DISPLAY
  115. # "Yubinkim.com totally wrote this one herself"
  116. # "Run this script outside of tmux!"
  117. # for name in `tmux ls -F '#{session_name}'`; do
  118. # tmux setenv -g -t $name DISPLAY $DISPLAY #set display for all sessions
  119. # done
  120. ### End Testing ### }}}
  121. ### End Settings ### }}}