Compression formats with good support for random access within archives? [closed]

Take a look at dictzip. It is compatible with gzip and allows coarse random access. An excerpt from its man page: dictzip compresses files using the gzip(1) algorithm (LZ77) in a manner which is completely compatible with the gzip file format. An extension to the gzip file format (Extra Field, described in 2.3.1.1 of RFC … Read more

Why does base64-encoded data compress so poorly?

Most generic compression algorithms work with a one-byte granularity. Let’s consider the following string: “XXXXYYYYXXXXYYYY” A Run-Length-Encoding algorithm will say: “that’s 4 ‘X’, followed by 4 ‘Y’, followed by 4 ‘X’, followed by 4 ‘Y’” A Lempel-Ziv algorithm will say: “That’s the string ‘XXXXYYYY’, followed by the same string: so let’s replace the 2nd string … Read more

pdftk compression option

I had the same problem and found two different solutions (see this thread for more details). Both reduced the size of my uncompressed PDF dramatically. Pixelated (lossy): convert input.pdf -compress Zip output.pdf Unpixelated (lossless, but may display slightly differently): gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -sOutputFile=output.pdf input.pdf Edit: I just discovered another option (for … Read more

Gzip versus minify

Very simple to test. I took your js, put them in different files and ran gzip -9 on them. Here’s the result. This was done on a WinXP machine running Cygwin and gzip 1.3.12. -rwx—— 1 xxxxxxxx mkgroup-l-d 88 Apr 30 09:17 expanded.js.gz -rwx—— 1 xxxxxxxx mkgroup-l-d 81 Apr 30 09:18 minified.js.gz Here’s a further … Read more

How does Google’s Page Speed lossless image compression work?

If you’re really interested in the technical details, check out the source code: png_optimizer.cc jpeg_optimizer.cc webp_optimizer.cc For PNG files, they use OptiPNG with some trial-and-error approach // we use these four combinations because different images seem to benefit from // different parameters and this combination of 4 seems to work best for a large // … Read more

Create a tar.xz in one command

Use the -J compression option for xz. And remember to man tar 🙂 tar cfJ <archive.tar.xz> <files> Edit 2015-08-10: If you’re passing the arguments to tar with dashes (ex: tar -cf as opposed to tar cf), then the -f option must come last, since it specifies the filename (thanks to @A-B-B for pointing that out!). … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)