5 ms·
I was confused as to how you could represent a bootable CD image in printable characters. It turns out that you can't. This is a tweet of a perl script which cr
by barbegal 8y ago
I was confused as to how you could represent a bootable CD image in printable characters. It turns out that you can't. This is a tweet of a perl script which creates a cd.iso file that you can then boot from. The perl script significantly decompresses the data in the tweet.
That said, this is a playable game in around 60 bytes of actual data which is impressive.
- makomk 8y agoIt's pretty light compression from what I can tell - basically just squashing down runs of nulls to a single count.
- wtmcc 8y agoThe compression is basic run-length encoding, leveraging the Perl repetition operator (x), and the property of the Perl print/say functions that they concat items passed in a list before writing to STDOUT. https://en.wikipedia.org/wiki/Run-length_encoding https://en.wikipedia.org/wiki/Run-length_encoding https://perldoc.perl.org/perlop.html#Multiplicative-Operators https://perldoc.perl.org/perlop.html#Multiplicative-Operator... https://perldoc.perl.org/functions/say.html https://perldoc.perl.org/functions/say.html https://perldoc.perl.org/functions/print.html https://perldoc.perl.org/functions/print.html
- lucb1e 8y agoI tried xz -9 on it and found, to my surprise, that it was actually longer than RLE! Then I tried gzip -9, because perhaps that has a smaller header? Yup, saved a few bytes, now it's about the same size. Finally, I remembered that bzip2 does a lot better on text than gzip, and who knows, it might also have a shorter header than xz. Again, a few more bytes saved! Down to 223, where the original is 249 bytes (including the 'say' part but excluding the unnecessary delimiting apostrophes or the rest of the command).
- mlindner 8y agoIt's not compressed. It's run length encoding which is an encoding, not compression.
- garaetjjte 8y agoNot CD images, but there is DOS C compiler generating executables with only printable characters (and also no self-modifying code that could contain non-printable characters) http://www.cs.cmu.edu/~tom7/abc/paper.txt http://www.cs.cmu.edu/~tom7/abc/paper.txt (view in monospace font, 160 character lines)
- mirimir 8y agoI'm reminded of the RSA in Perl "weapon" t-shirt :) https://upload.wikimedia.org/wikipedia/commons/9/96/Munitions_T-shirt_%28front%29.jpg https://upload.wikimedia.org/wikipedia/commons/9/96/Munition...
- raphlinus 8y agoMachine readable as well as machine washable[0]! [0]: http://cypherpunks.venona.com/archive/1995/10/msg00317.html http://cypherpunks.venona.com/archive/1995/10/msg00317.html
- cheeze 8y agoMan that shirt is awesome... But man I would never wear that shirt as that looks like the crown jewel of any neckbeards collection
- OscarCunningham 8y agoIt sounds like you've been trained to hate something that you actually love. That's kind of sad. Couldn't you just wear the awesome shirt while avoiding the negative aspects of neckbeards?
- whatsstolat 8y agoSo who's going to wear that bad boy through a US border? For full effect add a btc address, a tor logo, anonymous mask and take no electronic devices.
- SlowRobotAhead 8y agoTook me a second to figure out after looking at the assembly that it's possible because of base64.
- gerdesj 8y agoThat said, this is a playable game in around 60 bytes of actual data which is impressive. .. and way smaller than your comment .
- mlindner 8y agoPerl isn't doing any decompression. The data is just stored in base64 encoding.
- pard68 8y agoI looked at the that tweet for five or six minutes and was stumped. Now this makes more sense, thanks.
- 0xcde4c3db 8y agoMost of the "compression" is zero bytes due to fixed offsets of various things (e.g. the first 16 sectors of an ISO 9660 image are a "system area" not used by the actual file system).
- arcticbull 8y agoYeah, it's a really simple run-length encoded ISO expressed as a Perl script.