Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
7,324
reputation
6
42
60

kev

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 http://mirrors.zju.edu.cn/ubuntu-releases/14.04/ubuntu-14.04-desktop-amd64.iso

# 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

# convert socks5 to http
$ delegate -P8080 SERVER=http SOCKS=1.2.3.4:1080 ADMIN=admin@datageek.info

# convert socks5 to http with auth
$ delegated -f -P8080 SERVER=http FORWARD=socks://user:pass@1.2.3.4:1080 ADMIN=admin@datageek.info

# 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 192.168.1.0/24 -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 birthday wordlist for aircrack-ng
$ dateseq -f '%Y%m%d' 1970-01-01 2019-01-01 > birthday.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 https://github.com/

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

# add ssh pubkey to multiple servers
$ ansible rpi -m authorized_key -a 'user=pi key="ssh-rsa ..."'
61
answers
41
questions
~783k
people reached

Top Tags (105)

Score 346
Posts 35
Posts % 34
Score 202
Posts 8
Score 85
Posts 23
Score 58
Posts 8
Score 36
Posts 14
Score 4
Posts 4

Top Posts (102) All Questions Answers | Votes Newest

View all questions and answers

Badges (108)

Gold

6

Rarest

Silver

42

Rarest

Bronze

60

Rarest