Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.34 KB | None | 0 0
  1. ####    masterizzare iso to usb
  2. dd if=/percorso/a/archlinux.iso of=/dev/sd[x] bs=4M
  3. dd if=immagine.iso of=/dev/sdb conv=sync,noerror,notrunc bs=1024 && sync # da provare.
  4. ####    convert nrg.to iso
  5. dd bs=1k if=image.nrg of=image.iso skip=300
  6.  
  7. ####    riscrive mbr     
  8. dd count=1 bs=512 if=/dev/zero of=/dev/sdX
  9.  
  10. ### speed up launch firefox
  11. find ~ -name '*.sqlite' -exec sqlite3 '{}' 'VACUUM;' \;
  12.  
  13. ### octal output for file
  14. stat -c %a
  15.  
  16. ### for list with descriptions for packages:
  17. expac -HM "%-20n\t%10d" $( comm -23 <(pacman -Qqt|sort) <(pacman -Qqg base base-devel|sort) )
  18.  
  19. ### List all installed packages that are not in specified repository
  20. ###  (repo_name in example):
  21. comm -23 <(pacman -Qtq | sort) <(pacman -Slq repo_name | sort)
  22.  
  23. #### List all package locale (yaourt)
  24. pacman -Qem
  25.  
  26. ### rimuove il primo carattere da ogni riga (#)
  27. sed '/^#\S/ s|#||' -i file
  28.  
  29. ####  tree
  30. ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'
  31.  
  32. #### pyt 'canzone
  33. pyt() { id=$(curl -s 'https://www.youtube.com/results?search_query='$(tr \  + <<<"$1") | grep -om3 '"[[:alnum:]]\{11\}"' | awk NR==3 | tr -d \"); youtube-dl -q 'https://www.youtube.com/watch?v='"$id" -o - | mplayer -vo null /dev/fd/3 3<&0 </dev/tty; }
  34.  
  35. #list all ext in dir
  36. find . -type f | awk -F'.' '{print $NF}' | sort| uniq -c | sort -g
  37. ls | grep -Eo "\..+" | sort -u
  38.  
  39. ps -A --sort -rss -o comm,rss | grep chromium | awk '{ sum+=$2 } END { print sum/1024 }'
  40.  
  41. #Join lines and separate with spaces
  42. tr -d '\r' < vmargs.txt | tr '\n' ' '
  43. #dump wireless config
  44. iw dev wlp0s26u1u6 station dump
  45.  
  46. #sequenza binaria
  47. printf "%x\n" $(seq 0 255) | xargs -n1 -IH echo -ne \\xH > test.dat
  48.  
  49. youtube-dl --list-formats <URL>; youtube-dl -f <STREAM_ID> -g <URL>
  50.  
  51. #find latest .log
  52. find . -name '*.log' | xargs ls -hlt > /tmp/logs.txt && vi /tmp/logs.txt
  53.  
  54. # Convert CVS to JSON (python and bash function)
  55. csv2json() { for file in $@; do python -c "import csv,json,fileinput; print(json.dumps(list(csv.reader(fileinput.input()))))" "$file" 1> "${file%%csv}json"; done; }
  56.  
  57. #get a qrcode
  58. echo "http://commandlinefu.com" | curl -F-=\<- qrenco.de
  59.  
  60. # List process in unkillable state D (iowait)
  61. ps aux | awk '{if ($8 ~ "D") print $0}'
  62.  
  63. # file count in directory
  64. find / -type d | while read i; do ls $i | wc -l | tr -d \\n; echo " -> $i"; done | sort -n
  65.  
  66. # convert video to gif by ffmpeg and imagemagick
  67. ffmpeg -i input.flv -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif
  68.  
  69. # generate binary sequence
  70. printf "%x\n" $(seq 0 255) | xargs -n1 -IH echo -ne \\xH > test.dat
  71.  
  72. # remove all packages except for the latest three package versions
  73. paccache -rvk3
  74.  
  75. #NOTE: Custom flags should be put directly in: ~/.config/chrome-flags.conf
  76. #NOTE: The launcher is called: 'google-chrome-stable'
  77. # check google-chrome version
  78. curl -s https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz | gzip -df | awk -F\" '/pkgid/{ sub(".*-","",$4); print $4": "$10 }'
  79.  
  80. #show numerical value for each of the 256 colors in bash
  81. for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done
  82.  
  83. #print a specific line from a file
  84. sed -n 5p <file>
  85. # rinnovo mirrorlist
  86. reflector --verbose -c Germany -c France -c Italy -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist
  87.  
  88. # ffmpeg facebook
  89. ffmpeg -re -y -i mm.mp4 -b:a 128k -vcodec libx264 -pix_fmt yuv420p -vf scale=640:480 -r 30 -g 60 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/xxxxxxxxxx"
  90.  
  91. ffmpeg -re -i "index.m3u8" -acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 426x240 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmp://rtmp-api.facebook.com"
  92.  
  93. #Visual system load display
  94. while [ true ]; do cat /proc/loadavg | perl -ne 'm/(^[^ ]+)/; $L = $1; print "*" x $L; print " $L\n";' ; sleep 6; done
  95.  
  96. #convert second to data
  97.  
  98. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }
  99.  
  100. Show your current network interface in use
  101. route | grep -m1 ^default | awk '{print $NF}'
  102.  
  103. command shell generate random strong password
  104. len=20; tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${len} | xargs
  105.  
  106. 32 bits or 64 bits?
  107. getconf LONG_BIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement