kev's user avatar
kev's user avatar
kev's user avatar
  • Member for 6 years, 7 months
  • Last seen more than a month ago

Simplicity is the ultimate sophistication. — Leonardo Da Vinci

less is more

  • The basic problem is actually very complicated.
  • It's amazing that computers only use 0s and 1s.

handy tools

# download bigfile
$ aria2c -c -k1M -{x,j,s}16 --checksum=md5=dccff28314d9ae4ed262cfc6f35e5153

# backup txt files
$ rsync -avzm --include '*/' --include '*.txt' --exclude '*' source/ remote:target/

# transfer file at 100kB/s
$ rsync -hP --bwlimit 100 remote:file .

# convert json to csv
$ jq -r '[.field1,.field2,.field3]|@csv' input.json > output.csv

# http proxy
$ ncat -v -l --proxy-type http 3128

# convert socks5 to http
$ delegate -P8080 SERVER=http SOCKS= [email protected]

# convert socks5 to http with auth
$ delegated -f -P8080 SERVER=http FORWARD=socks://user:[email protected]:1080 [email protected]

# zero-padding file names
$ rename 's/^\d+/sprintf("%02d", $&)/e' [0-9]*

# concat video parts
$ printf "file '%s'\n" part*.mp4 | ffmpeg -f concat -i - -c copy all.mp4

# scan raspberry pi
$ sudo nmap -n -sP -oX - | xmlstarlet sel -t -m '//host[address[contains(@vendor, "Raspberry Pi")]]/address[@addrtype="ipv4"]/@addr' -v . -n | ssh-keyscan -t rsa -f - | sort -u - ~/.ssh/known_hosts -o ~/.ssh/known_hosts

# upgrade all outdated python packages
$ pip list --outdated | awk '{print $1}' | xargs -tn1 pip install

# generate birthdays wordlist for aircrack-ng
$ dateseq -f '%Y%m%d' 1970-01-01 > birthdays.txt

# install python on raspberry pi
$ ansible pi --limit pi2 -e ansible_user=alarm --ask-pass --su --ask-su-pass -m raw -a 'pacman -Sy --noconfirm python2'

# resize sdcard for raspberry pi
$ echo -e 'p\nd\n2\nn\np\n2\n\n\np\nw' | fdisk /dev/mmcblk0
$ reboot
$ resize2fs /dev/mmcblk0p2

# authorized key initialization
$ sshpass -p xxxxxx ssh-copy-id -o StrictHostKeyChecking=no user@server

# open google chrome in full-screen mode
$ open -a 'Google Chrome' --args --kiosk

# customized hostname
$ curl --resolve 'httpbin:80:' http://httpbin/headers

# add ssh pubkey to multiple servers
$ ansible rpi -m authorized_key -a 'user=pi key="ssh-rsa ..."'

# brute force attack openwrt
$ hydra -f -l root -P password.list http-form-post '/cgi-bin/luci:luci_username=^USER^&luci_password=^PASS^:S=302 Found'

# dump obs-studio events
$ websocat -t -u autoreconnect:ws:// reuse:appendfile:obs.jl

# ..
$ ncat -vlk 8080 -c 'ncat -v --proxy-type socks5 --proxy 80'
$ curl -H
This user doesn’t have any gold badges yet.
This user doesn’t have any silver badges yet.
bronze badge

This user hasn’t posted yet.