\

Decoding the obfuscated bash script on a Uniqlo t-shirt

1039 points - today at 8:46 AM

Source
  • estebarb

    today at 11:57 AM

    "Uniqlo x Akamai sells another design of shirt in the same range which is plainly incomplete"

    Imagine having to return a t-shirt because that malfunction!

    — I don't understand why are you returning this, was the size wrong or you didn't like it?

    — No, there is a syntax error at line 37 that makes it impossible to run, and I'm concerned people on the street may think I promote unsafe bash scripting.

      • mcdonje

        today at 5:33 PM

        ATTN, Uniqlo customer service employees: If someone tries to return a shirt claiming an error in the printed computer code, decline the request and reply, "A real script kiddie would've spotted that error before buying."

        • _joel

          today at 1:32 PM

          Worked on my torso

          • N7lo4nl34akaoSN

            today at 5:35 PM

            pipefail

            • noisy_boy

              today at 2:46 PM

              - I am shell-shocked at the lack of quality assurance! Can you at least apply a patch?

                • entropie

                  today at 2:58 PM

                  Patch could be applied via pants.

                  • alentred

                    today at 4:29 PM

                    - Sure, we distribute a patch, you hot-fix it.

                • cromka

                  today at 12:06 PM

                  Oh the Karens these days!

                    • Octoth0rpe

                      today at 1:19 PM

                      Surely such a person would use the spelling k@r3n

                        • basilikum

                          today at 5:00 PM

                          K4R311

                  • NoSalt

                    today at 4:02 PM

                    Spite

                • olooney

                  today at 1:21 PM

                  If you enjoy this kind of thing, you might also like Martin Kleppe's work, such as the Quine Clock:

                  https://aem1k.com/qlock/

                  I reverse engineered it to a unobfuscated version a few years ago:

                  https://gist.github.com/olooney/a89db3932b089925b71b68d7e9f2...

                  He's done a ton of other great ASCII visualizations as well:

                  https://aem1k.com/

                    • esquivalience

                      today at 3:45 PM

                      This is really cool, and I appreciated your reverse engineering.

                  • raphlinus

                    today at 1:29 PM

                    The font is Roboto Mono, not Consolas.

                    There's something else a lot stranger going on, though. It is a proper monospace font, but the typesetting on the shirt is not. There's some kerning going on (I noticed it especially in the 'Iy' pair), and also it appears that narrower characters such as 'i' take less horizontal space. If I had to guess, I would say that it was set with a tool such as "optical kerning" in InDesign.

                      • somat

                        today at 2:14 PM

                        Has anyone ever made a monospace font with dynamic kerning? Which is a silly thing I never thought of until I read the above comment. This sounds nonsensical at first glance(and it may be) but hear me out.

                        We use monospace fonts for a reason, they stack in a grid nicely. But within the confines of that grid there is room to shift a character left or right a bit which may lead to a nicer to read monospace. (it is equally likely to lead to a hideous mess, every time a letter would shift left it would leave a larger space right)

                          • roblabla

                            today at 2:28 PM

                            Monaspace has a feature called "texture healing" that does something similar: it allows bigger letters to "steal" space from adjascent smaller letters, to make it easier to read. The result is that the letters are still in a grid, while still allowing for bigger letters to "breathe".

                            https://github.com/githubnext/monaspace/blob/main/docs/Textu...

                            It's the main reason I use monaspace as a font.

                              • bityard

                                today at 4:42 PM

                                I'm open to trying it, but my gosh, having one 'w' offset slightly by a few pixels from the one right above it feels like it would drive me bonkers eventually.

                                And: doesn't this result in text that "jumps around" as you type?

                                • gavinray

                                  today at 3:21 PM

                                  What a brilliant idea, neat. Thanks for the link.

                              • Lalabadie

                                today at 3:02 PM

                                iA Writer has Mono, Duo and Quattro fonts, with the latter two being almost monospaced. They concede some size variations for specific characters (Duo has 150% width characters, Quattro also uses 50% and 75% for narrow characters).

                                It's a fun subtle adaptation to keep close to the typewriter-like experience of the app.

                                https://ia.net/topics/a-typographic-christmas

                                • kccqzy

                                  today at 3:14 PM

                                  Shifting a letter left or right a bit can break the grid. What if the user writes the text that keeps triggering left shifts? A better solution is to use ligatures, so that specific character combinations look better while the ligature can maintain the overall width correctly.

                              • speerer

                                today at 2:32 PM

                                Thank you, I think you're right! I've added a correction in the post and cited your comment.

                            • wbh1

                              today at 10:36 AM

                              I love this shirt! Here's a nice video from the actual designer about the process of making this shirt (including intentionally making it hard to OCR): https://youtu.be/jocGLiecpjU?t=526

                                • criddell

                                  today at 1:00 PM

                                  It would probably be quicker to type it in than figure out how to OCR it. It would be like typing in a game from a COMPUTE! magazine 45 years go.

                                  https://archive.org/details/1983-01-compute-magazine/page/96...

                                  • fennecfoxy

                                    today at 3:45 PM

                                    But it's not hard to OCR? And I don't know why the article dedicates an entire section to it.

                                    On a Samsung S24U I held down the "circle to search" homescreen button which brings up the AI tools interface (I don't know what it's officially called), held down on the text and copied the whole thing in one shot.

                                    It took like 2 seconds.

                                      • kyusan0

                                        today at 4:22 PM

                                        Did it get every character correct?

                                    • speerer

                                      today at 11:25 AM

                                      Author here. Thank you so much for the link which I hadn't seen! I'm very happy to see this and I'm gratified that it was deliberately difficult to OCR, not just me.

                                      • VladVladikoff

                                        today at 3:29 PM

                                        I watched the link but I didn’t see where he talked about making it difficult to OCR? What exactly was done that made it difficult to OCR?

                                    • Tiberium

                                      today at 9:17 AM

                                      OCRing this is a nightmare and is a good benchmark to any self-proclaimed good OCR/vision model.

                                      I think though it could likely be easily OCR'd if you give the image to any decent agentic harness with a good vision model, e.g. newest Claude/GPT ones, and tell them to split the image per lines, and then just OCR each line individually.

                                      I wonder if the script itself was written by an LLM before obfuscation? There seem to be a lot of comments in it, but in this case it's still ok :)

                                        • grumbelbart2

                                          today at 1:12 PM

                                          > OCRing this is a nightmare and is a good benchmark to any self-proclaimed good OCR/vision model.

                                          It's not that difficult, our industrial OCR model read it correctly on its first attempt with default parameters. The characters are easily separable, there is no structured background (think expiration dates on yogurt aluminum lids) that confuses the reader, there is no almost-text-like texture anywhere that would clutter the result. The font is also nice and standard.

                                          • lemagedurage

                                            today at 10:22 AM

                                            I don't think it was written by an LLM, some things stand out:

                                            The congratulations text is both in English and Japanese. Contains a single heart emoji.

                                            There was an intention to have a cyan to orange gradient, but the range starts in an ANSI block, ends halfway through the 256 color block and 256 terminal colors are not arranged like a gradient at all.

                                            There's no sleep at the end of the loop where I feel like an LLM would add that defensively.

                                              • n2j3

                                                today at 10:31 AM

                                                Human here. I added a sleep 0.5 at the end, it's too fast to read otherwise. Makes for a nice terminal screensaver!

                                                  • INTPenis

                                                    today at 11:01 AM

                                                    Hi fellow human, I got the same idea. Just a sleep 0.1 before the echo "" makes it readable. Otherwise it scrolls way too fast.

                                                • make3

                                                  today at 10:41 AM

                                                  "the code is not quite detail oriented enough to be AI", times are changing

                                                    • pkilgore

                                                      today at 2:05 PM

                                                      Flawless, completely unnecessary abstraction is a better tell of LLM code than "comment clearly responding to a part of a prompt that I cannot see".

                                                      • DaSHacka

                                                        today at 11:04 AM

                                                        More like 'not boilerplate-y enough'

                                                        • lemagedurage

                                                          today at 11:16 AM

                                                          Ehh, AI makes plenty mistakes but they have a different vibe to it.

                                                          In my mind an AI would do something the most popular way even when that's not appropriate.

                                                          A human might do things in an unpopular way even when that's not appropriate.

                                                  • netsharc

                                                    today at 10:53 AM

                                                    The last time Internet people were obsessed with OCRing some base64 was a few months ago when the DoJ released tons of emails from some guy who died, but they were released as rasterized PDFs.

                                                    Can't remember his name now, there's been so many distractions...

                                                    • OtherShrezzing

                                                      today at 10:37 AM

                                                      Safari's copy-text-from-image feature manages the entire base64 part of the string, except for the first character (I instead of a T). Weirdly, it gets much worse performance if you try to copy the entire string, including the hashbang part.

                                                      I wonder what it's doing under the hood to get such good performance?

                                                        • khurs

                                                          today at 10:43 AM

                                                          Didn't know Safari had this.

                                                          Looked it up, you put mouse over text, then just select and copy it - very cool!

                                                          https://support.apple.com/en-gb/guide/safari/ibrw20183ad7/ma...

                                                            • al_borland

                                                              today at 12:53 PM

                                                              It’s actually a system feature, not strictly a Safari feature. It also works in Photos, Preview, etc.

                                                              On meetings I will often take a screenshot of the URL someone is presenting. I’m then able to just open the image and click the URL in the image.

                                                              • iamflimflam1

                                                                today at 11:13 AM

                                                                There’s a whole bunch of hidden features that no one seems to be aware of.

                                                                Preview has pretty good background removal.

                                                                Notes will transcribe audio from audio files.

                                                                  • al_borland

                                                                    today at 12:54 PM

                                                                    Notes will do OCR as well. Trigger the feature, point the camera at something, and it will input just the text.

                                                                      • lostlogin

                                                                        today at 2:02 PM

                                                                        Notes is amazing. Autocompleting equations, converting jpg to pdf and various other admin chores.

                                                                        The seamless cloud sync between devices is much appreciated too.

                                                                    • today at 12:13 PM

                                                                  • agys

                                                                    today at 10:53 AM

                                                                    Preview has it too… And it works extremely well.

                                                            • underyx

                                                              today at 12:06 PM

                                                              I gave the photo to Opus 4.8 and it reconstructed the same script in one shot. Although it did say it had to correct some parts of it based on context where it suspected OCR mistakes.

                                                              • fennecfoxy

                                                                today at 3:46 PM

                                                                Is it? Android tap and hold/image text select one-shotted it in 2 seconds.

                                                                • shakna

                                                                  today at 10:57 AM

                                                                  > I wonder if the script itself was written by an LLM before obfuscation?

                                                                  From the prototype shown here [0], and the way they talk about their process, I sincerely doubt it. Especially as they mention trying to make it hard for AI to handle the output.

                                                                  [0] https://youtu.be/jocGLiecpjU?t=567

                                                                    • cb321

                                                                      today at 11:41 AM

                                                                      I watched that whole video link - thank you for that - and he doesn't really say. In fact, he spends much more time on the beige color harkening to computer case plastics of the 80s & 90s.

                                                                      The AI not handling the output relates to the final base64 output on the T-shirt (which other comments in this thread mention manually keying in or TFA discusses in the context of OCR). So, that is just not relevant to the question.

                                                                      What made me start to wonder, personally, was that the output seems identical if you use "♄PEACE♄FOR♄ALL" instead of the version with internal repeats. IF there is any point to that "manual expansion of the cycles", IMO that deserves a comment much more so than "# Calculate length of text; text_length=".

                                                                      Also, that `echo -n ...` followed by `echo ""` instead of just plain `echo` in the first place seems like the kind of copy-pasta code LLMs generate. Then again, regular devs also write pretty bad copy-pasta code.

                                                                      There is also this the weirdly "broken down" calculation with 3 `bc` invocations not 1 as if it was translated from a language with more arithmetic/special function power than bash.

                                                                      There is also the color scale stuff done in the loop instead of outside (except the one color=$(..)) which seems very unnatural and also very like machine translation.

                                                                      Also, at least for me, on my bash-5.3.15(1), `char="${text:t % text_length:1}"` does not work to slice out the multi-byte UTF8 heart symbols, but it sure does look like the kind of thing an LLM would do translating from a python3 script (such as something like https://news.ycombinator.com/item?id=48830669) into bash.

                                                                      Another thing is, as others here have observed, there is nothing "gradual" about the xterm-256 color cube. So, "gradient" is a misnomer and exactly the kind of weird things LLMs do when they cobble text together.

                                                                      Finally, all the tput stuff the script does instead of just "print x spaces" really smells like a human description of the side scroll in the video game graphic he shows inspired him somehow LLM-corrupted/complexified into the vertical scroll terminals do.

                                                                      None of this is conclusive, but the video mentions 2023..2025 as when he did it and given that he was a designer and his concerns more visual than code-oriented, I'd have to say I disagree with your sincere doubt and I do strongly suspect the decoded script was very likely LLM-circa2024-generated, possibly with light post-edits by hand.

                                                                        • shakna

                                                                          today at 1:12 PM

                                                                          You mention someone else's Python version. Did you note that the prototype in the video was... Python?

                                                                          All the smells you pointed out, just look like a Python dev approaching bash without fully understanding it.

                                                                            • bigfishrunning

                                                                              today at 1:24 PM

                                                                              > All the smells you pointed out, just look like a Python dev approaching bash without fully understanding it.

                                                                              also, referring to Linux as "the language of the internet" when bash isn't particularly suited for internet tasks also smell like "excited windows Python dev"...

                                                                                • cb321

                                                                                  today at 1:48 PM

                                                                                  FWIW, his screens looked a lot like OSX to me (which tracks with graphic design users in my experience).

                                                                                  Anyway, he seems like a very nice fellow and I wish him and almost all T-shirt designers well. That bash script just gave me a lot of pause. (And even that seems possibly downstream of him being nice and doing it himself to spare his team from what he called a "FrankenProject".)

                                                                              • cb321

                                                                                today at 1:37 PM

                                                                                Yeah. The Flask web-page prototype was indeed in Python. (The prequel shirt was Go.)

                                                                                { Also, it was my own Py version which I mostly did in case anyone wanted to actually run the thing after such interest was expressed on this thread. :-) }

                                                                                I already said regular devs and LLMs can both gen copy-pasta. That said, being "mostly" a Python dev, asking some LLM to translate to bash for him seems even more likely to me. Only he or those close to him knows for sure. You & I cannot settle it here conclusively (as also said).

                                                                                I also noted from the video that the ♄s (hearts) worked on whatever version of bash he tested with though it failed for me (which is why I wrote that Python). And his terminal title bar is switching between `tput` and `bc` and such meaning that what he was demoing was not some Python script. ĀÆ\_(惄)_/ĀÆ

                                                                                EDIT: Ah..another resolution of the hearts is to not run in an LC_ALL=C environment. Oops! `LC_ALL=en_US.UTF-8 bash ..` fixed it. Oh well, I think the Python script is nicer in almost every way. E.g., you could |head -n60 and send it to a line printer/dot matrix reminiscent of the 1980s computers he shows in the video, although your printer driver would have to strip the color escapes with a `sed` or maybe https://github.com/c-blake/bu/blob/main/noc.nim. ;-)

                                                                    • ErroneousBosh

                                                                      today at 3:14 PM

                                                                      Those of us who grew up in the 8-bit era would have just typed it in, carefully, in silence, with no-one allowed to enter or leave the room until we were done ;-)

                                                                      • justusthane

                                                                        today at 1:08 PM

                                                                        What is it about this that makes it particularly hard to OCR?

                                                                        • da_grift_shift

                                                                          today at 12:29 PM

                                                                          >I wonder if the script itself was written by an LLM before obfuscation?

                                                                          I seem to recall seeing an Akamai-branded base64'd shell script on a white shirt pre-2021(?), so unless they've changed the code since then, I doubt it...

                                                                          • IshKebab

                                                                            today at 9:47 AM

                                                                            Definitely LLM. No humans write that many comments.

                                                                              • ChrisMarshallNY

                                                                                today at 10:23 AM

                                                                                Ahem...

                                                                                My code usually clocs at 50/50 (or thereabouts)[0]. Has, since my very first real engineering project (in 1987)[1]. I discuss in detail, here[2].

                                                                                But one reason that I like LLMs, is that they help me to write even more documentation. I have found that I can instruct an LLM to revise my documentation, and make it even more effective.

                                                                                [0] https://github.com/ChrisMarshallNY (My GH profile. Pretty much everything there, is like that -has, since long before LLMs were a broken rubber on the drug store shelf).

                                                                                [1] https://littlegreenviper.com/wp-content/uploads/2022/07/TF30... (Downloads a PDF)

                                                                                [2] https://littlegreenviper.com/leaving-a-legacy/

                                                                                  • IshKebab

                                                                                    today at 2:51 PM

                                                                                    Your code isn't as unnecessarily commented as this. E.g. look at this line

                                                                                    https://github.com/RiftValleySoftware/RVS_Spinner/blob/d44ee...

                                                                                    An LLM would have commented `// Create temporary UI view.`

                                                                                    Completely redundant comments like this are a classic hallmark of LLMs:

                                                                                      # Set frequency scaling factor
                                                                                      freq=0.2
                                                                                    
                                                                                    Dunno why I have been downvoted for stating the obvious.

                                                                                    Also from my brief look at one file it looks like you have 50% comments because you have a gazillion comment separator lines.

                                                                                      • ChrisMarshallNY

                                                                                        today at 3:34 PM

                                                                                        I didn't downvote. There's nothing wrong with your comment. It's just a bit silly, because humans definitely write that much. I learned from Apple and Adobe headerdocs.

                                                                                        I worked for a Japanese company that accreted comments.

                                                                                        Yeah, lots of whitespace.

                                                                                • petu

                                                                                  today at 10:10 AM

                                                                                  Human could write that many comments to get enough base64 text for a design. Maybe to even get some of the highlighted characters in places they want (roughly equally spaced apart).

                                                                                  • ivolimmen

                                                                                    today at 12:54 PM

                                                                                    Since LLM's are mimicking our code my guess we do...

                                                                                    • latexr

                                                                                      today at 10:24 AM

                                                                                      > No humans write that many comments.

                                                                                      Especially in a case like this, I would definitely write a lot of comments to aid in understanding, thus increasing trust so people would try it out and tinker with it.

                                                                                        • boomboomsubban

                                                                                          today at 10:34 AM

                                                                                          Plus the main point of this code is to have people look at it, the function is secondary to being an easter egg.

                                                                                      • NamlchakKhandro

                                                                                        today at 2:02 PM

                                                                                        I do

                                                                                        • Tiberium

                                                                                          today at 9:49 AM

                                                                                          Honestly it's a bit of a shame. I checked and they could've shortened their base64 payload by 304 chars by removing all comments except the top two congratulatory ones, or by 524 if they removed those too.

                                                                                            • OtherShrezzing

                                                                                              today at 10:25 AM

                                                                                              Would they still get the highlighted "PEACE FOR ALL" text throughout the shortened string? It looks like the length, and presence of those characters, was an explicit design choice.

                                                                                              • lemagedurage

                                                                                                today at 10:30 AM

                                                                                                Maybe they added the comments to get a longer payload for the sake of the shirt's design.

                                                                                                The comments can be more cute/awe inspiring for people who aren't as familiar with bash but like solving puzzles as well.

                                                                                                • yborg

                                                                                                  today at 10:38 AM

                                                                                                  The HN optimizing T-shirt compiler is the next stage here :D

                                                                                                  • saidnooneever

                                                                                                    today at 9:54 AM

                                                                                                    im just sad it didnt render a qr code leading to malware :'). the different ways ppl look at obfuscated codes and scripts hah

                                                                                        • world2vec

                                                                                          today at 9:58 AM

                                                                                          Oh wow I saw that tshirt at the store and said to my girlfriend "no way that script is functional, probably just for show". I should have persevered.

                                                                                            • actionfromafar

                                                                                              today at 10:49 AM

                                                                                              An easy miss. :-) Most of the time our thoughts are on autopilot, since we are not calm.

                                                                                          • mk_stjames

                                                                                            today at 1:53 PM

                                                                                            Neat. My only critique of the script is that I would have added a

                                                                                              sleep 0.1 
                                                                                            
                                                                                            in the loop so that as this prints in a terminal it is actually readable; any modern terminal will scroll so fast you can't see the message in flight.

                                                                                            Slowing it to a 10hz refresh makes it look great.

                                                                                              • whartung

                                                                                                today at 1:58 PM

                                                                                                Maybe you can sew a patch into it?

                                                                                            • nico

                                                                                              today at 2:35 PM

                                                                                              Very cool. It reminded me of the DeCSS t-shirts, which had source code with the decryption keys for DVDs

                                                                                              https://en.wikipedia.org/wiki/DeCSS

                                                                                              • haileys

                                                                                                today at 9:49 AM

                                                                                                I thought it was funny that the author used a variety of OCR tools with mixed success before spending a lot of time manually fixing up the output from the best one, rather than just typing it in

                                                                                                  • christoph

                                                                                                    today at 10:17 AM

                                                                                                    That was also my thought… but I grew up mashing rubber keys for hours copying ā€œgamesā€ out of magazines and books! Then hours after fixing all the typos!

                                                                                                      • forinti

                                                                                                        today at 12:51 PM

                                                                                                        I spent hours typing 6502 assembly. It went a lot better when someone dictated: LDA, STA, BEQ, LDY, STY...

                                                                                                    • acters

                                                                                                      today at 10:36 AM

                                                                                                      I ran it through paddle paddle OCR and it flawlessly did it. Google's OCR through my phone's Google lens had also worked at getting a very good extraction but not 100% correct. Definitely would spend less time fixing it than hand copying.

                                                                                                      IDK what the author was using but I feel like he could have shared how his OCR attempt went, but I am thinking he tried some naive OCR tools.

                                                                                                        • speerer

                                                                                                          today at 11:21 AM

                                                                                                          Author here - that's a good idea actually, it shouldn't be too hard to compare the various attempts. The tools I used were whatever my Android built-in is (likely Google Gemini, but I can't tell whether this is something Samsung has replaced in OneUI); tesseract; tesseract with various tweaks and charsrt restrictions; Claude; and finally, manual fixes based on disagreements between all the previous.

                                                                                                      • rtldg

                                                                                                        today at 10:10 AM

                                                                                                        Took me almost 2 minutes for 4 lines (and I missed a character in one of them!). I would opt for OCR too, obviously so I'm prepared for the next bash t-shirt I'd come across...

                                                                                                          • OtherShrezzing

                                                                                                            today at 10:30 AM

                                                                                                            I think this is a case where two people can successfully complete the task manually faster than one attempting to automate it. Get a ruler, read five centimetres of characters to your colleague, have them type it in as you go, then repeat that five centimetres back to you. Correct as you go. Format your string with the same line-breaks as the t-shirt, and remove them at the end, so you can be sure you've got the correct length on each row. Trial-and-error adjust the five-cm distance depending on your success rate as you go along

                                                                                                            All in, you should have a non-corrupted string in 10-15 min.

                                                                                                        • conductr

                                                                                                          today at 2:23 PM

                                                                                                          Feels like my experienced reality of task automation in corporate environments. We routinely have engineers spend 40+ hours automating tasks that an entry level person can do manually in 10 minutes and only need to be done weekly. Automation at all costs seems to be the future

                                                                                                            • e28eta

                                                                                                              today at 2:59 PM

                                                                                                              It’s certainly not a new phenomenon. I appreciate this XKCD [1], with a chart of ā€œHow long can you work on making a routine task more efficient before you’re spending more time than you saveā€

                                                                                                              It’s not the final word, since automation has other benefits: documenting the procedure’s steps, reducing human errors, increasing consistency, etc.

                                                                                                              1: https://xkcd.com/1205/

                                                                                                          • grumbel

                                                                                                            today at 11:09 AM

                                                                                                            Gemini3.5 Flash didn't have a problem OCR'ing and base64 decoding it, despite the OCR step having errors, it just fixed them in the base64 decoding step.

                                                                                                            • mayas_

                                                                                                              today at 9:55 AM

                                                                                                              "just typing it" would be more error prone for the average human

                                                                                                              • speerer

                                                                                                                today at 11:22 AM

                                                                                                                (Author here) Yes I agree. It was a fun side-quest though. Reminds me of https://xkcd.com/1205/

                                                                                                                • duskdozer

                                                                                                                  today at 10:19 AM

                                                                                                                  I'm guilty of this, but for me this kind of thing is optimizing over annoyance rather than time.

                                                                                                              • chrysoprace

                                                                                                                today at 11:20 AM

                                                                                                                My old colleague had one with a Go program[0] which I always thought was quite cool.

                                                                                                                [0] https://github.com/GL-Kageyama/UNIQLO_Akamai_T-shirt_Code

                                                                                                                  • mdgld

                                                                                                                    today at 11:25 AM

                                                                                                                    I wasn’t sure if you meant a Go solver or Go the language. Would be fun if someone wrote a Go program in Go

                                                                                                                      • psd1

                                                                                                                        today at 11:51 AM

                                                                                                                        Or a pong clone in Racket.

                                                                                                                    • ExoticPearTree

                                                                                                                      today at 11:27 AM

                                                                                                                      I got one this year with the Go code. Never actually thought it is legit code, just some random stuff.

                                                                                                                  • forinti

                                                                                                                    today at 12:45 PM

                                                                                                                    This reminds me of a T-shirt I once saw that read:

                                                                                                                              perl -e '
                                                                                                                         "$a="etbjxntqrdke";
                                                                                                                      $a=~s/(.)/chr(ord($1)+1)/eg;
                                                                                                                            print "$a\n;"'
                                                                                                                    
                                                                                                                    It's cursing. Don't run it if it might offend you.

                                                                                                                    Upon seeing this, I decided to golf and came up with a shorter version:

                                                                                                                      perl -e "print chr 1+ ord for split //,'etbjxntqrdke'"

                                                                                                                      • librasteve

                                                                                                                        today at 12:57 PM

                                                                                                                        or

                                                                                                                          raku -e 'say "etbjxntqrdke".comb.map({chr .ord + 1}).join'

                                                                                                                          • lizmat

                                                                                                                            today at 3:10 PM

                                                                                                                            or

                                                                                                                            raku -e 'say "etbjxntqrdke".comb.map(*.succ).join'

                                                                                                                    • qiqitori

                                                                                                                      today at 11:01 AM

                                                                                                                      I once wrote a tool that helps with finding mistakes in OCR'd fixed width text, https://blog.qiqitori.com/2023/03/ocring-hex-dumps-or-other-...

                                                                                                                      Basically it just clusters same characters and asks the human to find the problems, which is easy when you're looking at a series of pictures like ssssss5sss.

                                                                                                                      The UI is kinda least-effort. Should ask a modern AI agent to make it look nice and intuitive, sometime maybe.

                                                                                                                      • duggan

                                                                                                                        today at 3:52 PM

                                                                                                                        I do like these sorts of things; decoded a less exciting one from a bottle of wine I found in 2019. Significantly more eye-watering without OCR: https://xcancel.com/duggan/status/1130920846304993282

                                                                                                                        • raffael_de

                                                                                                                          today at 12:55 PM

                                                                                                                          while base64 can be considered obfuscation in this context and its inverse as decoding I can't help but feel this title is overselling and catering to a rather cyber-cheesy marketing campaign at that.

                                                                                                                            • ape4

                                                                                                                              today at 1:00 PM

                                                                                                                              Yeah, its a bit of a cheat. The best obfuscated C programs have the source looking like a Christmas tree (or something) and then play an xmas song (or whatever)

                                                                                                                                • raffael_de

                                                                                                                                  today at 1:02 PM

                                                                                                                                  the base64 thing they did feels like a cheap version of that green-obscure-symbols-raining-on-a-terminal animation in The Matrix. should have gone with "Hack the Planet" instead ...

                                                                                                                            • today at 1:04 PM

                                                                                                                          • 9dev

                                                                                                                            today at 1:57 PM

                                                                                                                            Huh! I was sure the copy-text-from-image feature in MacOS would handle this flawlessly. But the best run I managed produced the following:

                                                                                                                                base64: stdin: (null): error decoding base64 input stream
                                                                                                                                #!/bin/bash
                                                                                                                                
                                                                                                                                # Congratulations! You found thu eastur ugg!#B��O��
                                                                                                                                # ćŠć‚ć§ćØć†ļæ½ļæ½M�ぇMļæ½ć™ļ¼éš£Cļæ½ļæ½ć‚M�サ�#ćƒ©ć‚¤ļæ½ļæ½ļæ½ļæ½č¦‹ć§M�������!O��
                                                                                                                                
                                                                                                                                # Define thu tuxt to anima|e
                                                                                                                                text="♄PEACE♄FOR♄ALOB��PEACE♵FOR♵ALL♵PEACE♄FOR♄ALL♄PEACE♄FOR♄ALL♄PEACE♵FOR♵ALL♄"
                                                                                                                                
                                                                                                                                # Get termbļæ½al dmmensions
                                                                                                                                cols=$(tput cols)
                                                                                                                                linus=$(tput lines)

                                                                                                                            • thenthenthen

                                                                                                                              today at 3:26 PM

                                                                                                                              My japanese friends say: yes because uniqlo is a science company not a clothing company

                                                                                                                              • pacofonix

                                                                                                                                today at 1:36 PM

                                                                                                                                For a non English locale that use comma instead of dot for decimals (in my case, Spanish), this script is partially crashing. Run using something like `chmod +x shirt.sh; LC_NUMERIC=C ./shirt.sh`.

                                                                                                                                • sixtyj

                                                                                                                                  today at 11:58 AM

                                                                                                                                  > Interesting. I told my wife "that’s basically how people ship viruses’ and bought it.

                                                                                                                                  It’s a movie plot.

                                                                                                                                  • NikxDa

                                                                                                                                    today at 2:00 PM

                                                                                                                                    Super cool, especially that the code is annotated!

                                                                                                                                    In case the author is reading: The decorative feather images are between 2MB to almost 5MB in size. Compression might be in order to save users time and bandwidth, and make the site look less broken while the images are partially loaded :)

                                                                                                                                    • wyldfire

                                                                                                                                      today at 1:15 PM

                                                                                                                                      That "beige box" term is not the beige box I was thinking of at first.

                                                                                                                                      [1] https://en.wikipedia.org/wiki/Beige_box_(phreaking)

                                                                                                                                      • cb321

                                                                                                                                        today at 11:45 AM

                                                                                                                                        For anyone that cares, this is a slightly less stupid Python version:

                                                                                                                                            #!/usr/bin/env python3
                                                                                                                                            from os   import environ; E = environ.get
                                                                                                                                            from math import sin
                                                                                                                                            from time import sleep
                                                                                                                                            text = "♄PEACE♄FOR♄ALL" # The text to sine-scroll animate
                                                                                                                                            nText  = len(text)      # Number of utf8 chars
                                                                                                                                            freq   = 0.2            # Frequency scaling factor
                                                                                                                                            color0 = 12             # xt256 Color cube segment 12..<208
                                                                                                                                            color1 = 208; nColor = color1 - color0
                                                                                                                                            (w, h) = (int(E("COLUMNS", 80)), int(E("LINES", 24)))
                                                                                                                                            t = 0
                                                                                                                                            while True:
                                                                                                                                                x = (w/2) + (w/4)*sin(t*freq)           # x pos via sine value
                                                                                                                                                x = max(0, min(w - 1, int(x + 0.5)))    # bound to tty width
                                                                                                                                                color = color0 + ((nColor*t)//h)%nColor # cycle colors
                                                                                                                                                ch = text[t%nText]  # Get char & Use xterm-256 color escs
                                                                                                                                                print("%*s\033[38;5;%sm%s\033[m\n" % (x, "", color, ch))
                                                                                                                                                t += 1
                                                                                                                                                sleep(0.1)   # original used bc shell outs to rate-limit
                                                                                                                                        
                                                                                                                                        As mentioned in https://news.ycombinator.com/item?id=48830634 , the heart symbols did not otherwise even work for my bash and some have commented on liking the screen saver.

                                                                                                                                          • conductr

                                                                                                                                            today at 2:34 PM

                                                                                                                                            You should base64 it and sell tshirts

                                                                                                                                            • today at 2:40 PM

                                                                                                                                          • today at 3:39 PM

                                                                                                                                            • today at 10:04 AM

                                                                                                                                              • chrisweekly

                                                                                                                                                today at 12:37 PM

                                                                                                                                                Great post! It's interesting, detailed but concise, and well-written. Also, I appreciate the "no cookies or tracking" and attractive, functional and performant site design.

                                                                                                                                                • DrewADesign

                                                                                                                                                  today at 9:57 AM

                                                                                                                                                  > I guess Uniqlo is run through Windows though: one thing that struck me was the font, which I’m almost certain is Consolas,

                                                                                                                                                  Surely this would use whatever font the virtual terminal profile was set to? I don’t know of any method to choose a virtual terminal font from bash and don’t see any code that addresses it?

                                                                                                                                                    • nisiddharth

                                                                                                                                                      today at 9:59 AM

                                                                                                                                                      They're referring to the font on the T-shirt.

                                                                                                                                                        • DrewADesign

                                                                                                                                                          today at 4:28 PM

                                                                                                                                                          Ah, I see. I’m sure the clothing designer that actually made the design couldn’t care less about technical consistency and was just looking for something ā€˜tech’ looking that also read well in that design context in that medium.

                                                                                                                                                          • tym0

                                                                                                                                                            today at 10:17 AM

                                                                                                                                                            Thank you for spelling it out for me because I thought I was looking at a completely hallucinated AI article...

                                                                                                                                                              • speerer

                                                                                                                                                                today at 12:47 PM

                                                                                                                                                                Author here. All hallucinations are my own. Now you point it out, I see why the jump in context from the terminal back to the tshirt font would give the wrong impression.

                                                                                                                                                                  • tym0

                                                                                                                                                                    today at 1:09 PM

                                                                                                                                                                    Honestly it was quite a whiplash to go from what looked like a good article to something that seemed completely made up. But I would chalk that up more to my reading comprehension than your writing.

                                                                                                                                                                      • DrewADesign

                                                                                                                                                                        today at 4:29 PM

                                                                                                                                                                        I didn’t read it as generated text, but the context definitely threw me.

                                                                                                                                                    • _flux

                                                                                                                                                      today at 11:54 AM

                                                                                                                                                      On one hand it's nice how it's clean and commented, but on the other hand some golfing could have made the encoded block a lot more reasonable to actually manually enter.

                                                                                                                                                        • puttycat

                                                                                                                                                          today at 11:55 AM

                                                                                                                                                          The comments just mean they used AI to do that in 3 seconds

                                                                                                                                                          • speerer

                                                                                                                                                            today at 12:47 PM

                                                                                                                                                            It might not have filled up the whole shirt then?

                                                                                                                                                              • _flux

                                                                                                                                                                today at 5:14 PM

                                                                                                                                                                Could have used bigger font.

                                                                                                                                                        • teo_zero

                                                                                                                                                          today at 12:41 PM

                                                                                                                                                          I don't know... I prefer unobfuscated text that you can immediately grok. The other day I saw this on a T-shirt:

                                                                                                                                                          > May the mƗs/t² be with you

                                                                                                                                                          • felineflock

                                                                                                                                                            today at 2:24 PM

                                                                                                                                                            Phew! I was hoping it was not a novel way of spreading a malicious script!

                                                                                                                                                            • high_byte

                                                                                                                                                              today at 9:26 AM

                                                                                                                                                              what if it contained a zero day for tesseract and the script you thought you got is just a throwaway

                                                                                                                                                                • today at 10:46 AM

                                                                                                                                                              • kijin

                                                                                                                                                                today at 10:54 AM

                                                                                                                                                                Well at least they're not instructing consumers to run curl | bash.

                                                                                                                                                                That's better than half the tech howtos out there.

                                                                                                                                                                  • INTPenis

                                                                                                                                                                    today at 11:02 AM

                                                                                                                                                                    No, they're instructing their customers to run unknown base64 encoded code instead. :D

                                                                                                                                                                      • bigfishrunning

                                                                                                                                                                        today at 1:28 PM

                                                                                                                                                                        They should have just had the base64 block and forced you to decode and read it before running it, rather then having the `eval` bit at the beginning...

                                                                                                                                                                          • kijin

                                                                                                                                                                            today at 2:27 PM

                                                                                                                                                                            But that wouldn't have looked like a bash script, only a random sequence of characters. The shebang at the start definitely contributes to the geek factor.

                                                                                                                                                                • luciana1u

                                                                                                                                                                  today at 3:06 PM

                                                                                                                                                                  finally, a t-shirt that ships with a CVE. i'm waiting for the limited edition that requires a firmware update before washing.

                                                                                                                                                                  • busymom0

                                                                                                                                                                    today at 4:49 PM

                                                                                                                                                                    > I’ve no idea at all how many views this site gets, but I’m willing to bet it’s not even double-digit humans per month.

                                                                                                                                                                    I'd take that bet considering it's got close to thousand upvotes and on front page of HN

                                                                                                                                                                    • shim__

                                                                                                                                                                      today at 11:42 AM

                                                                                                                                                                      Could have saved 50% with 'base64 -d | gzip -d'

                                                                                                                                                                        • speerer

                                                                                                                                                                          today at 12:48 PM

                                                                                                                                                                          Maybe useful for those XS sizes.

                                                                                                                                                                      • Gabrys1

                                                                                                                                                                        today at 1:03 PM

                                                                                                                                                                        I don't understand the font bit. This is a terminal script, it uses the font that your terminal uses?

                                                                                                                                                                          • LeifCarrotson

                                                                                                                                                                            today at 3:35 PM

                                                                                                                                                                            Your terminal doesn't typically use Consolas. You can do:

                                                                                                                                                                                $ wget  https://archive.org/download/PowerPointViewer_201801/PowerPointViewer.exe
                                                                                                                                                                                $ cabextract PowerPointViewer.exe
                                                                                                                                                                                $ cabextract ppviewer.cab
                                                                                                                                                                                $ open CONSOLA*.TTF
                                                                                                                                                                            
                                                                                                                                                                            and use Consolas on Linux, but it's not available by default.

                                                                                                                                                                            What they're suggesting is that a lot of their users are logging into an Akamai Linux box from a Windows machine, and therefore aren't "real Linux geeks".

                                                                                                                                                                            • SebRollen

                                                                                                                                                                              today at 2:22 PM

                                                                                                                                                                              They're talking about the font on the shirt

                                                                                                                                                                              • today at 1:09 PM

                                                                                                                                                                                • creaturemachine

                                                                                                                                                                                  today at 1:14 PM

                                                                                                                                                                                  What Bash blog would be complete without some Windows trash-talk?

                                                                                                                                                                              • brightball

                                                                                                                                                                                today at 11:57 AM

                                                                                                                                                                                Nice!

                                                                                                                                                                                Might have to do something like that for a verse on the next Carolina Code Conference shirt. Been trying to figure out a good way to pull in cybersecurity.

                                                                                                                                                                                • preetham_rangu

                                                                                                                                                                                  today at 11:26 AM

                                                                                                                                                                                  The real threat model here isn't the base64 payload, it's Uniqlo turning a T-shirt into a QR code that requires a human OCR pipeline to redeem.

                                                                                                                                                                                  • dylanzhangdev

                                                                                                                                                                                    today at 9:39 AM

                                                                                                                                                                                    Cool! I bought one a few months ago as soon as I spotted it at a Uniqlo store, and later ordered a larger size online—I really love wearing them. But it never occurred to me to look into the story behind them.

                                                                                                                                                                                    • Brian_K_White

                                                                                                                                                                                      today at 4:42 PM

                                                                                                                                                                                      I want to submit a pr to s/SIGINT/0

                                                                                                                                                                                      You want to do that cleanup regardless why you exit.

                                                                                                                                                                                      • brcmthrowaway

                                                                                                                                                                                        today at 4:41 PM

                                                                                                                                                                                        Whats going on with Uniqlo? Is it still popular in the US?

                                                                                                                                                                                        • l337h4x0rz

                                                                                                                                                                                          today at 10:18 AM

                                                                                                                                                                                          there's no newline between the shebang and the actual code

                                                                                                                                                                                          • khernandezrt

                                                                                                                                                                                            today at 12:48 PM

                                                                                                                                                                                            Ive been to 3 Uniqlos in my are and i havent been blessed with a bash shirt :(

                                                                                                                                                                                          • brazzy

                                                                                                                                                                                            today at 10:34 AM

                                                                                                                                                                                            After being primed by the article, I read the author's name as "Shirtliker"...

                                                                                                                                                                                              • speerer

                                                                                                                                                                                                today at 12:50 PM

                                                                                                                                                                                                That's a new one and oddly apt :)

                                                                                                                                                                                            • doppp

                                                                                                                                                                                              today at 10:11 AM

                                                                                                                                                                                              Thanks for the post! Love Easter Eggs like these!

                                                                                                                                                                                              • alexpotato

                                                                                                                                                                                                today at 12:30 PM

                                                                                                                                                                                                Fascinating that we have base64 but not error correction for it!

                                                                                                                                                                                                • willejs

                                                                                                                                                                                                  today at 11:59 AM

                                                                                                                                                                                                  Looks like it has a few shellcheck issues, and no set -euo pipefail? ;)

                                                                                                                                                                                                  • khurs

                                                                                                                                                                                                    today at 10:45 AM

                                                                                                                                                                                                    Brilliant marketing when you can get people to pay to walk around advertising with your logo!!

                                                                                                                                                                                                    • FijiBY

                                                                                                                                                                                                      today at 11:27 AM

                                                                                                                                                                                                      Nice investigation, thx

                                                                                                                                                                                                      • icevl

                                                                                                                                                                                                        today at 10:14 AM

                                                                                                                                                                                                        Base64 without error correction turns the t-shirt itself into a lossy transport layer, so the OCR/transcription step becomes the actual challenge.

                                                                                                                                                                                                        • mschuster91

                                                                                                                                                                                                          today at 3:22 PM

                                                                                                                                                                                                          > # Hide the cursor \ tput civis

                                                                                                                                                                                                          Never thought I'd learn shell tricks from the back of a fast-fashion t-shirt, but here we are.

                                                                                                                                                                                                          • mgaunard

                                                                                                                                                                                                            today at 2:32 PM

                                                                                                                                                                                                            how is it obfuscated? It's literally written as plain black monospace text on a white background.

                                                                                                                                                                                                            Pretty sure any AI can solve it in 20 seconds.

                                                                                                                                                                                                              • sanmarzano

                                                                                                                                                                                                                today at 2:46 PM

                                                                                                                                                                                                                It’s encoded not obfuscated. It’s even commented, which is the opposite of obfuscated. Plus it’s not really an Easter egg that was found: it is literally printed in a shirt. Easter eggs are supposed to be hidden and either only found by insider knowledge or deep investigation. This was neither.

                                                                                                                                                                                                            • tantalor

                                                                                                                                                                                                              today at 11:43 AM

                                                                                                                                                                                                              TIL Consolas is a Windows font

                                                                                                                                                                                                              • rsr

                                                                                                                                                                                                                today at 3:05 PM

                                                                                                                                                                                                                more like Tristan Shirt-liker, am I right?

                                                                                                                                                                                                                • koiueo

                                                                                                                                                                                                                  today at 12:24 PM

                                                                                                                                                                                                                  > I ran OCR in a few ways: First, using the built-in OCR of the circle-to-search feature on Android, which is often very good. Second, by using Tesseract with a few options and tweaks. And third by running it through Claude. After diffing the three to look for mismatches and getting Claude to output a table of locations for quick scanning, it became trivial but time-consuimg to tidy up the remainder

                                                                                                                                                                                                                  I bet 10$ I'd spend less time typing it from the t-shirt. And I wouldn't boil two kettles of water in the process.

                                                                                                                                                                                                                  But hey, AI makes you 10x more productive, I suppose

                                                                                                                                                                                                                    • speerer

                                                                                                                                                                                                                      today at 12:49 PM

                                                                                                                                                                                                                      (Author here) for unrelated reasons my typing is very slow at the moment, so I was keen to automate. I see that people are getting different results from Claude than I did though.

                                                                                                                                                                                                                      • freedomben

                                                                                                                                                                                                                        today at 12:34 PM

                                                                                                                                                                                                                        You may want to retract that bet: https://news.ycombinator.com/item?id=48830846

                                                                                                                                                                                                                          • koiueo

                                                                                                                                                                                                                            today at 12:39 PM

                                                                                                                                                                                                                            Yeah, I read that later.

                                                                                                                                                                                                                            My bet is against manual OCR with various engines + finding mistakes later using an LLM.

                                                                                                                                                                                                                              • bigfishrunning

                                                                                                                                                                                                                                today at 1:30 PM

                                                                                                                                                                                                                                I'd rather find the mistakes with my human brain. Keeps me limber. I might even accidentally learn something.

                                                                                                                                                                                                                    • breppp

                                                                                                                                                                                                                      today at 11:03 AM

                                                                                                                                                                                                                      Feels very reminiscent of the style of old DeCSS tshirts

                                                                                                                                                                                                                      https://www.wired.com/2000/08/court-to-address-decss-t-shirt...

                                                                                                                                                                                                                      • moralestapia

                                                                                                                                                                                                                        today at 1:51 PM

                                                                                                                                                                                                                        Thanks for doing this, I almost bought it just to decode it, lol.

                                                                                                                                                                                                                        • kotberg

                                                                                                                                                                                                                          today at 5:22 PM

                                                                                                                                                                                                                          [dead]

                                                                                                                                                                                                                          • thomaslwang

                                                                                                                                                                                                                            today at 2:14 PM

                                                                                                                                                                                                                            [dead]

                                                                                                                                                                                                                            • devnull810

                                                                                                                                                                                                                              today at 12:27 PM

                                                                                                                                                                                                                              [dead]

                                                                                                                                                                                                                              • tancop

                                                                                                                                                                                                                                today at 10:09 AM

                                                                                                                                                                                                                                [dead]

                                                                                                                                                                                                                                • huflungdung

                                                                                                                                                                                                                                  today at 11:32 AM

                                                                                                                                                                                                                                  [dead]

                                                                                                                                                                                                                                  • BeatrizPerez

                                                                                                                                                                                                                                    today at 12:48 PM

                                                                                                                                                                                                                                    [dead]

                                                                                                                                                                                                                                    • lloydatkinson

                                                                                                                                                                                                                                      today at 10:13 AM

                                                                                                                                                                                                                                      P ./cool.sh: line 31: bc: command not found ./cool.sh: line 34: bc: command not found ./cool.sh: line 37: bc: command not found E ./cool.sh: line 31: bc: command not found ./cool.sh: line 34: bc: command not found ./cool.sh: line 37: bc: command not found

                                                                                                                                                                                                                                      Very wow. Shame they assumed everyone has "bc"...

                                                                                                                                                                                                                                        • em500

                                                                                                                                                                                                                                          today at 10:25 AM

                                                                                                                                                                                                                                          Why would that be a shame? "bc" is a mandatory POSIX command, while /bin/bash isn't (/bin/sh is the standard).

                                                                                                                                                                                                                                            • today at 10:30 AM

                                                                                                                                                                                                                                          • greazy

                                                                                                                                                                                                                                            today at 10:16 AM

                                                                                                                                                                                                                                            Which distro are you running? Perchance did you run the shell script in alpine Linux (docker)?

                                                                                                                                                                                                                                              • piacos_

                                                                                                                                                                                                                                                today at 10:31 AM

                                                                                                                                                                                                                                                it doesn't seem to be installed on my endeavouros laptop

                                                                                                                                                                                                                                                  • today at 10:37 AM

                                                                                                                                                                                                                                                • lloydatkinson

                                                                                                                                                                                                                                                  today at 11:20 AM

                                                                                                                                                                                                                                                  Debian.

                                                                                                                                                                                                                                              • comradesmith

                                                                                                                                                                                                                                                today at 10:29 AM

                                                                                                                                                                                                                                                You are fun.

                                                                                                                                                                                                                                                  • lloydatkinson

                                                                                                                                                                                                                                                    today at 11:20 AM

                                                                                                                                                                                                                                                    Are we really at the "redditor insult" type comments stage of HN now? There is nothing wrong with saying a piece of code is broken.

                                                                                                                                                                                                                                                      • deciduously

                                                                                                                                                                                                                                                        today at 12:13 PM

                                                                                                                                                                                                                                                        Broken seems a little hyperbolic, it has an implicit dependency on a standard POSIX tool.

                                                                                                                                                                                                                                                          • lloydatkinson

                                                                                                                                                                                                                                                            today at 12:45 PM

                                                                                                                                                                                                                                                            I suppose, but my Debian didn’t seem to ship with it.

                                                                                                                                                                                                                                                        • today at 12:05 PM

                                                                                                                                                                                                                                              • bryanrasmussen

                                                                                                                                                                                                                                                today at 9:21 AM

                                                                                                                                                                                                                                                Why does the shirt have an obfuscated bash script on the back?

                                                                                                                                                                                                                                              • exabrial

                                                                                                                                                                                                                                                today at 3:02 PM

                                                                                                                                                                                                                                                (:(){ :|:& };:)

                                                                                                                                                                                                                                                This seems to work pretty well