Simple image duplicates finder. Uses imagemagick or graphicsmagicks.
Example run using the images.
./imgdupes.sh -gm images/
Found 12 images.
Creating thumbs...
Thumbs created.
66 pairs to check.
Comparing...
Images probably the same: images/spaced name.jpg images/tumblr_kp2mi6ajzg1qzv5pwo1_500.jpg
Images probably the same: images/spaced dir/tumblr_m3plvr2gtgg1qjahcpo1_250.jpg images/spaced dir/tumblr_m3plvr2DHR1qjahcpo1_250.jpg
Images probably the same: images/spaced dir/tumblr_m3plvr2gtgg1qjahcpo1_250.jpg images/tumblr_m3plvr2DHR1qjahcpo1_250.jpg
Images probably the same: images/spaced dir/tumblr_m3plvr2DHR1qjahcpo1_250.jpg images/tumblr_m3plvr2DHR1qjahcpo1_250.jpg
Images probably the same: images/tumblr_m311112xhc1qath333_1280.jpg images/dir/tumblr_m3pua02xhc1qathi4o1_1280.jpg
mp3gain adjusts mp3 files volume so they should have the same volume level. Does it losslessly, so the process is reversible. -r - apply Track gain automatically; -k - automatically lower Track gain to not clip audio
find -name "*.mp3" -exec mp3gain -r -k {} \;
Parallel version, -P N means N threads
find -name "*.mp3" -print0 | xargs -0 -P 4 -n 1 mp3gain -r -k
pv - pipe viewer
dd if=/dev/zero bs=1M | pv | dd of=some_file bs=1M
-T - disables pseudo-tty allocation, -N disables iteractive prompt, -D specifies local port
ssh -TND 8940 user@remote_server
Chromium
chromium --proxy-server="socks5://localhost:8940" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost"
or something to add to .bash.rc
function secure_chromium {
port=8940
export SOCKS_SERVER=localhost:$port
export SOCKS_VERSION=5
chromium &
exit
}
This method extracts aac (audio) from youtube video (at least fairly new videos' audio is encoded in aac), then packs again to .m4a format. It is lossless (no further recompression after downloading video from youtube). In this example aac is put in #2 Track. To check what this video is made of, you may want to use mediainfo video.mp4
MP4Box -raw 2 video.mp4
MP4Box -add video_track2.aac#audio output.m4a
There works until you close the tty. To make them permanent you should write to .bashrc
erase duplicate commands in your history
export HISTCONTROL="erasedups:ignoreboth"
increase history bash size
export HISTFILESIZE=100000
export HISTSIZE=10000
don't save to .bash_history. "incognito mode" for tty
unset HISTFILE
sum of file size from current directory (or recursively with -R switch), only files
ls -al . | grep -E '^-' | awk '{ SUM += $5} END { print "SUM: " SUM/1024/1024 " MiB" }'
using find
find . -maxdepth 1 -type f -exec ls -l {} \; | awk '{ SUM += $5} END { print "SUM: " SUM/1024/1024 " MiB" }'
size of entire directory
du -hs .
jpgcrush reduces jpeg size by about 5%~10%
find -regex ".*\.\(jpg\|jpeg\)$" -exec jpgcrush {} \;
optipng and/or pngcrush reduce png size up to 10% pngcrush
find -iname "*.png" -exec pngcrush -brute {} {} \;
optipng
find -iname "*.png" -exec optipng -o7 {} \;
packjpg is jpeg lossless compressor which averagily reduces jpg files by 20%~25%. This is a kind of "zip" for jpg files.
find -regex ".*\.\(jpg\|jpeg\)$" -exec packjpg -np {} \;
to decompress
find -iname "*.pjg" -exec packjpg -np {} \;
parallel version example of the above commands (pngcrush would need some tweaks) -P 4 - 4 threads, -n 1 - 1 file per thread, you might want to increase to e.x. -n 10 to get slightly more speed
find -regex ".*\.\(jpg\|jpeg\)$" -print0 | xargs -0 -P 4 -n 1 jpgcrush