daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Oct 23rd, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alias statc="stat -c '%a %G:%U %n'"
  2. alias ccat="pygmentize -g"
  3. alias tlog="tail -f -n 0 storage/logs/laravel.log"
  4. alias phpcf="php --ini | grep 'Loaded'"
  5. eval $(thefuck --alias)
  6.  
  7.  
  8. # custom functions
  9. # IP Lookup
  10. function rip
  11. {
  12.     getent hosts $1 | awk '{ print $1 }'
  13. }
  14.  
  15. # Traverse Directories
  16. function up
  17. {
  18.     LIMIT=$1
  19.     P=$PWD
  20.     for ((i=1; i <= LIMIT; i++))
  21.     do
  22.         P=$P/..
  23.     done
  24.     cd $P
  25.     export MPWD=$P
  26. }
  27.  
  28. function back
  29. {
  30.     LIMIT=$1
  31.     P=$MPWD
  32.     for ((i=1; i <= LIMIT; i++))
  33.     do
  34.         P=${P%/..}
  35.     done
  36.     cd $P
  37.     export MPWD=$P
  38. }
  39.  
  40. # Recursively search archives
  41. function uzsearch
  42. {
  43.     for i in *.zip; do grep -iq "$1" < <( unzip -l $i ) && echo $i; done
  44. }
  45.  
  46. function parse_git_branch
  47. {
  48.      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
  49. }
  50.  
  51. function vm
  52. {
  53.     ( cd ~/boxes/$1 && vagrant $2 )
  54. }
  55.  
  56. # Override prompt
  57. PS1='\[\033]0;${PWD//[^[:ascii:]]/?}\007\]'                                           # set window title
  58. PS1=$PS1'\[\033[01;32m\]\[\033[01m\033[01;32m\]\u\[\033[01;00m\]@\[\033[01;32m\]\h '  # user @ host
  59. PS1=$PS1'\[\033[01;00m\]\W'                                                           # current working directory
  60. PS1=$PS1'\[\033[01;33m\]$(parse_git_branch)'                                          # git branch
  61. PS1=$PS1'\n\[\033[01;32m\]└─\[\033[01m\033[0;00m\] \$\[\033[00m\] '                   # newline prompt
  62. MSYS2_PS1="$PS1"                                                                      # for detection by MSYS2 SDK's bash.basrc
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