Live data from Hacker News

Ask HN: Weirdest hack that you ever saw in production?

news.ycombinator.com

41–50 of 289 posts

Re: Ask HN: Weirdest hack that you ever saw in production?

#42

In my startup days, we were working on a proof of concept with a really big bank. Because of their security rules, we couldn't have direct access to their systems - so if we wanted to do something remotely, we would have to start a webex, they would join and share their screen, and give us remote control. This worked great, except if we wanted to work over the weekend, since if we left the screen alone for more than…

I use a posh script like this when i dont want the computer to lock. $ws = New-Object -COM wscript.shell; while($true){ $ws.SendKeys("j"); Sleep 60;} Ive used it for demos that way the computer doesnt lock before the demo starts, its pretty short and easy to remember. Also on windows if you spam SendKeys("{Left}") everything you type is backwards and when you hit the windows key it freezes the computer in an interest…

I used to use autohotkey to send an F13 key press every couple minutes to avoid lockout on a work computer where I wasn't allowed to increase the timeout

Re: Ask HN: Weirdest hack that you ever saw in production?

#43

Just recently I had to put together a web-based UI for editing vector graphics (clothing tags) and export them to pdf for printing. In order to avoid writing and maintaining two separate codebases, I re-used the client side code as my rendering code. So I ended up with a server serving the editor frontend, as well as api endpoints that would use puppeteer and headless chrome to make a request (to itself) to load the…

I’ve literally just helped someone do similar in their own product. If you run into issues with puppeteer’s blank or missing pages of a screenshot (for high-res images), just forgo that for canvases base64 export. It’ll save you a world of hurt!

Re: Ask HN: Weirdest hack that you ever saw in production?

#44

"Don't delete this comment or the production server will crash." Tried it, did as advertised. Apparently the website went through a proxy that reflected over the code, using that comment as a hook to inject some sort of functionality.

I've personally set this kind of thing up. Inherited an old PHP site for a webdev contract, and a couple weeks into development (before any of my code had made it to prod), the server starts hanging randomly, or spitting out seemingly random errors on every request.

I was told in no uncertain terms by the client that I had to fix the server hangs within 48hrs I'd lose the contract. This was in a million+ LOC custom Wordpress nightmare.

I wound up writing a script that ran on a little EC2.micro instance that would ping the homepage every 60s looking for the HTML comment ``, and if the request timed out or the text wasn't found it would hit their hosting API and reboot the server the site was running on.

I deployed the "fix", finished the contract without incident, and subsequently fired the client.

Re: Ask HN: Weirdest hack that you ever saw in production?

#45
Here's a late version of Encarta.

https://goo.gl/6uX4Qu

Do you see that plain-looking dropdown menu with the rounded orange highlights? That is Internet Explorer. Just this one menu. It's an in-process instance of Trident, IEs old HTML rendering engine. So that little window is the equivalent of somthing like chromium embedded. I don't know why that menu is an instance of IE's HTML renderer. Someone wanted to style it with CSS, I think. So they embedded IE. That flyout to the right is probably another Trident window. In order to meet accessibility requirements, I had to grab the running instance of the root IE COM interface, and route keyboard events into it. With raw C++ COM. There were other hooks going in the opposite direction so the menu / browser window could tell the app about clicks.

Re: Ask HN: Weirdest hack that you ever saw in production?

#46

The lingua franca of theatrical lighting control is a physical-layer protocol designed for custom cabling called DMX. Light boards emit an array of 512 values in the range [0,255] and dimmers, or lighting instruments themselves, interpret these values as parameters like intensity. For various reasons it's useful to carry this signal over an IP network, and proprietary standards to do so have proliferated. Light board…

Wow, this brings back memories of running the theater in my school. Definitely a different situation, but I like to think we did a good job given what we had.

We didn't really have a budget, just some hand-me-down equipment that came from above sometimes. I and others on my team put together so many hacks to make things work. One memorable time, our light board had broken, but we still needed to run shows.

We didn't have enough time to wait for shipping on a real USB->DMX adapter, nor budget for a new board, so I created a hacked together DMX adapter with a serial to USB adapter and a NAND gate (I put schematics together here, if anyone's interested: https://github.com/magmastonealex/DMXAdapters).

It worked remarkably well for being a bit of a hack, but paired with software like QLC+, had more features than our old light board! It was still in use for controlling special effect lighting when I left, though thankfully not for main lighting and day-to-day use.

Re: Ask HN: Weirdest hack that you ever saw in production?

#47
First job out of university and I had to fix a terrible crash that happens to our prod application every few hours running on Windows NT boxes. After lots of debugging and asking all the “senior” devs, no one knew a solution since it was all super old code. What I did notice, though, was the apps that I was debugging didn’t crash until I stopped debugging it.

Turns out that it was a memory issue and every time I minimized and maximized the app, part of the memory got cleaned up. So as a temporary fix, I just wrote a script to auto minimize/maximize the apps on all boxes until we found the memory leak.

Note: we never found the leak.

Re: Ask HN: Weirdest hack that you ever saw in production?

#48
post #27
post #7

Using the Google Sheets API to store session history and metadata for a nightly backfill job instead of, you know, a database. The program broke after the creator left and no one could figure out how to bring it back up. The engineer assigned to fix it pulled their hair out looking for the database creds, local SQLite3 records, anything that would initialize the backfill. Finally realized it wasn't just printing out…

Using Google Sheets instead of a proper database brings me nightmares.

I did this once. A client wanted a website that mimicked the functionality of a complicated spreadsheet that he had created to calculate quotes for customers and didn't have enough money to pay to have all the logic rewritten in a webserver (not to mention continually updated).

I imported the spreadsheet into google sheets, gave him access, and had the webserver paste the values in the spreadsheet via the google sheets api and read them back out.

Re: Ask HN: Weirdest hack that you ever saw in production?

#49
post #9

5F3759DF a.k.a. fast inverse square root [1] in graphics programming. [1] - https://en.wikipedia.org/wiki/Fast_inverse_square_root

I'd love to know who left those comments for Quake III Arena in your referenced Wikipedia article. I had a good laugh.

Re: Ask HN: Weirdest hack that you ever saw in production?

#50

Had a server that was overheating badly and the numerous fans just weren’t working. Need to keep it running to transfer all the data to a newer machine. Went to Walmart and bought flexible dryer ducting and duct tape. Vented the AC directly into the case. Got everything transferred without having to pull the backup (which is slow). Never did figure out the fan thing but something must have gone wrong on the motherboa…

I had a similar set up for a computer I overclocked to play games as a kid.
Post reply on HN