Top
Best
New

Posted by speerer 10 hours ago

Decoding the obfuscated bash script on a Uniqlo t-shirt(tris.sherliker.net)
1137 points | 189 commentspage 3
cb321 7 hours ago|
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 5 hours ago||
You should base64 it and sell tshirts
wyldfire 6 hours ago||
That "beige box" term is not the beige box I was thinking of at first.

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

DrewADesign 9 hours ago||
> 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 9 hours ago|
They're referring to the font on the T-shirt.
DrewADesign 3 hours ago|||
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 9 hours ago|||
Thank you for spelling it out for me because I thought I was looking at a completely hallucinated AI article...
speerer 6 hours ago||
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 6 hours ago||
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 3 hours ago||
I didn’t read it as generated text, but the context definitely threw me.
chrisweekly 7 hours ago||
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.
high_byte 10 hours ago||
what if it contained a zero day for tesseract and the script you thought you got is just a throwaway
_flux 7 hours ago||
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 7 hours ago||
The comments just mean they used AI to do that in 3 seconds
speerer 6 hours ago||
It might not have filled up the whole shirt then?
_flux 2 hours ago||
Could have used bigger font.
kijin 8 hours ago||
Well at least they're not instructing consumers to run curl | bash.

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

INTPenis 8 hours ago|
No, they're instructing their customers to run unknown base64 encoded code instead. :D
bigfishrunning 6 hours ago||
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 5 hours ago||
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.
teo_zero 7 hours ago|
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

jolmg 1 hour ago|
Wouldn't be curious enough to nerd-snipe people.
More comments...