msjche

MacBookAir3,2 ~/.zshrc

Jan 6th, 2013
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.45 KB | None | 0 0
  1.  
  2. ## Oh-My-Zsh
  3. ZSH=/usr/share/oh-my-zsh/
  4. ZSH_THEME="msjche" #kardan agnoster af-magic bira clean candy gentoo terminalparty
  5.  
  6. # Lines configured by zsh-newuser-install
  7. HISTFILE=~/.histfile
  8. HISTSIZE=1000
  9. SAVEHIST=1000
  10.  
  11. # Set to this to use case-sensitive completion
  12. CASE_SENSITIVE="true"
  13.  
  14. # Comment this out to disable bi-weekly auto-update checks
  15. DISABLE_AUTO_UPDATE="true"
  16.  
  17. # Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
  18. # export UPDATE_ZSH_DAYS=13
  19.  
  20. # Uncomment following line if you want to disable colors in ls
  21. # DISABLE_LS_COLORS="true"
  22.  
  23. # Uncomment following line if you want to disable autosetting terminal title.
  24. # DISABLE_AUTO_TITLE="true"
  25.  
  26. # Uncomment following line if you want red dots to be displayed while waiting for completion
  27. COMPLETION_WAITING_DOTS="true"
  28.  
  29. # Default Programs
  30. export EDITOR="vim"
  31. export PAGER="less"
  32. export BROWSER="dwb"
  33. export MOVPLAY="mplayer"
  34. export PICVIEW="feh"
  35. export SNDPLAY="mplayer"
  36.  
  37. # File Extensions
  38. for ext in html org php com net no; do alias -s $ext=$BROWSER; done
  39. for ext in txt tex py PKGBUID; do alias -s $ext=$EDITOR; done
  40. for ext in png jpg gif; do alias -s $ext=$PICVIEW; done
  41. for ext in mpg wmv avi mkv; do alias -s $ext=$MOVPLAY; done
  42. for ext in wav mp3 ogg; do alias -s $ext=$SNDPLAY; done
  43.  
  44. ########################################################
  45. ######################## ALIASES #######################
  46. ########################################################
  47.  
  48. alias bub='say en beau is a bunkace'
  49.  
  50. ## Pacman / Yaourt
  51. alias UU='packer-color -Syu'
  52. alias Y='yaourt'
  53. alias YI='yaourt -S'
  54. alias P='packer-color'
  55. alias PI='packer-color -S'
  56. alias pac='sudo pacman -S'
  57. alias pac-r='sudo pacman -R'
  58. alias pac-search='sudo pacman -Ss'
  59. alias pkg-list='pacman -Ql'
  60.  
  61. ## Directories
  62. alias ll='ls -l'
  63. alias la='ls -A'
  64. alias l='ls'
  65. alias C='clear'
  66. alias SV='sudo vim'
  67. alias home='cd ~'
  68. alias ..='cd ..'
  69. alias k='exit'
  70. alias te='trash-empty'
  71. alias tl='trash-list'
  72. alias trash='trash-put'
  73. alias tr='trash-rm'
  74. alias lsTrash='ls ~/.local/share/Trash/files/'
  75. alias cdTrash='cd ~/.local/share/Trash/files/'
  76. alias lD='ls ~/Downloads'
  77. alias D='cd ~/Downloads'
  78. alias yt='cd ~/Downloads/YouTube'
  79. alias cleanYT='rm ~/Downloads/YouTube/*.webm*'
  80. alias sG='sudo gedit'
  81.  
  82. ## Awesome Theming
  83. alias eAZ='vim ~/Scripts/ThemeFiles/rc.lua.zenburn'
  84. alias eAD='vim ~/Scripts/ThemeFiles/rc.lua.dunzor'
  85. alias eAO='vim ~/Scripts/ThemeFiles/rc.lua.obscur'
  86. alias eAM='vim ~/Scripts/ThemeFiles/rc.lua.matrix'
  87. alias eXZ='vim ~/Scripts/ThemeFiles/.Xresources.zenburn'
  88. alias eXD='vim ~/Scripts/ThemeFiles/.Xresources.dunzor'
  89. alias eXM='vim ~/Scrtips/ThemeFiles/.Xresources.matrix'
  90.  
  91. ## X Resources Stuff
  92. alias eX='vim ~/.Xresources'
  93. alias XTR='xrdb -merge ~/.Xresources'
  94.  
  95. ## Zsh Stuff
  96. alias eZ='vim ~/.zshrc'
  97. alias eZG='gedit ~/.zshrc'
  98. alias eOMZ='sudo vim /usr/share/oh-my-zsh/themes/msjche.zsh-theme'
  99. alias Z='source ~/.zshrc'
  100.  
  101. ## Vim Stuff
  102. alias eV='vim ~/.vimrc'
  103. alias e='vim'
  104.  
  105. ## Rip CDs
  106. alias CDinfo='cdparanoia -vsQ'
  107. alias rip='cdparanoia -B'
  108. alias mp3='for t in track{01-14}*.wav; do lame -b 320 $t; done'
  109.  
  110. ## Scripts
  111. alias activate='chmod 755'
  112. alias BB='sudo ~/Scripts/brightness.sh'
  113. alias dunzor='~/Scripts/dunzor.sh'
  114. alias zenburn='~/Scripts/zenburn.sh'
  115. alias darkburn='~/Scripts/darkburn.sh'
  116. alias obscur='~/Scripts/obscur.sh'
  117. alias matrix='~/Scripts/matrix.sh'
  118. alias tpb='~/Scripts/tpb.sh'
  119. alias torrentzeu='~/Scripts/torrentzeu.sh'
  120. alias top100='~/Scripts/top100.sh'
  121. alias time_international='~/Scripts/time_international.sh'
  122. alias natgeo='~/Scripts/natgeo.sh'
  123. alias ballz='python ~/Scripts/Games/Ballz.py'
  124.  
  125. ## Transmission
  126. alias TN='transmission-daemon && transmission-remote-cli'
  127.  
  128. ## News and Music
  129. alias MP='ncmpcpp'
  130. alias news='newsbeuter'
  131. alias pods='podbeuter'
  132. alias T='turses'
  133. alias ut='youtube-viewer'
  134.  
  135. ## Multimedia
  136. alias irc='irssi -c irc.freenode.net'
  137. alias M='mplayer'
  138. alias watch='livestreamer -p mplayer'
  139.  
  140. ## Google Calenar
  141. alias gcal-week='gcalcli --width 12 calw'
  142. alias gcal='gcalcli --width 12 calm'
  143. alias gcal-add='gcalcli quick'
  144. alias gcal-agenda='gcalcli agenda'
  145.  
  146. ## Peer Guardian
  147. alias pgl-update='sudo pglcmd update'
  148. alias pgl-start='sudo pglcmd restart'
  149. alias pgl-status='sudo pglcmd status'
  150. alias pgl-dump='sudo pglcmd stats'
  151. alias pgl-test='sudo pglcmd test'
  152. alias pgl-stop='sudo pglcmd stop'
  153.  
  154. ## w3m
  155. alias net='w3m'
  156. alias net-cookie='w3m -cookie'
  157.  
  158. ## Check Screencast
  159. alias FF-check-raw='mplayer ~/Screencasts/screencast.avi'
  160. alias FF-check-final='mplayer ~/Screencasts/screencast.mp4'
  161.  
  162. ## Net
  163. alias WW='wicd-curses'
  164. alias net-hogs='sudo nethogs wlp1s0'
  165. alias net-driftnet='echo "see pics from other computers on network" && sudo driftnet -i wlan0'
  166. alias net-ettercap='echo "set up interface to capture network data" && sudo ettercap -TQM arp -i wlan0 //'
  167. alias net-urlsnarf='echo "see which websites others on network are visiting" && sudo urlsnarf -i wlan0 |cut -d\" -f4'
  168. alias net-scan='sudo arp-scan -l'
  169. alias iftop='sudo iftop -p -n'
  170. alias slurm='slurm -i wlan0'
  171.  
  172. ## Misc
  173. alias flux='xflux -z 94596'
  174. alias X='xscreensaver &'
  175. alias kX='pkill xscreensaver'
  176. alias kF='pkill xflux'
  177. alias pic='tiv'
  178. alias nvidia='nvidia-smi -q -d TEMPERATURE'
  179. alias clock='tty-clock -c -C 4'
  180. alias date-time='watch -n 1 -t date'
  181. alias stopwatch='echo "cntl-z to end" & time cat'
  182. alias starwars='telnet towel.blinkenlights.nl'
  183. alias info='inxi -F'
  184. alias cap='scrot -d 4'
  185. alias rip='sound-juicer'
  186. alias vidterm='mplayer -vo caca'
  187. alias music='sh ~/Scripts/music.sh & '
  188. alias comp='compton &'
  189. alias kcomp='pkill compton'
  190.  
  191. ###########################################################
  192. ######################## FUNCTIONS ########################
  193. ###########################################################
  194.  
  195. ## No video / music only
  196. ut-listen() { youtube-viewer -n $@ ;}
  197.  
  198. ## Vim help page
  199. :h() { vim +":h $1" +'wincmd o' +'nnoremap q :q!<CR>' ;}
  200.  
  201. ## Command-line calculator
  202. calc() { python -ic "from __future__ import division; from math import *; from random import *" ;}
  203.  
  204. ## Commandline Fu
  205. cmdfu() { curl "http://www.commandlinefu.com/commands/matching/$(echo "$@" \
  206. | sed 's/ /-/g')/$(echo -n $@ | base64)/plaintext" ;}
  207.  
  208. ##Check if websites are down
  209. down4me() { curl -s "http://www.downforeveryoneorjustme.com/$1" | sed '/just you/!d;s/<[^>]*>//g';}
  210.  
  211. ### Transmission ###
  212.  
  213. # lightweight torrent daemon, has option for cli, webui, ncurses, and gui frontend
  214. tsm-clearcompleted() {
  215. transmission-remote -l | grep 100% | grep Done | \
  216. awk '{print $1}' | xargs -n 1 -I % transmission-remote -t % -r ;}
  217. tsm() { transmission-remote --list ;}
  218. tsm-start() { transmission-daemon ;}
  219. tsm-stop() { pkill tramsmission-daemon ;}
  220. tsm-altspeedenable() { transmission-remote --alt-speed ;}
  221. tsm-altspeeddisable() { transmission-remote --no-alt-speed ;}
  222. tsm-add() { transmission-remote --add "$1" ;}
  223. tsm-askmorepeers() { transmission-remote -t"$1" --reannounce ;}
  224. tsm-pause() { transmission-remote -t"$1" --stop ;}
  225. tsm-start-torrent() { transmission-remote -t"$1" --start ;}
  226. tsm-purge() { transmission-remote -t"$1" --remove-and-delete ;} # will delete data also
  227. tsm-remove() { transmission-remote -t"$1" --remove ;} # does not delete data
  228. tsm-info() { transmission-remote -t"$1" --info ;}
  229. tsm-speed() { while true;do clear; transmission-remote -t"$1" -i | grep Speed;sleep 1;done ;}
  230.  
  231. ### FFMPEG Screencasting ###
  232.  
  233. ffx_MONO="1" # mono
  234. ffx_DUAL="2" # dual channel
  235. ffx_HW="hw:1,0" # alsa; run 'cat /proc/asound/pcm' to change to the correct numbers
  236. ffx_PULSE="pulse" # pulseaudio; might have to install pavucontrol to change volume
  237. ffx_FPS="15" # frame per seconds
  238. ffx_WIN_FULL=1440x900 # record fullscreen
  239. ffx_AUDIO="pcm_s16le" # audio codec
  240. ffx_VIDEO="libx264" # video codec
  241. ffx_PRESET="ultrafast" # preset error? run 'x264 -h' replace with fast,superfast, slow ..etc
  242. ffx_CRF="0"
  243. ffx_THREADS="0"
  244. ffx_SCALE="scale=1920x1080" # scale resolution, no black bars on sides of video on youtube
  245. ffx_OUTPUT=~/Screencasts/screencast.avi
  246. ffx_OUTPUT_FINAL=~/Screencasts/screencast.mp4
  247. # Note: -vf is optional delete if you want, -y is to overwrite existing file
  248.  
  249. FF-full() { ffmpeg \
  250. -f alsa \
  251. -ac $ffx_MONO \
  252. -i $ffx_PULSE \
  253. -f x11grab \
  254. -r $ffx_FPS \
  255. -s $ffx_WIN_FULL \
  256. -i :0.0 \
  257. -acodec $ffx_AUDIO \
  258. -vcodec $ffx_VIDEO \
  259. -preset $ffx_PRESET \
  260. -crf $ffx_CRF \
  261. -threads $ffx_THREADS \
  262. -vf $ffx_SCALE \
  263. -y $ffx_OUTPUT
  264. }
  265.  
  266. # capture single window, use mouse cursor to select window you want to record
  267. FF-window() {
  268. ffx_INFO=$(xwininfo -frame)
  269. ffmpeg \
  270. -f alsa \
  271. -ac $ffx_MONO \
  272. -i $ffx_PULSE \
  273. -f x11grab \
  274. -r $ffx_FPS \
  275. -s $(echo $ffx_INFO \
  276. | grep -oEe 'geometry [0-9]+x[0-9]+'\
  277. | grep -oEe '[0-9]+x[0-9]+') \
  278. -i :0.0+$(echo $ffx_INFO | grep \
  279. -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' \
  280. | grep -oEe '[0-9]+\+[0-9]+' | sed \
  281. -e 's/\+/,/' ) \
  282. -acodec $ffx_AUDIO \
  283. -vcodec $ffx_VIDEO \
  284. -preset $ffx_PRESET \
  285. -crf $ffx_CRF \
  286. -threads $ffx_THREADS \
  287. -y $ffx_OUTPUT \
  288. }
  289.  
  290. FF-convert() {
  291. ffmpeg \
  292. -i $ffx_OUTPUT \
  293. -ar 22050 \
  294. -ab 32k \
  295. -strict -2 \
  296. $ffx_OUTPUT_FINAL
  297. }
  298.  
  299. Convert() {
  300. ffmpeg \
  301. -i $1 \
  302. -ar 22050 \
  303. -ab 32k \
  304. -strict -2 \
  305. output.avi
  306. }
  307.  
  308.  
  309.  
  310. ## Check Internal and External IPs ##
  311. my-ip() {
  312. echo "--------------- Network Information ---------------"
  313. # newer system like arch
  314. ip addr | awk '/global/ {print $1,$2}' | cut -d\/ -f1
  315. ip addr | awk '/global/ {print $3,$4}'
  316. ip addr | awk '/ether/ {print $1,$2}'
  317. ip addr | awk '/scope link/ {print $1,$2}' | cut -d\/ -f1
  318. # older system like debian
  319. ifconfig | awk '/inet addr/ {print $1,$2}' | awk -F: '{print $1,$2}'
  320. ifconfig | awk '/Bcast/ {print $3}' | awk -F: '{print $1,$2}'
  321. ifconfig | awk '/inet addr/ {print $4}' | awk -F: '{print $1,$2}'
  322. ifconfig | awk '/HWaddr/ {print $4,$5}'
  323. ifconfig | awk '/Scope:Link/ {print $1,$3}' | cut -d\/ -f1
  324. echo Current IP $(curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+")
  325. echo "---------------------------------------------------"
  326. }
  327.  
  328. ## Google Translate Functions ##
  329. say() {
  330.  
  331. mplayer -user-agent Mozilla \
  332. "http://translate.google.com/translate_tts?ie=UTF-8&tl="$1"&q=$(echo "$@" \
  333. | cut -d ' ' -f2- | sed 's/ /\+/g')" > /dev/null 2>&1 ;}
  334.  
  335. say-translation() {
  336.  
  337. lang=$1
  338. trans=$(translate {=$lang} "$(echo "$@" | cut -d ' ' -f2- | sed 's/ /\+/g')" )
  339. echo $trans
  340. mplayer -user-agent Mozilla \
  341. "http://translate.google.com/translate_tts?ie=UTF-8&tl=$lang&q=$trans" > /dev/null 2>&1 ;}
  342.  
  343. ##############################################################
  344. ########################## PODCASTS ##########################
  345. ##############################################################
  346.  
  347. nvlc-podcast() { nvlc --no-color -S podcast --podcast-urls "$@" ;}
  348. pods-LinuxActionShow() { nvlc-podcast "http://feeds.feedburner.com/computeractionshowvideo" ;}
  349. pods-Unfiltered() { nvlc-podcast "http://www.jupiterbroadcasting.com/feeds/unfilterHD.xml" ;}
  350. pods-Scibyte() { nvlc-podcast "http://feeds.feedburner.com/scibytelarge " ;}
  351. pods-RonPaul() { nvlc-podcast "https://www.google.com/url?q=http://www.ronpaul2012podcast.com/feed/&sa=U&ei=h8NIUbzfJoXJiQL4uoCoDw&ved=0CDYQFjAI&sig2=N2y3rxIlKxYDRI-Z9U8yRw&usg=AFQjCNGmGih9EAkV2JfSw2Nj64V90Jk5qg" ;}
  352. pods-StefanMolyneux() { nvlc-podcast "http://feeds.feedburner.com/FreedomainRadioVolume6" ;}
  353. pods-JoeRoganExperience() { nvlc-podcast "htthttp://joeroganexp.joerogan.libsynpro.com/irssp://joeroganexp.joerogan.libsynpro.com/irss" ;}
  354. pods-FreedomFeens() { nvlc-podcast "http://www.freedomfeens.com/feed/" ;}
  355. pods-GoldMoneyVideos() { nvlc-podcast "http://feeds.feedburner.com/GoldmoneyRssFeedGoldVideos" ;}
  356. pods-GoldMoneyPodcasts() { nvlc-podcast "http://feeds.feedburner.com/GoldmoneyFoundationPodcasts" ;}
  357. #pod-() { nvlc-podcast "" ;}
  358.  
  359. ##############################################################
  360. ######################## LIVE STREAMS ########################
  361. ##############################################################
  362.  
  363. # News
  364. live-news-cnn() { livestreamer -p mplayer http://www.justin.tv/msnbc_live_stream_cnn#/w/5008673600 live ;}
  365. live-news-cnn_international() { livestreamer -p mplayer http://www.justin.tv/rentadrone_cnbc#/w/5011049360/22 live ;}
  366. live-news-cbs() { livestreamer -p mplayer http://www.ustream.tv/cbsnews live ;}
  367. live-news-fox() { livestreamer -p mplayer http://www.justin.tv/newswatch_2#/w/5013818384/5 live ;}
  368. live-news-prisonplanet() { livestreamer -p mplayer http://www.ustream.tv/channel/alex-jones---infowars-com---prisonplanet-tv live ;}
  369. live-news-KRON_San_Francisco() { livestreamer -p mplayer http://www.ustream.tv/kron4news best ;}
  370. live-news-The_FED() { livestreamer -p mplayer http://www.ustream.tv/federalreserve live ;}
  371.  
  372. # Series
  373. live-series-simpsons() { livestreamer -p mplayer http://www.justin.tv/arconai_244#/w/5013781232/19 live ;}
  374. live-series-southpark() { livestreamer -p mplayer http://www.justin.tv/arconai_229#/w/5622202400/179 best ;}
  375. live-series-survival() { livestreamer -p mplayer http://www.justin.tv/survivor101#/w/5531579536/12 best ;}
  376. live-series-criminal_minds() { livestreamer -p mplayer http://www.justin.tv/lurking_in_the_dark17 live ;}
  377. live-series-mythbusters() { livestreamer -p mplayer best ;}
  378. live-series-married_with_children() { livestreamer -p mplayer http://www.justin.tv/mwconjtv#/w/4992184096/88 live ;}
  379. live-series-stargate_SG1() { livestreamer -p mplayer http://www.justin.tv/oldngr8#/w/5006964064/9 live ;}
  380. live-series-that_70s_show() { livestreamer -p mplayer http://www.justin.tv/highspothorror128#/w/4994695216/102 live ;}
  381.  
  382. # Science
  383. live-science-the_universe() { livestreamer -p mplayer http://www.justin.tv/the_lost_continent#/w/5005014000/48 live ;}
  384.  
  385. # Movies
  386.  
  387. #live-movies-horror-2000_2013_HQ() { livestreamer -p mplayer http://www.justin.tv/horrorhq0010#/w/5074870864/20 live ;}
  388. live-movies-horror4life() { livestreamer -p mplayer http://www.justin.tv/finn_horrorstfu51 live ;}
  389. #live-movies-horror-2() { livestreamer -p mplayer http://www.justin.tv/jags__movies04#/w/5008275648/4 live ;}
  390.  
  391. live-movies-new_releases-2010_2013() { livestreamer -p mplayer http://www.justin.tv/videoisnothere6 live ;}
  392. #live-movies-new_releases-2012_2013_HQ() { livestreamer -p mplayer http://www.justin.tv/movies_tv68#/w/5056426000/115 live ;}
  393. live-movies-movies_2010_2013() { livestreamer -p mplayer http://www.justin.tv/gewinnen_duh_bringen live ;}
  394.  
  395. live-movies-general() { livestreamer -p mplayer http://www.justin.tv/420nomad554 live ;}
  396. #live-movies-general-movies_n_that() { livestreamer -p mplayer http://www.justin.tv/walterkronic#/w/5013245536/8 live ;}
  397.  
  398.  
  399.  
  400. ## Capture video streams
  401.  
  402. sniff-begin() { sudo iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT ;}
  403. sniff-capture-rtmpsrv() { rtmpsrv ;}
  404. sniff-end() { sudo iptables -t nat -D OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT ;}
  405.  
  406. ## Rtmpsrv Feeds (may need to add -v before -r)
  407.  
  408. # Russia Today US
  409. iptv-RT_US() { rtmpdump \
  410. -r "rtmp://rt.fms-04.visionip.tv/live" \
  411. -a "live" \
  412. -f "LNX 11,2,202,270" \
  413. -W "http://rt.com/s/swf/player5.4.viral.swf" \
  414. -p "http://rt.com" -y "RT_US_2" \
  415. | mplayer - ;}
  416.  
  417. # Bloomberg
  418. iptv-Bloomberg() { rtmpdump \
  419. -v \
  420. -r rtmp://cp116697.live.edgefcs.net:80/live/BnazlkNDpCIcD-QkfyZCQKlRiiFnVa5I_640_360_440@18679 \
  421. -W http://player.ooyala.com/cacheable/c78f866930724ffedfe8cf5349712569/player_v2.swf \
  422. -p http://tvpc.com \
  423. | mplayer - ;}
  424.  
  425. # MSNBC
  426. iptv-MSNBC() { rtmpdump \
  427. -v \
  428. -r "rtmp://a.cdn.msnbclive.eu/edge" \
  429. -y "msnbc_live" \
  430. -W "http://msnbclive.eu/getswf.php?name=player.swf" \
  431. -p "http://www.rentadrone.tv/msnbc-live-rockinroosters/" \
  432. | mplayer - ;}
  433.  
  434. # Rueters
  435. iptv-Rueters() { rtmpdump \
  436. -r "rtmp://media9.lsops.net/reuters/" \
  437. -a "reuters/" -W "http://reuters.cdn.livestation.com/flash/player/5.7/player.swf" \
  438. -p "http://reuters.livestation.com/demo" \
  439. --live \
  440. -y "reuters_rlsweba_en_veryhigh.sdp" \
  441. | mplayer -;}
  442.  
  443. ##########################################################
  444. ########################## MODS ##########################
  445. ##########################################################
  446.  
  447.  
  448.  
  449. plugins=(git archlinux vi-mode themes zsh-completions color-command)
  450. source /usr/share/zsh/plugins/zsh-syntax-highlight/zsh-syntax-highlighting.zsh
  451. source $ZSH/oh-my-zsh.sh
Add Comment
Please, Sign In to add comment