Random Tech Thoughts

The title above is not random

Misc Util

7zip

分卷压缩,用 -v 选项,可以以 k, m 等单位指定大小:

7z a -v5m file.zip file

objdump

反汇编二进制数据文件 (文件格式不是 ELF,直接是二进制文件),针对 64bit 的系统:

objdump -m i386:x86-64 -b binary -D <file>

sort

-k 选项指定按照哪一列来排序。 例如

sort -t, -k1,1 -k3,3n

表示列分隔符为逗号,按照第一列和第三列排序,第三列用数字排序。 注意 option 的顺序。

ffmpeg

I recommend use HandBrake to do video converting now.

Convert video for iPhone 4 using ffmpeg:

 ffmpeg.exe -acodec aac -ac 2 -ab 96k -s 640x480 -vcodec libx264 \
 -vpre fast -vpre iPod640 -b 768k -strict experimental -f mp4 -threads 2 \
 -i <input> <output>

We can use -fpre to specify the absolute path of the preset file.

Change container format (e.g. convert mov/avi to mp4 quickly)

From SuperUser.

Background: Video files contains audio and video streams, some container format mixes these streams together. mov/avi/mp4/mts are just container format. Changing container does not need to reencode the stream, so it’s very fast.

ffmpeg can easily change container format, use command like this:

ffmpeg -i input.mov -c copy out.mp4

Change audio in mp4 file to AAC encoding

From iMovie and MTS | CommitBlog. This will only reencode the audio while leave video unchanged:

ffmpeg-i input.MTS -vcodec copy -acodec libfaac -ar48000-ac2-ab 320k out.mp4

nm on shared library to get symbol

Use nm -D /usr/libc.so.6

sqlite

Turn header and column mode for better select result:

sqlite3 -header -column db