Live data from Hacker News

Ask HN: What's your proudest hack?

news.ycombinator.com

251–260 of 414 posts

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

#251

i just told this story earlier today on HN! It's something I did just in the past few days, but it is quite satisfying. My site has recently been the target of some extremely aggressive "card testers" (criminals who have huge lists of stolen credit cards; they use bots to stuff small donations into donation forms to test which cards are still working). At first I just blocked the offending IPs, but they kept finding…

Good one. At first I didn't get how this worked, but then I figured you run a donation site. One idea for you: if you can distinguish the illegal card validation attempts from 'normal', keep them - card companies pay for up-to-date pools of stolen card numbers to weed out the fraudsters from thei stream of transactions. Though this potentially violates PCI-DSS.

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

#252
Still recall the fun I had building the hardware and code to use a 45-baud teletype machine as a console for a 110-baud ASCII computer. Each direction needed a code conversion and a speed conversion. Hardware port access was simple and wide open. (And the baudot could come from any source, not just the teletype. Off the air! Baudot pictures! Save to tape instead of paper!)

A helluva lot more rewarding tweaking wide-open custom hardware than making adjustments to uBlock.

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

#253
Shared a house with some friends in college and we found a bug in a local Pizza place's site to stack coupons and get huge pies that were normally like $30 for $5, basically really good fancy pizza for cheaper than dominos. Really a blessing and a curse since it became breakfast, lunch, and dinner since it was hard to justify buying anything else.

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

#254
About 10 years ago, I worked for a Toyota supplier. My job as, the only software guy in a house full of hardware people, was to find out every single Toyota and Lexus dealership in America, and then find out what kind of cell phone reception they had (3G, Edge or none) for each of the major carriers (AT&T, T-Mobile and Verizon, IIRC). They imagined this would be done manually so they estimated a few weeks to do the job.

Within 3 days, I wrote a script to locate the dealerships, load each of the carriers' web pages, enter the address/coordinates into their coverage map, then take a screenshot of the results. Each of the carriers, of course, had their own way of displaying the coverage information, but it was mostly a color-coded map (example: green area = 3G, blue area = edge, gray area = no reception). So, I wrote another script to process the screenshots and deduce what kind of reception they had at the dealership (some 3500 in total, if I remember right).

Unfortunately, this feat was met with the proverbial "great, while you're fixing things can you also fix the printer" kind of response, but damn if I wasn't proud to compress a few weeks into 3 days in a clever way, even if I had no one to appreciate it.

By the way, the reason we needed this information is because we were rolling out Lexus RES+ (an early version of the remote engine starter) and they wanted to make sure that every single one of the dealerships could demo the service to potential customers.

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

#255
My first company's primary product was a CMS-like system that integrated with some archaic backends for inventory management. The CMS was likewise relatively barebones and inflexible. Most of the pages involved placing a selection of widgets that could query backend data in fixed ways into fixed positions on one of a handful of templates.

We got a client whose brand and web presence was relatively more-modern. I soon found out that the sales and design teams landed the client by promising much more than what the CMS could deliver-- responsive, hand-tooled pages with flexible layouts. The timeline was a few weeks.

I took a walk and despaired. The way that CMS pages were implemented meant that even small changes to page layouts required database changes, which themselves required DBA review (which only happened when the DBAs deigned to descend from the mountaintop). There was no way that we could also support arbitrary layouts with the fixed database columns.

An idea finally came to me and I found one of the only backend devs that was willing to play along. We reused one of the existing templates, a simple one with only one large content area. I wrote a frontend that injected itself into that page and rendered a canvas with slots to place arbitrary widgets. The entire configuration was then JSON-encoded and stuffed into the single text database column, and when the page was loaded from the CMS we hijacked the load to decode the config and render our widgets instead of the CMS field.

The company actually won an award for the system and gave out beer steins at the holiday party with the system's branding on it. Over the next few years, they retooled the entire CMS to actually support the concept as a first-class idea instead of my hack, although I moved on fairly shortly after that moment of triumph.

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

#256
In my first job I work on a database product in development that leaked memory slowly, leading to crashes after hours of usage. The software was written in C and there were no tools like Purify or Valgrind back then to deal with memory problem. It was a vexing problem that got punted until release time, when it became a show stopper.

I looked into the problem and found that the memory allocation used malloc and free. I then defined macros for malloc and free in a common header to call my_malloc and my_free functions with the standard __FILE__ and __LINE__ macros passed in as parameters. Re-compiled the whole program with the macros, which redirected every call of malloc and free to my functions. My functions logged all the calls with the allocated memory pointer, the filename, and the line number. Once I collected enough log data from test runs, I sorted the lines in the log file by the memory pointer address. Every pointer address should come in pair, one from the malloc() and one from the free(). The odd number pointer addresses are the ones with missing free(). And I got their filename and line number right there.

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

#257
post #174

Earlier quoted context omitted.

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.

Good point.

I suppose what I meant to say is you need to communicate between processes somehow. Shared memory is fast, but it's hard to communicate with it exclusively - message-based protocols are better suited for that, and most of them are implemented over TCP.

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

#258
I hosted a server, in my bedroom back in the late 90s. By server, I mean a desktop running Slack, connected to the internet and allowing me to SSH into it. It could recover just fine from a power outage, but unfortunately due to a RAM issue it would just randomly die - and RAM just wasn't something the local computer store was ready to bring in.

Enter my Lego Mindstorm. I effectively built a box, on wheels with a big thick stick pointing out I loaded that guy up with NQC - built a small application for my Palm Pilot. The modem on the palm pilot would pick up, accept a certain DTMF code, and fire via the infrared port a signal to the Mindstorm. The Mindstorm rolled forward X revolutions of the wheels so that the long arm hit the reboot button, rolled back.

Yes, eventually I bought RAM, but that eliminated all the fun.

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

#259
In 1997, I had to convert a legacy unix (SCO System V?) application's comms from X.25 to tcp/ip. Had the source code, but it was a weird case of the system you built it on didn't have a networking stack (or was somehow massively different that it was a pain to build and now unsupported) and while I'd written some basic networking bits (some telnet utils etc) in C on windows, but felt like this was a bit of a stretch of my skills/abilities.

Anyway, after playing around with different flavours of linux, I ended up with a rather simple solution that ended up being easy to install. Essentially it was a two line script that piped the serial port to the destination server IP address, and inbound tcp/ip piped to the serial port.

So just plugging this little (old school) 486 box in-between the serial port on the legacy system and an RJ-45 connector which plugged into the 'corporate' network and we not only had an upgraded comms layer, but we now had remote system management, which we never had before.

Think it saved $250k+ minimum replacement at next to no cost. Just me barrelling up and down the country installing the new hardware. Was a fun project in the end and started me down the linux appreciation route.

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

#260
I was pretty proud of some software hacks I did in the early years of my career, but later came to the conclusion that it's always better to avoid using such tricks.

I'd still use them if there just was no other way - or if I needed a time-critical band-aid that stops the bleeding for now, while I work on a proper fix. But these days I feel more ashamed rather than proud afterwards...

Post reply on HN