sliq19882

Untitled

Jan 4th, 2024 (edited)
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | Source Code | 0 0
  1. w ~/.bashrc
  2. (...)
  3. source ~/.bash_alias
  4. alias| awk 'BEGIN {FS=" |=";C=0;printf "Goodies so far: "} {C++ % 5 ? LOL=" " : LOL="\n" ; printf $2 LOL} END {printf "\n"}'
  5.  
  6. treść ~/.bash_alias (wybrane fragmenty)
  7.  
  8. purlenc() { #urlencode_xD
  9. perl -MURI::Escape -e 'print uri_escape(chop <STDIN>);'
  10. }
  11.  
  12. alias nowdate='date +%Y%m%d' #today in YYYMMDD
  13. alias nowtime='date +%H%M%S' #now in HHMMSS+
  14.  
  15. ## git shit
  16.  
  17. alias gs='git status' #shorthand for git status
  18. alias gl='git log' #shorthand for git log
  19. alias ga='git add' #shorthand for git add
  20. alias gc='git commit -m' #shorthand for git commit -m (expects comment)
  21.  
  22. alias via='vi ~/.bash_alias;. ~/.bash_alias' #edits aliases
  23. alias vi3='vi ~/.config/i3/config' #edits i3config
  24.  
  25. alias togif='__togif' #giphyfies file
  26. __togif() { ffmpeg -i $@ -movflags faststart -pix_fmt yuv420p [email protected] ;}
  27.  
  28. alias region_delay='xfce4-screenshooter -r -d 3 -m' #captures screenshot of selected region after 3 secs delay
  29. alias qr='__qr' #generates QRcode from arbitrary string and displays it
  30. __qr() { data="$1"; qrencode -s12 -o /tmp/qr.png "$data"; display /tmp/qr.png ;}
  31.  
  32. alias space2line='echo reading,^D 2 end;stty -echo;while read p;do echo -ne $p\ ;done;echo;stty echo' #clumsy thingie to space separate newline separated input, end with ^D
  33.  
  34. alias ts2date="awk 'BEGIN { print strftime(\"%c\",ARGV[1]);}'" #changes UNIX timestamp to date
  35.  
  36. alias sshpassword='_shp'; #force ssh with password authentication, despite having exchanged pubkey
  37. _shp() {
  38. ssh -o PreferredAuthentications=password $@
  39. }
  40. alias sshkeyonly='_shk'; #force ssh with password authentication, despite having exchanged pubkey
  41. _shk() {
  42. ssh -o PreferredAuthentications=publickey $@
  43. }
  44. __unfuck() {
  45. echo "link?"
  46. read p
  47. curl -v "$p" 2>&1|grep Location |rev|cut -d' ' -f1 |rev
  48. }
  49. alias unfuck='__unfuck' #unfucks 301 links
  50. alias goodies="__usage" #goodies so far
  51. __usage () { awk 'BEGIN {FS="[ =]";print "Goodies so far:"} /^alias/ {COMMENT=substr($0,match($0,"#[a-zA-Z] ?.*$")+1);printf"\033[1;31m%-20s\033[0m%s\n",$2,COMMENT }' ~/.bash_alias ;}
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment