Advertisement
Guest User

Untitled

a guest
Nov 8th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.15 KB | None | 0 0
  1. ##### Debug #####
  2. if [[ "$bash_debug" == 'yes' ]]; then
  3. printf '\e[38;5;41m\n\tbash_aliases start\e[0m'
  4. fi
  5. ##### End Debug #####
  6.  
  7.  
  8.  
  9. ####################################################################################################
  10. ####### OS Specific Aliases
  11. ####################################################################################################
  12. # If on Mac OS X then alias ls to use GNU binutils
  13. if [ $( uname ) == "Darwin" ]; then
  14. alias dircolors='dircolors'
  15. alias ls='gls --color=always '
  16. alias ll='gls --color=always -lh'
  17. alias l='gls --color=always -lh'
  18. alias fgrep='fgrep --color=always '
  19. alias egrep='egrep --color=always '
  20. alias grep='grep --color=always -E'
  21.  
  22. # hide/unhide folders from Finder
  23. alias hide='chflags hidden '
  24. alias unhide='chflags nohidden '
  25.  
  26. # If on Linux
  27. else
  28. # If mouse is connected then make sure to disable it
  29. if [ -n "$( xinput | grep Logitech )" ] ; then
  30. synclient touchpadoff=1
  31. fi
  32.  
  33. # Make alias to copy to clipboard from terminal
  34. if [ -n "$( which xsel )" ]; then
  35. alias pbcopy='xsel --clipboard --input'
  36. alias pbpaste='xsel --clipboard --output'
  37. fi
  38.  
  39. alias grep='grep --color -E'
  40. alias ls='ls --color=always -h'
  41. alias ll='ls --color=always -lh'
  42. alias l='ls --color=always -lAh'
  43. alias fgrep='fgrep --color=always'
  44. alias egrep='egrep --color=always'
  45. fi
  46.  
  47. # If dircolors file exists then source it with dircolors
  48. # Note: 256 bit colors '0;0;0m' = 'foreground;background;txtcolor'
  49. if [ -e "$HOME/.dircolors" ]; then
  50. eval $( dircolors ~/.dircolors )
  51. fi
  52.  
  53.  
  54. if [ -e "/usr/local/bin/gcc-4.9" ]; then
  55. alias gcc='/usr/local/bin/gcc-4.9'
  56. alias g++='/usr/local/bin/g++-4.9'
  57. fi
  58.  
  59.  
  60. ####################################################################################################
  61. ####### Useful Navigation Aliases
  62. ####################################################################################################
  63. # Useful aliases
  64. alias cd..="cd .."
  65. alias c="clear"
  66. alias e="exit"
  67. #alias ssh="ssh -X"
  68. alias ..="cd .."
  69. alias tree='tree -CA'
  70.  
  71. # hide/unhide folders from Finder
  72. alias hide='chflags hidden '
  73. alias unhide='chflags nohidden '
  74.  
  75. # shortcut to git directories
  76. alias cs1='cd ~/Documents/Computer-Science-I'
  77. alias cs2='cd ~/Documents/Computer-Science-II'
  78. alias embedded='cd ~/Documents/Computer-Science-II'
  79. alias em='cd ~/Documents/Embedded-System'
  80.  
  81. # Shortcut to folders
  82. alias tmp='cd ~/.tmp'
  83. alias dl='cd ~/Downloads'
  84. alias doc='cd ~/Documents'
  85. alias docs='cd ~/Documents'
  86. alias curr='cd ~/Google\ Drive/Current\ Course\ Material'
  87.  
  88. export EDITOR=vim
  89. alias crontab='VIM_CRONTAB=true ; crontab'
  90.  
  91. ####################################################################################################
  92. ####### Development Tool Aliases
  93. ####################################################################################################
  94. # msp430
  95. alias gcc_msp='msp430-gcc -Os -Wall -g -mmcu=msp430g2452 '
  96. alias mspdebug='mspdebug rf2500 '
  97.  
  98. ####################################################################################################
  99. ####### Misc Aliases
  100. ####################################################################################################
  101. alias feral='ssh thrice43@thrice43.pallas.feralhosting.com'
  102. alias koding='ssh kizzlebot@ukkka81497b3.kizzlebot.koding.io'
  103. alias monroe='ssh cop4331-9@monroe.cs.ucf.edu'
  104. alias testground='cd $HOME/Documents/testGrounds'
  105.  
  106. alias ec2='ssh -i /Users/kizzlebot/.ssh/ec2key.pem ubuntu@52.5.19.78'
  107. alias erl='kjell '
  108. export monroe='cop4331-9@monroe.cs.ucf.edu'
  109. #alias vim='nvim '
  110.  
  111.  
  112.  
  113. ####################################################################################################
  114. # Bash Shell Settings
  115. ####################################################################################################
  116. shopt -s nocasematch
  117. shopt -s nocaseglob
  118. shopt -s histappend
  119. shopt -s cdspell
  120. shopt -s dotglob
  121. shopt -s autocd
  122. shopt -s checkwinsize
  123.  
  124. ####################################################################################################
  125. # Disable/Enable Mac OS X Dashboard Widget stuff
  126. ####################################################################################################
  127. function dashboard(){
  128. if [ $( defaults read com.apple.dashboard mcx-disabled ) -eq 0 ]; then
  129. defaults write com.apple.dashboard mcx-disabled -boolean YES && killall Dock
  130. echo 'Dashboard Disabled'
  131. # $( defaults read com.apple.dashboard mcx-disabled )
  132. else
  133. defaults write com.apple.dashboard mcx-disabled -boolean NO && killall Dock
  134. echo 'Dashboard Enabled'
  135. # $( defaults read com.apple.dashboard mcx-disabled )
  136. fi
  137. }
  138.  
  139. ####################################################################################################
  140. # Android Developer Stuff
  141. ####################################################################################################
  142. function aDev( ){
  143. hdiutil attach /Volumes/Developer\ /android.dmg.sparseimage -mountpoint /Volumes/android;
  144. cd /Volumes/android
  145. #export HOME="$PWD"
  146. #echo Home changed to "$PWD"
  147. export PATH="/Volumes/android/bin:/Volumes/android/workingDir/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.6/bin:$PATH"
  148. cd /Volumes/android
  149. }
  150. function mountAndroid {
  151. hdiutil attach /Volumes/Developer\ /android.dmg.sparseimage -mountpoint /Volumes/android;
  152. }
  153.  
  154. alias m24='msp430-gcc -Os -Wall -I/opt/local/msp430/include -g -mmcu=msp430g2452 -o "$( echo $1 | sed 's/.c.*//g' )".elf $1'
  155. alias m25='msp430-gcc -Os -Wall -I/opt/local/msp430/include -g -mmcu=msp430g2553 -o "$( echo $1 | sed 's/.c.*//g' )".elf $1'
  156.  
  157. ####################################################################################################
  158. # MSP430 Developer Shortcuts
  159. ####################################################################################################
  160. function m2452(){
  161. MCU="msp430g2452"
  162. s=$( echo $1 | sed 's/.c.*//g' )
  163. msp430-gcc -Os -Wall -g -mmcu=$MCU -o $s.elf $1
  164. sudo mspdebug rf2500 "prog $s.elf"
  165. }
  166. function m2452d(){
  167. MCU="msp430g2452"
  168. s=$( echo $1 | sed 's/.c//g' )
  169. msp430-gcc -Os -Wall -I/opt/local/msp430/include -g -mmcu=$MCU -o $s.elf $1
  170. sudo mspdebug rf2500
  171. }
  172.  
  173. function m2553(){
  174. MCU="msp430g2553"
  175. s=$( echo $1 | sed 's/.c//g' )
  176. msp430-gcc -Os -Wall -I/opt/local/msp430/include -g -mmcu=$MCU -o $s.elf $1
  177. sudo mspdebug rf2500 "prog $s.elf"
  178. }
  179. function m2553d(){
  180. MCU="msp430g2553"
  181. s=$( echo $1 | sed 's/.c//g' )
  182. msp430-gcc -Os -Wall -I/opt/local/msp430/include -g -mmcu=$MCU -o $s.elf $1
  183. sudo mspdebug rf2500
  184. }
  185. function mspASM(){
  186. MCU="msp430g2553"
  187. C_INCLUDE_PATH=/opt/local/msp430/include
  188. s=$( echo $1 | sed 's/.c//g' )
  189. msp430-gcc -Os -Wall -I$C_INCLUDE_PATH -g -mmcu=$MCU -o $s.elf $1
  190. }
  191. function run(){
  192. gcc $1 && ./a.out ; rm a.out
  193. }
  194. function asm(){
  195. x=$1
  196. y=${x%.*}
  197. nasm -f macho $x
  198. ld -macosx_version_min 10.6 -o a.out -e main $y.o
  199. rm $y.o
  200. }
  201. # msp430-gcc -Os -mmcu=msp430x2012 -o main.elf main.c
  202. # msp430-objcopy -O ihex main.elf main.hex # generate hex file
  203. # mspdebug rf2500 "prog main.hex" # download to the launchpad
  204. #
  205. ####################################################################################################
  206. # BASH debug Stuff
  207. ###################################################################################################
  208. if [[ "$bash_debug" == 'yes' ]]; then
  209. printf '\e[38;5;41m\n\tbash_aliases end\n\e[0m'
  210. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement