Guest User

Untitled

a guest
Mar 25th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. # .bashrc
  2.  
  3. # User specific aliases and functions
  4. alias k='kubectl'
  5. alias rm='rm -i'
  6. alias cp='cp -i'
  7. alias mv='mv -i'
  8. alias hgrep='history|grep'
  9. # Source global definitions
  10. if [ -f /etc/bashrc ]; then
  11. . /etc/bashrc
  12. fi
  13. # Use vi editing on the command line by pressing ESC
  14. #set -o vi on
  15. if [ -x /usr/bin/kubectl -o -x /usr/local/bin/kubectl ]
  16. then
  17. source <(kubectl completion bash)
  18. fi
  19. function backup() {
  20. if [ -n "$1" ]
  21. then
  22. source=$1
  23. else
  24. echo 'Provide a path to a file or directory to backup'
  25. echo 'Usage: backup /path/to/file'
  26. echo 'Result is file path extended with date/time stamp'
  27. exit 1
  28. fi
  29.  
  30. stamp=$( date +%Y%m%d-%H%M%S )
  31. if [ -d "$source" ]
  32. then
  33. cp -a $source $source.$stamp
  34. else
  35. cp $source $source.$stamp
  36. fi
  37. }
  38. function mkcd() {
  39. mkdir -p $1 && cd $1
  40. }
  41. df() {
  42. /usr/bin/df -h $* | grep -vE "docker|tmpfs"
  43. }
  44. function lfget() {
  45. pw=$(cat $HOME/.LFTpw)
  46. wget --user=LFtraining --password=$pw $1
  47. }
Add Comment
Please, Sign In to add comment