Live data from Hacker News

Ask HN: What's your proudest hack?

news.ycombinator.com

171–180 of 414 posts

Re: Ask HN: What's your proudest hack?

#172
I moved back to Texas from college without any job prospects and found myself living in my car, relying on Walmart Wi-Fi for internet access.

So, I resorted to a few low-quality hacks.

The first was a QR Code parking app. It worked by just placing a qr code on public parking meters. I marked up the parking from like from 50 cents to a dollar. I kept 50 cents and payed for the parking through the official app with mitmproxy. Someone eventually reported it.

I had to ask my dad for help reimbursing the city—which he was not too happy about.

The second hack of a washing machine was disclosed properly, although no firmware patch was ever released.

[1] https://news.ycombinator.com/item?id=29814973

[2] https://shakey.blot.im/reverse-engineering-a-popular-laundry...

Re: Ask HN: What's your proudest hack?

#174

Earlier quoted context omitted.

Single machine ... RabbitMQ. Using jpg for events locally. Using jpg for computer vision. I think I see the problem, it's this entire thing.

Most USB cameras send JPEG frames because USB 2.0 isn't nearly enough to support raw frames: 60 frames/second * 1920*1080 pixels/frame * 4 bytes/pixel = ~475MiB/s, while maximum USB 2.0 bandwidth is ~60MiB/s. You also don't want to store raw frames on the cloud storage, your bill would skyrocket. Those are some of the reasons for using JPEG. If you're using dockerized services (which are a must for NVidia-based CV, s…

> If you're using dockerized services (which are a must for NVidia-based CV, since their CV libraries are a dependency hell), you must use some kind of networking solution to communicate.

Eithen the two processes can share memory, in which case they don't need to communicate via network, much less RabbitMQ, or they can't, in which case the hack wouldn't have worked at all.

Re: Ask HN: What's your proudest hack?

#176
I was just curious if I could improve our PHP-based site’s performance. So I attached strace to an Apache process and followed the log of syscalls and counted milliseconds between them. Sure enough, I discovered that 20 ms was being spent each time on a DNS lookup to a statsd metrics collector service over UDP (I remember being told that this was lightweight, since it was UDP). PHP didn’t cache DNS lookups and this was sometimes happening many times per request. I added a static entry in /etc/hosts and the overall latency improved by 30% across all endpoints.

Another hack: I once was consulting for a client who was running Drupal and was going to launch their new site the next day, but suddenly it started crashing on some of the pages. I found out that you can take a core dump of Apache and load it into gdb. Then if you run some gdb macros, you can see the PHP stack trace at the time the crash occurred. Turns it it was some module (tokens?) they had recently enabled which was recursively calling into itself. Not sure why it didn’t hit some stack limit, though. We disabled the module, which fixed it and the client was super happy. If I knew more about Drupal, I probably would have disabled modules in a form of binary search as a first troubleshooting step. But I did know a little about gdb, so that came in handy.

Re: Ask HN: What's your proudest hack?

#178
WinNT 4 days, default permissions for windows/system32 were wide open. Replace default.scr with a copy of cmd.exe.log off and wait... Boom command prompt running as System. Easiest way without debug/admin permissions to get a copy of the windows PAM file. Think it may have still worked under Win2k. Eventually they stopped running Screensavers as the system account...

Re: Ask HN: What's your proudest hack?

#179
post #19

Not that hacky or mind-boggling, but does involve a hex editor and lots of money... I added support for the '\ ' PostScript escaped space sequence to a custom, high-performance PDF parser. A former employer used this to derive key figures from financial statements. Any change to the parser had to be Pareto-optimal: so if you modified the parser, it should not fail to parse any key figure that was previously possible…

> but does involve a hex editor

Oh, your comment reminded me of one of my proudest moments as a high school student!

Norton Utilities was a must for any MS-DOS user, and so, poor students pirated it when they could. The problem was once installed, it asked for a password, and subsequent runs would demand it. My friend got ahold of a diskette with a complete but password-locked copy, and while he knew the password, he found it annoying and wanted to bypass it.

By trial and error, we found a location where the binary stored the password, but it was encrypted. Studying the "encryption", it turned out it was an XOR of the password padded with spaces until I think 20 characters, so you could change that location to XORed spaces to enter the password with a single Enter, or change it to zeros so it behaved like a new install.

I don't know what my friend did with his copy, I just remember the high of beating the copy protection of the legendary Peter Norton.

Re: Ask HN: What's your proudest hack?

#180
About 15 years ago, my brother used to run a shoutcast (Internet radio) server. He wasn’t getting many listeners since the list of stations people browse was sorted by popularity - number of listeners. So I disassembled and then hexedited the shoutcast server binary so that the initial number of listeners was 60-something (which meant the listener count would never drop below that). Then he actually started getting a few listeners :)
Post reply on HN