"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.
olooneytoday at 1:21 PM
If you enjoy this kind of thing, you might also like Martin Kleppe's work, such as the Quine Clock:
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.
wbh1today 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
Tiberiumtoday 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 :)
world2vectoday 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.
mk_stjamestoday 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.
nicotoday at 2:35 PM
Very cool. It reminded me of the DeCSS t-shirts, which had source code with the decryption keys for DVDs
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
chrysopracetoday at 11:20 AM
My old colleague had one with a Go program[0] which I always thought was quite cool.
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.
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.
9devtoday 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:
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`.
thenthenthentoday at 3:26 PM
My japanese friends say: yes because uniqlo is a science company not a clothing company
sixtyjtoday at 11:58 AM
> Interesting. I told my wife "thatās basically how people ship virusesā and bought it.
Itās a movie plot.
NikxDatoday 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 :)
cb321today 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
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.
DrewADesigntoday 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?
_fluxtoday 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.
teo_zerotoday 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
high_bytetoday at 9:26 AM
what if it contained a zero day for tesseract and the script you thought you got is just a throwaway
felineflocktoday at 2:24 PM
Phew! I was hoping it was not a novel way of spreading a malicious script!
kijintoday 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.
shim__today at 11:42 AM
Could have saved 50% with 'base64 -d | gzip -d'
brightballtoday 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.
Gabrys1today at 1:03 PM
I don't understand the font bit. This is a terminal script, it uses the font that your terminal uses?
luciana1utoday 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.
preetham_rangutoday 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.
dylanzhangdevtoday 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.
l337h4x0rztoday at 10:18 AM
there's no newline between the shebang and the actual code
busymom0today 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
khernandezrttoday at 12:48 PM
Ive been to 3 Uniqlos in my are and i havent been blessed with a bash shirt :(
brazzytoday at 10:34 AM
After being primed by the article, I read the author's name as "Shirtliker"...
Brian_K_Whitetoday at 4:42 PM
I want to submit a pr to s/SIGINT/0
You want to do that cleanup regardless why you exit.
doppptoday at 10:11 AM
Thanks for the post! Love Easter Eggs like these!
brcmthrowawaytoday at 4:41 PM
Whats going on with Uniqlo? Is it still popular in the US?
alexpotatotoday at 12:30 PM
Fascinating that we have base64 but not error correction for it!
khurstoday at 10:45 AM
Brilliant marketing when you can get people to pay to walk around advertising with your logo!!
willejstoday at 11:59 AM
Looks like it has a few shellcheck issues, and no set -euo pipefail? ;)
FijiBYtoday at 11:27 AM
Nice investigation, thx
icevltoday 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.
mschuster91today 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.
mgaunardtoday 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.
tantalortoday at 11:43 AM
TIL Consolas is a Windows font
rsrtoday at 3:05 PM
more like Tristan Shirt-liker, am I right?
koiueotoday 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
breppptoday at 11:03 AM
Feels very reminiscent of the style of old DeCSS tshirts
Thanks for doing this, I almost bought it just to decode it, lol.
thomaslwangtoday at 2:14 PM
[dead]
kotbergtoday at 5:22 PM
[dead]
devnull810today at 12:27 PM
[dead]
tancoptoday at 10:09 AM
[dead]
huflungdungtoday at 11:32 AM
[dead]
BeatrizPereztoday at 12:48 PM
[dead]
lloydatkinsontoday 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"...
bryanrasmussentoday at 9:21 AM
Why does the shirt have an obfuscated bash script on the back?