Last active
March 3, 2019 20:32
-
-
Save ccwoolf/b84bdf7391919ca51f622e871217bad1 to your computer and use it in GitHub Desktop.
Compression scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Compresses all input files into a single archive | |
7za a -m0=lzma2 -ms=on -mfb=273 -md=1536m -mmt=on archive.7z *.ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Extracts zips with shift-jis encoded filenames, using mvconv to convert to utf8 in most cases | |
env LANG=C 7z x "archive.zip" | |
convmv -f shift-jis -t utf8 --notest -r "extracted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Uses parallel and 7za to compress files (one archive per file) | |
# Jobs are limited to half of the available CPU cores as LZMA2 uses two threads for compression | |
parallel -j50% 7za a -m0=lzma2 -ms=on -mfb=273 -md=1536m -mmt=on {.}.7z {} ::: *.ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Uses parallel and arepack to recompress zip and rar archives in parallel | |
# Jobs are limited to half of the available CPU cores as LZMA2 uses two threads for compression | |
parallel -j50% arepack --each --format=7z -O-m0=lzma2 -O-ms=on -O-mfb=273 -O-md=1536m -O-mmt=on {} ::: *.{rar,zip} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment