Volkova

Untitled

Jul 13th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. PS1='\[\033[1;31m\]\W/\[\033[0m\] '
  2.  
  3. ##### DEFAULTS #####
  4.  
  5. # If not running interactively, don't do anything
  6. [ -z "$PS1" ] && return
  7.  
  8. PROMPT_COLOR='35;1m'
  9.  
  10. export HISTCONTROL=ignoreboth
  11. export EDITOR="nano"
  12. export VISUAL="nano"
  13.  
  14. shopt -s histappend
  15. shopt -s checkwinsize
  16.  
  17. # Make less more friendly for non-text input files, see lesspipe(1)
  18. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  19.  
  20. # Set variable identifying the chroot you work in (used in the prompt below)
  21. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  22. debian_chroot=$(cat /etc/debian_chroot)
  23. fi
  24.  
  25. # Color prompt
  26. force_color_prompt=yes
  27.  
  28. # If this is an xterm set the title to user@host:dir
  29. case "$TERM" in
  30. xterm*|rxvt*)
  31. PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  32. ;;
  33. *)
  34. ;;
  35. esac
  36.  
  37. # enable programmable completion features (you don't need to enable
  38. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  39. # sources /etc/bash.bashrc).
  40. if [ -f /etc/bash_completion ]; then
  41. . /etc/bash_completion
  42. fi
  43.  
  44.  
  45.  
  46. ##### CUSTOM STARTS HERE #####
  47.  
  48. ### FUNCTIONS
  49.  
  50. # Easy extract
  51. extract () {
  52. if [ -f $1 ] ; then
  53. case $1 in
  54. *.tar.bz2) tar xvjf $1 ;;
  55. *.tar.gz) tar xvzf $1 ;;
  56. *.bz2) bunzip2 $1 ;;
  57. *.rar) rar x $1 ;;
  58. *.gz) gunzip $1 ;;
  59. *.tar) tar xvf $1 ;;
  60. *.tbz2) tar xvjf $1 ;;
  61. *.tgz) tar xvzf $1 ;;
  62. *.zip) unzip $1 ;;
  63. *.Z) uncompress $1 ;;
  64. *.7z) 7z x $1 ;;
  65. *) echo "don't know how to extract '$1'..." ;;
  66. esac
  67. else
  68. echo "'$1' is not a valid file!"
  69. fi
  70. }
  71.  
  72. # Makes directory then moves into it
  73. function mkcdr {
  74. mkdir -p -v $1
  75. cd $1
  76. }
  77.  
  78. # Creates an archive from given directory
  79. mktar() { tar cvf "${1%%/}.tar" "${1%%/}/"; }
  80. mktgz() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
  81. mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }
  82.  
  83. ### ALIASES
  84.  
  85. ## Keeping things organized
  86. alias ls='ls --color=auto'
  87. alias ll='ls -l'
  88. alias la='ls -A'
  89. alias rm='mv -t ~/.local/share/Trash/files'
  90. alias cp='cp -i'
  91. alias mv='mv -i'
  92. alias mkdir='mkdir -p -v'
  93. alias df='df -h'
  94. alias du='du -h -c'
  95. alias reload='source ~/.bashrc'
  96. alias biggest='BLOCKSIZE=1048576; du -x | sort -nr | head -10'
  97.  
  98. ## Moving around & all that jazz
  99. alias back='cd $OLDPWD'
  100. alias ..="cd .."
  101. alias ...="cd ../.."
  102. alias ....="cd ../../.."
  103. alias .....="cd ../../../.."
  104. alias ......="cd ../../../../.."
  105.  
  106. ## Dir shortcuts
  107. alias home='cd ~/'
  108. alias documents='cd ~/Documents'
  109. alias downloads='cd ~/Downloads'
  110. alias books='cd ~/eBooks'
  111. alias images='cd ~/Images'
  112. alias packages='cd ~/Packages'
  113. alias aruby='cd ~/Ruby'
  114. alias torrents='cd ~/Torrents'
  115. alias videos='cd ~/Videos'
  116. alias webdesign='cd ~/Web\ Design'
  117. alias localhost='cd /var/www'
  118.  
  119. ## App-specific
  120. alias nano='nano -W -m'
  121. alias music='ncmpcpp'
  122. alias ftp='ncftp Personal'
  123. alias wget='wget -c'
  124. alias scrot='scrot -c -d 7'
  125.  
  126. ## Easy script callin'
  127. alias show-info='~/.bin/info.pl'
  128. alias show-colors='~/.bin/colors.sh'
  129.  
  130. ## Sudo fixes
  131. alias install='sudo apt-get install'
  132. alias remove='sudo apt-get remove'
  133. alias orphand='sudo deborphan | xargs sudo apt-get -y remove --purge'
  134. alias cleanup='sudo apt-get autoclean && sudo apt-get autoremove && sudo apt-get clean && sudo apt-get remove && orphand'
  135. alias updatedb='sudo updatedb'
  136.  
  137. ## Dev related
  138. alias restart-apache='sudo /etc/init.d/apache2 restart'
  139.  
  140. ## Misc
  141. alias edit='nano'
Advertisement
Add Comment
Please, Sign In to add comment