Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### masterizzare iso to usb
- dd if=/percorso/a/archlinux.iso of=/dev/sd[x] bs=4M
- dd if=immagine.iso of=/dev/sdb conv=sync,noerror,notrunc bs=1024 && sync # da provare.
- #### convert nrg.to iso
- dd bs=1k if=image.nrg of=image.iso skip=300
- #### riscrive mbr
- dd count=1 bs=512 if=/dev/zero of=/dev/sdX
- ### speed up launch firefox
- find ~ -name '*.sqlite' -exec sqlite3 '{}' 'VACUUM;' \;
- ### octal output for file
- stat -c %a
- ### for list with descriptions for packages:
- expac -HM "%-20n\t%10d" $( comm -23 <(pacman -Qqt|sort) <(pacman -Qqg base base-devel|sort) )
- ### List all installed packages that are not in specified repository
- ### (repo_name in example):
- comm -23 <(pacman -Qtq | sort) <(pacman -Slq repo_name | sort)
- #### List all package locale (yaourt)
- pacman -Qem
- ### rimuove il primo carattere da ogni riga (#)
- sed '/^#\S/ s|#||' -i file
- #### tree
- ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
- #### pyt 'canzone
- 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; }
- #list all ext in dir
- find . -type f | awk -F'.' '{print $NF}' | sort| uniq -c | sort -g
- ls | grep -Eo "\..+" | sort -u
- ps -A --sort -rss -o comm,rss | grep chromium | awk '{ sum+=$2 } END { print sum/1024 }'
- #Join lines and separate with spaces
- tr -d '\r' < vmargs.txt | tr '\n' ' '
- #dump wireless config
- iw dev wlp0s26u1u6 station dump
- #sequenza binaria
- printf "%x\n" $(seq 0 255) | xargs -n1 -IH echo -ne \\xH > test.dat
- youtube-dl --list-formats <URL>; youtube-dl -f <STREAM_ID> -g <URL>
- #find latest .log
- find . -name '*.log' | xargs ls -hlt > /tmp/logs.txt && vi /tmp/logs.txt
- # Convert CVS to JSON (python and bash function)
- 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; }
- #get a qrcode
- echo "http://commandlinefu.com" | curl -F-=\<- qrenco.de
- # List process in unkillable state D (iowait)
- ps aux | awk '{if ($8 ~ "D") print $0}'
- # file count in directory
- find / -type d | while read i; do ls $i | wc -l | tr -d \\n; echo " -> $i"; done | sort -n
- # convert video to gif by ffmpeg and imagemagick
- ffmpeg -i input.flv -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif
- # generate binary sequence
- printf "%x\n" $(seq 0 255) | xargs -n1 -IH echo -ne \\xH > test.dat
- # remove all packages except for the latest three package versions
- paccache -rvk3
- #NOTE: Custom flags should be put directly in: ~/.config/chrome-flags.conf
- #NOTE: The launcher is called: 'google-chrome-stable'
- # check google-chrome version
- 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 }'
- #show numerical value for each of the 256 colors in bash
- for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done
- #print a specific line from a file
- sed -n 5p <file>
- # rinnovo mirrorlist
- reflector --verbose -c Germany -c France -c Italy -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist
- # ffmpeg facebook
- 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"
- 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"
- #Visual system load display
- while [ true ]; do cat /proc/loadavg | perl -ne 'm/(^[^ ]+)/; $L = $1; print "*" x $L; print " $L\n";' ; sleep 6; done
- #convert second to data
- 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" }
- Show your current network interface in use
- route | grep -m1 ^default | awk '{print $NF}'
- command shell generate random strong password
- len=20; tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${len} | xargs
- 32 bits or 64 bits?
- getconf LONG_BIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement