Guest User

Untitled

a guest
Oct 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. # alias
  2. alias ll='ls -la --color=auto'
  3. alias s='ssh'
  4. alias grep='grep --color=auto'
  5.  
  6. # ps1
  7. function timer_start {
  8. timer=${timer:-$SECONDS}
  9. }
  10.  
  11. function timer_stop {
  12. timer_show=$(($SECONDS - $timer))
  13. unset timer
  14. }
  15.  
  16. trap 'timer_start' DEBUG
  17.  
  18. if [ "$PROMPT_COMMAND" == "" ]; then
  19. PROMPT_COMMAND="timer_stop"
  20. else
  21. PROMPT_COMMAND="$PROMPT_COMMAND; timer_stop"
  22. fi
  23.  
  24. # setup term colors
  25. t_black=$(tput setaf 0)
  26. t_red=$(tput setaf 1)
  27. t_green=$(tput setaf 2)
  28. t_yellow=$(tput setaf 3)
  29. t_blue=$(tput setaf 33)
  30. t_pink=$(tput setaf 5)
  31. t_aqua=$(tput setaf 6)
  32. t_white=$(tput setaf 7)
  33. t_grey=$(tput setaf 8)
  34. t_normal=$(tput sgr0)
  35.  
  36. # when tmux colors is 257+
  37. PS1='\[${t_yellow}\]\u\[${t_grey}\]@\[$(tput setaf 202)\]\h \[$(tput sgr0)\]\[${t_green}\]${timer_show}s \[$(tput bold)\]\[${t_blue}\]\w\[${t_aqua}\] $ \[${t_normal}\]'
  38. # for when `tmux colors` is 8
  39. #PS1='\[${t_yellow}\]\u\[${t_blue}\]@\[${t_aqua}\]\h \[${t_normal}\]\[${t_green}\]${timer_show}s \[$(tput bold)\]\[${t_blue}\]\w\[${t_aqua}\] $ \[${t_normal}\]'
  40.  
  41. # fixing ubuntu on windows not putting correct dns suffix in resolv.conf
  42. if [ -f conf/resolv.conf ]; then
  43. sudo cat conf/resolv.conf | sudo tee -a /etc/resolv.conf
  44. fi
  45.  
  46. # History change(s) (Steve M.'s sauce):
  47. export HISTTIMEFORMAT="%h %d %H:%M:%S "
  48. export HISTCONTROL=ignoredups:erasedups
  49. shopt -s histappend
  50. export HISTSIZE=500000
  51. export HISTFILESIZE=999999
  52.  
  53. # adding to $PATH for jupyter notebook stuff
  54. export PATH=$PATH:~/.local/bin/
Add Comment
Please, Sign In to add comment