SHARE
TWEET

vagner

a guest Feb 14th, 2020 55 in 26 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. # ~/.bashrc: executed by bash(1) for non-login shells.
  3. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  4. # for examples
  5.  
  6. # Note: if your '.bashrc' does not load in VirtualConsole, look to see if you have a '.bash_profile' on your 'home' folder, rename it and see if your '.bashrc' loads well...
  7.  
  8. #####################################################
  9.  
  10. # setxkbmap -option caps:escape
  11. # swap_capsInX.sh
  12.  
  13. #####################################################
  14.  
  15. export PAGER=less
  16.  
  17. # If not running interactively, don't do anything
  18. case $- in
  19.     *i*) ;;
  20.       *) return;;
  21. esac
  22.  
  23. #####################################################
  24.  
  25. # don't put duplicate lines or lines starting with space in the history.
  26. # See bash(1) for more options
  27. HISTCONTROL=ignoreboth
  28.  
  29. # append to the history file, don't overwrite it
  30. shopt -s histappend
  31.  
  32. #####################################################
  33.  
  34. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  35.  
  36. HISTSIZE=1000
  37. HISTFILESIZE=2000
  38. HISTTIMEFORMAT='%b %d %I:%M %p '
  39. HISTIGNORE="bash:cd:pwd:clear:history:pwd:exit:ls:ls -la:ll:./configure:make:sudo make install:make install:exit:"
  40.  
  41. # you have to disable these programs to use 'rsync'
  42.  
  43. #####################################################
  44.  
  45. # update the values of LINES and COLUMNS.
  46. shopt -s checkwinsize
  47.  
  48. #####################################################
  49.  
  50. # If set, the pattern "**" used in a pathname expansion context will
  51. # match all files and zero or more directories and subdirectories.
  52. #shopt -s globstar
  53.  
  54. # make less more friendly for non-text input files, see lesspipe(1)
  55. #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  56.  
  57. #####################################################
  58.  
  59. # set variable identifying the chroot you work in (used in the prompt below)
  60. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  61.     debian_chroot=$(cat /etc/debian_chroot)
  62. fi
  63.  
  64. #####################################################
  65.  
  66. # set a fancy prompt (non-color, unless we know we "want" color)
  67. case "$TERM" in
  68.     xterm-color|*-256color) color_prompt=yes;;
  69. esac
  70.  
  71. # uncomment for a colored prompt, if the terminal has the capability; turned
  72. # off by default to not distract the user: the focus in a terminal window
  73. # should be on the output of commands, not on the prompt
  74. #force_color_prompt=yes
  75.  
  76. if [ -n "$force_color_prompt" ]; then
  77.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  78.     # We have color support; assume it's compliant with Ecma-48
  79.     # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  80.     # a case would tend to support setf rather than setaf.)
  81.     color_prompt=yes
  82.     else
  83.     color_prompt=
  84.     fi
  85. fi
  86.  
  87. if [ "$color_prompt" = yes ]; then
  88.     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\t\n\w\[\033[00m\]\$ '
  89. else
  90.     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\t\n\w\$ '
  91. fi
  92. unset color_prompt force_color_prompt
  93.  
  94. # If this is an xterm set the title to user@host:dir
  95. case "$TERM" in
  96. xterm*|rxvt*)
  97.     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \t\n\w\a\]$PS1"
  98.     ;;
  99. *)
  100.     ;;
  101. esac
  102.  
  103. #####################################################
  104. # Tmux auto-completion
  105. # source tmux_autocompletion.sh
  106.  
  107. # Tmux PS1
  108. #PS1="$PS1"'$([ -n "$TMUX" ] && tmux setenv TMUXPWD_$(tmux display -p "#D" | tr -d %) "$PWD")'
  109. # Tmux bash-completion
  110. # vim ft=sh
  111. # START tmux completion
  112. # This file is in the public domain
  113. # See: http://www.debian-administration.org/articles/317 for how to write more.
  114. # Usage: Put "source bash_completion_tmux.sh" into your .bashrc
  115.  
  116. #_tmux()
  117. #{
  118. #   local cur prev words cword;
  119. #   _init_completion || return;
  120. #   if [[ $cword -eq 1 ]]; then
  121. #       COMPREPLY=($( compgen -W "$(tmux list-commands | cut -d' ' -f1)" -- "$cur" ));
  122. #       return 0
  123. #   fi
  124. #}
  125. #
  126. #complete -F _tmux tmux
  127. #
  128. # END tmux completion
  129.  
  130. #####################################################
  131.  
  132. # enable color support of ls and also add handy aliases
  133. if [ -x /usr/bin/dircolors ]; then
  134.     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  135.  
  136.     #alias dir='dir --color=auto'
  137.     #alias vdir='vdir --color=auto'
  138.  
  139.     #alias grep='grep --color=auto'
  140.     #alias fgrep='fgrep --color=auto'
  141.     #alias egrep='egrep --color=auto'
  142. fi
  143.  
  144. #####################################################
  145.  
  146. # colored GCC warnings and errors
  147. #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
  148.  
  149. # some more ls aliases
  150. #alias ll='ls -l'
  151. #alias la='ls -A'
  152. #alias l='ls -CF'
  153.  
  154. #####################################################
  155.  
  156. # Alias definitions.
  157. # You may want to put all your additions into a separate file like
  158. # ~/.bash_aliases, instead of adding them here directly.
  159. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  160.  
  161. if [ -f ~/.bash_aliases ]; then
  162.     . ~/.bash_aliases
  163. fi
  164.  
  165. #####################################################
  166. # This should be enable on Debian
  167.  
  168. # enable programmable completion features (you don't need to enable
  169. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  170. # sources /etc/bash.bashrc).
  171.  
  172. # if ! shopt -oq posix; then
  173. #   if [ -f /usr/share/bash-completion/bash_completion ]; then
  174. #     . /usr/share/bash-completion/bash_completion
  175. #   elif [ -f /etc/bash_completion ]; then
  176. #     . /etc/bash_completion
  177. #   fi
  178. # fi
  179.  
  180. #####################################################
  181. # https://www.cyberciti.biz/faq/freebsd-bash-installation/
  182. # Bash completion on FreeBSD
  183.  
  184. [[ $PS1 && -f /usr/local/share/bash-completion/bash_completion.sh ]] && \
  185.     source /usr/local/share/bash-completion/bash_completion.sh
  186.  
  187. #####################################################
  188.  
  189. # Emacs config
  190. export ALTERNATE_EDITOR=""
  191. export EDITOR="emacsclient -t"                  # $EDITOR should open in terminal
  192. export VISUAL="emacsclient -c -a emacs"         # $VISUAL opens in GUI with non-daemon as alternate
  193.  
  194.  
  195. [ -s "/home/vagner/.dnx/dnvm/dnvm.sh" ] && . "/home/vagner/.dnx/dnvm/dnvm.sh" # Load dnvm
  196.  
  197.  
  198. #####################################################
  199.  
  200. # Note: if your '.bashrc' does not load in VirtualConsole, look to see if you have a '.bash_profile' on your 'home' folder, rename it and see if your '.bashrc' loads well...
  201.  
  202.  
  203. #####################################################
  204.  
  205. # Block cursor in VT
  206. #echo -e "\033[?8c" #white-block blinking cursor
  207. #echo -e '\033[?17;0;64c' #red-block non-blinking cursor
  208. #echo -e '\033[?17;0;60c' #blue-block non-blinking cursor
  209. #echo -e '\033[?17;0;80c' #purple-block non-blinking cursor
  210. #echo -e '\033[?17;0;100c' #yellow-block non-blinking cursor
  211.  
  212. #####################################################
  213.  
  214. # https://www.emacswiki.org/emacs/CursorOnLinuxConsole
  215. # Edit your linux term entry. First, produce two files: one for backup, one for editing
  216. # ~$ infocmp linux > ~vagner/bin/linux-term-orig
  217. # ~$ infocmp linux > ~vagner/bin/linux-term-edited
  218. # Now edit linux-term-edited and change the cnorm and cvvis entries. Replace the \E[…c entries with your own \E…c entry. In the case of the big red block cursor, use \E[?17;0;64c
  219. # And then install it
  220. # ~$ tic ~vagner/bin/linux-term-edited
  221.  
  222.  # If on console, change cursor colour according to
  223.  # /usr/src/linux/Documentation/VGA-softcursor.txt
  224.  # Reset using echo -e '\033[?2c'
  225.  
  226.  if [ $TERM = 'linux' -a $SHELL == '/bin/bash' ]; then
  227.      tic ~vagner/bin/cursor-vt-edited
  228.      echo -e '\033[?8c'
  229.  fi
  230.  
  231. #####################################################
  232.  
  233. neofetch
  234. # fortune bible| cowsay -f sheep
  235. fortune bible| cowsay -f bud-frogs
  236. # verse| cowsay -f sheep
  237.  
  238. alias elinks="elinks -no-connect"
  239.  
  240. #####################################################
  241.  
  242. alias open='xdg-open'
  243. alias rm='rm -iv'
  244. alias mv='mv -v'
  245. alias vm='mv -v'
  246. alias cp='cp -v'
  247.  
  248. #alias ls='ls -G -F'
  249. #alias ls='ls -G -hF'
  250. alias ls='ls -G -hF'
  251. alias ll='ls -G -lhF'
  252. alias la='ls G -aF'
  253. alias sl='ls -G -F'
  254.  
  255. alias su='su -'
  256. alias hexchat='LANGUAGE=en_GB.UTF-8:pt_BR.UTF-8:es_ES.UTF-8 hexchat'
  257. alias vue="java -jar ~vagner/Downloads/Vue/vue.jar"
  258. alias killisa="killall ISA.exe"
  259. alias emacas='emacs'
  260. alias emacsdbug='emacs --debug -init'
  261. alias temp='tmp'
  262. alias python='python3'
  263. #alias pbcopy="xclip -sel clip"
  264. alias pbcopy='xsel --clipboard --input'
  265. alias pbpaste='xsel --clipboard --output'
  266. # alias find='find -iname'
  267.  
  268. #####################################################
  269.  
  270. # alias pylote='python ~vagner/Downloads/Pylote/pylote/pylote.pyw'
  271.  
  272. set -o vi
  273. set editing-mode vi
  274.  
  275. #####################################################
  276.  
  277. # PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/vagner/bin/"
  278.  
  279.     alias g="grep --color=always"
  280.     alias gi="grep -i --color=always"
  281.     alias x11vnc="x11vnc -noxdamage -clip -forever"
  282.  
  283.     alias xterm='xterm -fg white -bg black -bd blue -fs 24 -geom 800x600 -T "Visite - http://tecnicolinux.blogspot.com"'
  284.     alias init6='sudo init6'
  285.     alias halt='sudo halt'
  286.     alias reboot='sudo reboot'
  287.     alias edSrcList='sudo vim /etc/apt/sources.list'
  288.     alias abrir='sudo chmod 777 -R /usr/local/bin/; sudo chmod 777 -R /var/cache/apt/archives/'
  289.     alias axel='axel --num-connections=10'
  290.     alias psa='ps auxf'
  291.     alias psg='ps aux | grep'  # alguma coisa
  292.     alias date='echo -ne "${LIGHTBLUE}";date "+%A %B %d, %Y %l:%M %p %Z"'
  293.     alias cal='echo -e "${CYAN}"; cal""'
  294.     #alias hist='history | g $1' # alguma coisa
  295.     alias du='du -h'
  296.     alias df='df -h'
  297.     alias nano='nano -m -u'
  298.  
  299. #####################################################
  300.  
  301. complete -cf sudo
  302.  
  303. shopt -s cdspell
  304. shopt -s checkwinsize
  305. shopt -s cmdhist
  306. shopt -s dotglob
  307. shopt -s expand_aliases
  308. shopt -s extglob
  309. shopt -s histappend
  310. shopt -s hostcomplete
  311. shopt -s nocaseglob
  312.  
  313. #####################################################
  314.  
  315. # setando o editor padrão.
  316.  
  317. export EDITOR="vim"
  318. export VISUAL="vim"
  319.  
  320. set -o vi
  321. set editing-mode vi
  322. alias vi='vim'
  323.  
  324. # opções para o teclado, ótimas para os WMs mais leves.
  325. #setxkbmap -model abnt2 -layout br -variant abnt2
  326. #setxkbmap -option terminate:ctrl_alt_bksp
  327.  
  328. #####################################################
  329.  
  330. # extração de arquivos.
  331. # uso: ex arquivo.extensão ->"ex - extrair - arquivo.extensão"
  332. function ex ()
  333. {
  334.   if [ -f "$1" ] ; then
  335.     case "$1" in
  336.       *.tar)                tar xf $1        ;;
  337.       *.tar.bz2 | *.tbz2 )  tar xjvf $1        ;;
  338.       *.tar.gz | *.tgz )    tar xzvf $1     ;;
  339.       *.bz2)                bunzip2 $1       ;;
  340.       *.rar)                unrar x $1     ;;
  341.       *.gz)                 gunzip $1     ;;
  342.       *.zip)                unzip $1     ;;
  343.       *.Z)                  uncompress $1  ;;
  344.       *.7z)                 7z x $1    ;;
  345.       *.xz | *.txz)         tar xJvf $1 ;;
  346.       *)   echo ""${1}" não pode ser extraído()" ;;
  347.      esac
  348.    else
  349.      echo ""${1}" não é um arquivo válido!"
  350.    fi
  351. }
  352.  
  353. #####################################################
  354.  
  355. # ejetar CD.
  356. alias ejetar='sudo eject /dev/sr0'
  357.  
  358. # uso: png2jpeg95 imagem.png imagem.jpeg
  359. alias png2jpeg95='convert -quality 95'
  360.  
  361. # video como background no Desktop.
  362. alias videodesk='xwinwrap -ni -o 0.6 -fs -s -st -sp -b -nf -- mplayer -wid WID '
  363.  
  364. #####################################################
  365.  
  366. # Especificando o player a ser utilizado.
  367. PLAYER="/usr/bin/mplayer"
  368.  
  369. #####################################################
  370.  
  371. # Emacs aliases
  372.  
  373. alias emacsc="emacsclient -t"                      # used to be "emacs -nw"
  374. alias semacs="sudo emacsclient -t"                # used to be "sudo emacs -nw"
  375. alias emacsgnd="emacsclient -c -a emacs"           # new - opens the GUI with alternate non-daemon
  376.  
  377. #####################################################
  378.  
  379. # Mark aliases - http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
  380.  
  381. export MARKPATH=$HOME/.marks
  382. function jump {
  383.     cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
  384. }
  385. function mark {
  386.     mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
  387. }
  388. function unmark {
  389.     rm -i "$MARKPATH/$1"
  390. }
  391. function marks {
  392.     ls -l "$MARKPATH" | sed 's/  / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
  393. }
  394.  
  395. # Mark tab-completion
  396. # in debian it is "-printf"
  397.  
  398. _completemarks() {
  399.   local curw=${COMP_WORDS[COMP_CWORD]}
  400.   local wordlist=$(find $MARKPATH -type l --printf "%f\n")
  401.   COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
  402.   return 0
  403. }
  404.  
  405. complete -F _completemarks jump unmark
  406.  
  407. #####################################################
  408.  
  409. # How to use marks - e.g.
  410.  
  411. # mark deep - creates a mark
  412. # jump deep - jumps to the mark
  413. # unmark deep - unmarks the mark
  414. # marks - see all the marks
  415.  
  416. #####################################################
  417.  
  418. # configuration < https://unix.stackexchange.com/questions/42320/is-there-a-standard-unix-command-to-check-english-verb-conjugation >
  419. # source < http://conjugator.reverso.net/conjugation-english.html >
  420. # Função para conjugar verbos em Inglês
  421.  
  422. function verbtense () {
  423.     wget -qO - http://conjugator.reverso.net/conjugation-english-verb-$1.html | \
  424.     sed -n "/>Preterite\|>Past</{s@<[^>]*>@ @g;s/\s\+/ /g;/e I/s/.* I \([^ ]*\) you .*/Simple past: \1/;/ Past/s/ Past /Past participle: /;p}" ;
  425. }
  426.  
  427. #####################################################
  428.  
  429. # Setup for incremental search forward and backward - Ctrl-s and Ctrl-s
  430. [[ $- == *i* ]] && stty -ixon
  431.  
  432. #####################################################
  433.  
  434. ### Kodi-vlc
  435.  
  436. if [ -d "$HOME/kodi-vlc/kodi-playercorefactory/bash-scripts" ] ; then
  437.                PATH="$HOME/kodi-vlc/kodi-playercorefactory/bash-scripts:$PATH"
  438. fi
  439.  
  440. #####################################################
  441.  
  442. ## mplayer auto-completion complete -o bashdefault -o default mplayer
  443.  
  444. #####################################################
  445.  
  446. ## Julia lisp
  447.  
  448. alias julisp='rlwrap julia --lisp'
  449.  
  450. #####################################################
  451.  
  452. #-------- FreeTuxTV - Free IPTV Using Existing Database
  453. # See how to set it up - instructions are in ~vagner/Documents/Hacking/tuxtv_how-to.md
  454. # you have to add those functions in "/etc/bash.bashrc" for all users
  455.  
  456. ## MPD
  457. # export MPD_HOST=localhost
  458. # export MPD_PORT=6600
  459.  
  460. #####################################################
  461.  
  462. ## Luke Smith aliases
  463.  
  464. stty -ixon
  465. shopt -s autocd #Allows you to cd into directory merely by typing the directory name.
  466. # Setting Bash prompt. Capitalizes username and host if root user (my root user uses this same config file).
  467.  
  468. if [ "$EUID" -ne 0 ]
  469.  
  470. then export PS1="\[$(tput bold)\]\[$(tput setaf 1)\]-> \[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\t\n\w\[$(tput setaf 1)\]\[$(tput setaf 7)\] $ \[$(tput sgr0)\]"
  471.  
  472. else export PS1="\[$(tput bold)\]\[$(tput setaf 1)\]-> [\[$(tput setaf 3)\]ROOT\[$(tput setaf 2)\]@\[$(tput setaf 4)\]$(hostname | awk '{print toupper($0)}') \[$(tput setaf 5)\]\t\n\w\[$(tput setaf 1)\]\[$(tput setaf 7)\] # \[$(tput sgr0)\]"
  473.  
  474. fi
  475.  
  476. #Generic shortcuts:
  477. alias music="ncmpcpp"
  478. alias kam="sudo systemctl stop mpd ; sudo systemctl stop mpd.socket ; ka ncmpcpp"
  479. alias ral="sudo systemctl restart mpd ; sudo systemctl restart mpd.socket ; music"
  480. alias clock="ncmpcpp -s clock"
  481. alias visualizer="ncmpcpp -s visualizer"
  482. alias cmux="cmus"
  483. alias temp="tmp"
  484. alias news="newsbeuter"
  485. alias email="neomutt"
  486. alias files="ranger"
  487. alias chat="weechat"
  488. alias audio="ncpamixer"
  489. alias calender="calcurse"
  490.  
  491. # System Maintainence
  492. #alias atltime="sudo timedatectl set-timezone America/New_York && i3 restart" # Eastcoast time
  493. #alias tuctime="sudo timedatectl set-timezone America/Phoenix && i3 restart" # Arizona time
  494. alias sdn="sudo shutdown -h now"
  495. #alias newnet="sudo systemctl restart NetworkManager" # Refresh wifi
  496. alias nf="clear && neofetch" # Le Redditfetch
  497. #Install an AUR package manually (for Parabola to get AUR access):
  498.  
  499. # Some aliases
  500. alias svim="sudo vim"
  501. alias r="ranger"
  502. alias sranger="sudo ranger"
  503. alias ka="killall"
  504. #alias g="git"
  505. alias gitup="git push origin master"
  506. alias gitpass="git config --global credential.helper cache"
  507. alias tr="transmission-remote"
  508. alias mkd="mkdir -pv"
  509. alias refb="source ~/.bashrc"
  510. # alias ref="shortcuts.sh && source ~/.bashrc" # Refresh shortcuts manually and reload bashrc
  511. alias bars="bash ~/.config/polybar/launch.sh" # Run Polybar relaunch script
  512. #alias bw="wal -i ~/.config/wall.png" # Rerun pywal
  513. weather() { curl wttr.in/$1 ; } # Check the weather (give city or leave blank).
  514.  
  515. # Adding color
  516. #alias ls='ls -G -hF'
  517.  
  518. alias crep="grep --color=always" # Color grep - highlight desired sequence.
  519. alias ccat="highlight --out-format=xterm256" #Color cat - print file with syntax highlighting.
  520.  
  521. # Laptop management
  522. #alias lsc="screen.sh l" # Use laptop screen only
  523. #alias vsc="screen.sh v" # Use VGA only
  524. #alias dsc="screen.sh d" # Use both laptop and VGA screen
  525. #alias debase="sudo umount /home/Shared/Videos & screen.sh l && i3 restart" # Prep for taking my ThinkPad off Ultrabase
  526.  
  527. # Internet
  528. alias yt="youtube-dl --add-metadata -ic" # Download video link
  529. alias yta="youtube-dl --add-metadata -xic" # Download only audio
  530. alias yt-vw="youtube-viewer -C"
  531. alias g-yt-vw="gtk-youtube-viewer"
  532. alias yt-free="FreeTube"
  533.  
  534. #############################
  535.  
  536. # Vagner youtube-dl
  537.  
  538. alias ytnp="youtube-dl -c --no-playlist" #Download only the video inside a playlist
  539. alias ytCurl="youtube-dl --external-downloader-args curl -c --newline"
  540. alias ytWget="youtube-dl --external-downloader-args wget -c --newline"
  541. alias ytvF="youtube-dl -F" # view all formats from a video. Then download the one you want with "-f n(number) or -f type(e.g. 3gp, aac, flv, m4a, mp3, mp4, ogg, wav, webm)" - or (-f worstaudio, worstvideo) - see more details for "formats" on the manpage
  542. alias ytPfree="youtube-dl -c --prefer-free-formats" # Download free video format
  543. alias ytLsub="youtube-dl --list-subs" # list all language subtitles. Then use --sub-lang LANGS (separated by coma to download them). You can embed subtitles in the video with "--embed-subs"
  544. alias ytmp3="youtube-dl -cx mp3" # convert video to mp3
  545. alias ytmp3="youtube-dl -cx" # convert video to "best (default)" audio format
  546. alias ytaufmt='youtube-dl -c --audio-format mp3' # formats are: "best(default)", "aac", "flac", "mp3", "m4a", "opus", "vorbis", "wav". You can embed thumbnail in the audio as cover art "--embed-thumbnail"
  547. alias ytvidfmt="youtube-dl -c --recode-video ogg" #convert to ogg after downloading - options are "mp4,flv,ogg,webm,mkv,avi". If you want to keep the video, add (-k)
  548. alias ytTitle="youtube-dl -c --restrict-filename -o '%(title)s'" #Download video title, getting rid of its ID
  549.  
  550. #############################
  551.  
  552. alias ethspeed="speedometer -r eth0"
  553. alias wifispeed="speedometer -r wlan0"
  554. alias starwars="telnet towel.blinkenlights.nl"
  555. #alias tpbs="clear && figlet -c TPB Search && tpb.sh" # Pirate Bay search
  556.  
  557. # TeX
  558. #alias Txa="cp ~/Documents/LaTeX/article.tex"
  559. #alias Txs="cp ~/Documents/LaTeX/beamer.tex"
  560. #alias Txh="cp ~/Documents/LaTeX/handout.tex"
  561. #alias TC='texclear'
  562.  
  563. # Audio and Music
  564. alias mute="pamixer -m"
  565. alias unmute="pamixer -u"
  566. alias vu="pamixer --allow-boost -i 5"
  567. alias vd="pamixer --allow-boost -d 5"
  568. alias pause="mpc toggle"
  569. alias next="mpc next"
  570. alias prev="mpc prev"
  571. alias trupause="mpc pause"
  572. alias beg="mpc seek 0%"
  573. alias lilbak="mpc seek -10"
  574. alias lilfor="mpc seek +10"
  575. alias bigbak="mpc seek -120"
  576. alias bigfor="mpc seek +120"
  577.  
  578. #hello-larbs() { sed -i -e '/LARBS/,$d' ~/.config/i3/config ;}
  579.  
  580. # More good stuff
  581. alias sudo='sudo su'
  582. alias gitc='git clone'
  583. alias sucp='sudo cp -v'
  584. alias tmuxks='tmux kill-session' # it will kill the running session
  585. # if you want to kill other session, do: "tmux kill-session $sessionName"
  586. alias sdXmg='ncdu'
  587. alias bigstdirs='du -hs * | sort -rh | head -10'
  588.  
  589. # transmission torrent downloader
  590. # this is notes for video: http://www.youtube.com/watch?v=ee4XzWuapsE
  591.  
  592. #############################
  593.  
  594. #-------- Transmission CLI {{{
  595. #------------------------------------------------------
  596. # lightweight torrent daemon, has option for cli, webui, ncurses, and gui frontend
  597. # demo video: http://www.youtube.com/watch?v=ee4XzWuapsE
  598. # WebUI:    http://localhost:9091/transmission/web/
  599. #       http://192.168.1.xxx:9091/transmission/web/
  600. tsm-clearcompleted() {
  601.         transmission-remote -l | grep 100% | grep Done | \
  602.         awk '{print $1}' | xargs -n 1 -I % transmission-remote -t % -r ;}
  603. tsm() { transmission-remote --list ;}
  604.     # numbers of ip being blocked by the blocklist
  605.     # credit: smw from irc #transmission
  606. tsm-count() { echo "Blocklist rules:" $(curl -s --data \
  607.     '{"method": "session-get"}' localhost:9091/transmission/rpc -H \
  608.     "$(curl -s -D - localhost:9091/transmission/rpc | grep X-Transmission-Session-Id)" \
  609.     | cut -d: -f 11 | cut -d, -f1) ;}
  610. # demo video: http://www.youtube.com/watch?v=TyDX50_dC0M
  611. tsm-blocklist() { $PATH_SCRIPTS/blocklist.sh ;}     # update blocklist
  612. tsm-daemon() { transmission-daemon ;}
  613. tsm-quit() { killall transmission-daemon ;}
  614. tsm-altspeedenable() { transmission-remote --alt-speed ;}   # limit bandwidth
  615. tsm-altspeeddisable() { transmission-remote --no-alt-speed ;}   # dont limit bandwidth
  616. tsm-add() { transmission-remote --add "$1" ;}
  617. tsm-askmorepeers() { transmission-remote -t"$1" --reannounce ;}
  618. tsm-pause() { transmission-remote -t"$1" --stop ;}      # <id> or all
  619. tsm-start() { transmission-remote -t"$1" --start ;}     # <id> or all
  620. tsm-purge() { transmission-remote -t"$1" --remove-and-delete ;} # delete data also
  621. tsm-remove() { transmission-remote -t"$1" --remove ;}       # leaves data alone
  622. tsm-info() { transmission-remote -t"$1" --info ;}
  623. tsm-speed() { while true;do clear; transmission-remote -t"$1" -i | grep Speed;sleep 1;done ;}
  624.  
  625. # https://github.com/fagga/transmission-remote-cli
  626. # demo video: http://www.youtube.com/watch?v=hLz7ditUwY8
  627. tsm-ncurse() { transmission-remote-cli ;}
  628.  
  629. #}}}
  630.  
  631. #####################################################
  632.  
  633. ## pkg aliases
  634.  
  635. #alias clean='sudo pkg clean'
  636. alias audit='pkg audit -F' # searches for packages vulnerabilities
  637. alias cleanall='pkg clean -a'
  638. alias install='sudo pkg  install'
  639. alias uninstall='pkg delete'
  640. alias autoremove='pkg autoremove'
  641. alias update='sudo pkg update'
  642. alias upgrade='sudo pkg upgrade' # upgrades all packages
  643. alias search='sudo pkg search'
  644. alias info='pkg info'
  645.  
  646. #####################################################
  647.  
  648. # source /etc/bash_completion.d/climate_completion
  649.  
  650. [ -f ~/.fzf.bash ] && source ~/.fzf.bash
  651. alias gg='https://google.com'
  652.  
  653. ## Thefuck command for fixing command typos
  654. ## pip3 install thefuck
  655.  
  656. eval
  657.             function fixit () {
  658.                 TF_PYTHONIOENCODING=$PYTHONIOENCODING;
  659.                 export TF_ALIAS=fixit;
  660.                 export TF_SHELL_ALIASES=$(alias);
  661.                 export TF_HISTORY=$(fc -ln -10);
  662.                 export PYTHONIOENCODING=utf-8;
  663.                 TF_CMD=$(
  664.                     thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
  665.                 ) && eval $TF_CMD;
  666.                 unset TF_HISTORY;
  667.                 export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
  668.                 history -s $TF_CMD;
  669.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top