431 reputation
39
bio website datageek.info
location China
age 27
visits member for 3 years, 6 months
seen Nov 27 at 13:45

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 big file
$ rsync -hP 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=noreply@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

May
16
awarded  Notable Question
Oct
28
awarded  Yearling
Jul
23
awarded  Nice Question
May
27
awarded  Popular Question
Jun
2
awarded  Yearling
Mar
23
revised Script to count files matching a pattern in subdirectories
deleted 34 characters in body
Feb
29
answered Linux script or program to shorten filenames
Feb
25
answered Exporting environment variable
Feb
25
comment Exporting environment variable
Change double quote to single quote, then try: eval $hello
Feb
14
answered what is the benefit of --squeeze-repeats in tr command
Feb
14
answered Search and replace next n words in vi
Dec
27
revised how to focus different `regions`(Ctrl-a S) via mouse-click in `screen`?
added 211 characters in body; edited title
Dec
27
comment how to focus different `regions`(Ctrl-a S) via mouse-click in `screen`?
@nicerobot I don't have a .screenrc.
Dec
27
comment Delete everything except a few extensions
mv all *.bmp, *.wav, *.png to newdir. Then rm -rf dir.
Dec
27
comment how to focus different `regions`(Ctrl-a S) via mouse-click in `screen`?
@phunehehe mouse works fine when :set mouse=a outside of screen
Dec
27
asked how to focus different `regions`(Ctrl-a S) via mouse-click in `screen`?
Dec
26
awarded  Supporter
Dec
26
accepted How to do block selection in `screen`
Dec
25
asked How to do block selection in `screen`
Dec
22
comment Script to count files matching a pattern in subdirectories
@user13522. Just another special case: -name '*?.pdf'