Lurker News
Cursed hacks, forcing proprietary software to do what you want through clever means, or just generally doing awful, beautiful things with technology?

Comments (499) 174 threads

Earlier comments
omgbear1 reply#
I built a vacation plant waterer with some tubing, 3d-printed heads, submersible pumps and an Arduino. For a longer trip, I needed a source of water that I could pump from.

I realized the toilet tank is self-refilling because of the float valve and won't overflow . So clean it out and a good place to pump my submersible pumps.

myself2481 reply#
Oh this is genius. That might just be my new humidifier hack.
moozilla1 reply#
FYI you shouldn't use anything other than DI water in humidifiers. Using tap water can cause bacterial/fungal buildup and emits harmful particulates into the air.

https://dynomight.net/humidifiers/

stormking1 reply#
The risk of bacterial infection is overblown. But you still don't want to use tap water for a humidifier because you'll get limescale all around the device.

Continue this thread — 1 reply

nomilk5 replies#
Mine's getting command output out of docker. For long builds (I had one that took 4 hours), it was gutting to have it fail a long way in and not be able to see the output of the RUN commands for thorough debugging.

So I devised a stupidly simple way: add && echo "asdfasdfsadf" after each RUN command. I mashed the keyboard each time to come up with some nonsense token. That way, docker would see RUN lines as different each time it built, which would prevent it using the cached layer, and thus would provide the commands' output.
I wrote the same thing (more completely) here: https://stackoverflow.com/a/73893889/5783745
(a comment on that answer provides an even better solution - use the timestamp to generate the nonsense token for you)
As stupid as this solution is, I've yet to find a better way.

sopooneo1 reply#
I'm a Docker amateur, so this will be a dumb question, but if you were using that technique after every run line in a DockerFile, wouldn't they be the same every time they're run? Like, it's random, but it's the same random values stored in the file, so wouldn't the lines get cached? Or did you adjust the DockerFile each time?

Or am I completely missunderstanding?

nomilk#
> Or am I completely missunderstanding?

No, I just didn't explain it very well. You have to mash the keyboard each time (i.e. each build) to come up with some new token. The reason this (dumb) idea was so useful was it was a choice between that (dumb idea) and either run with --no-cache (i.e. wait 2-3 hours) or build normally and not have a clear idea why it failed (since no console output for cached layers), so taking a moment to mash the keyboard in a few places (as absolutely stupid as that is) was way better than the alternative of not having complete console output (docker provides no way to --no-cache on a per layer basis, hence my stupid way of achieving it).

hyperhopper1 reply#
Why cant you echo a newly generated guid?
nomilk#
I had tried && openssl rand -base64 12 but docker assumes if the command hasn’t changed (even though it generates a new random value) then it can rely on the cache for that layer. A comment below the answer on stack overflow points out you could do the same thing using an environment variable (with guid or datetime to ensure no duplicates), that’s a nice approach
jddj#
This reminded me of an ongoing hack that I have running in a production webapp.

When I was writing it there was no easy opt-in cache busting (renaming scripts at build time, or applying a static random querystring to the script requests, etc) in the minimal framework I was using and I was getting away with not using a task runner or anything like that.
It was one of those "would be nice, but effort is better spent elsewhere" things, so to this day before I do releases I still bump a hardcoded version number that I pass to the templating engine for each route.
I should fix that.

sim7c00#
a lot of my debugging involves just echo or print 'hello-N' tokens. some systems just need this :D love it. "hello-9". yay it almost worked xD.
arccy1 reply#
consider --progress plain ?
nomilk#
That's definitely part of the solution, but alone it will get output only for uncached layers. The && echo "lakjdflkjsdf" hack above tricks docker into thinking that layer isn't cached (since, technically, it has changed and hence should be re-run). Otherwise, even with --progress plain, it will not re-run a previously run (cached) layer and hence not provide any console output.
bonton89#
I used to be really into modding the game Jedi Knight: Dark Forces II. The quirky engine has all sorts of weird bugs and limitations.

I created a flare gun weapon (similar to the stick rail gun missiles so nothing to crazy here) but found that if a player died when they respawned the flares were still stuck on them and damaging them when they respawned even though their whole location had changed. This bug would exist with rail gun missiles as well but since the death animation was long and the fuse so sort it would never present in the base game.
I experimented with using detach commands that ran on player death but they'd just instantly reattach to the player model because of their proximity. I ended up creating an invisible explosive entity that fired on player death from the center of the player which did a damage flag ignored by players but which destroyed the flares.

trws#
Running the largest workload I’ve ever personally launched (4,200 nodes, 144 cores each, 16,000 simultaneous jobs with a mix of one 1,000 node cpu job, 1 AI selection service on one node, about 3,200 nodes worth of 4-core cpu input pre-processing jobs and 4 GPU jobs per node co-located with all the CPU stuff) at 2am the day of the deadline for something about 50 of us had been working on for most of a year, realizing something was set wrong in the launcher. It was our last chance for a full run, we couldn’t start it over or try again, and it was going to fail because of a single runtime value.

I attached gdb to the launcher, “print =” and detached. The run started going about 10 times faster and we got the whole thing done. Crazy, dangerous, but it worked.
Question also made me think of the last-minute change we needed to make to a database’s structure to avoid about 6 million lost user updates when all DB admins were out with no password. That was a fun one too. Not sure I should admit how we managed it.

Load more comments