Live data from Hacker News

Ask HN: What's your proudest hack?

news.ycombinator.com

61–70 of 414 posts

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

#61

Earlier quoted context omitted.

Lol yeah it definitely felt shady. My attorney said it was legal but they could probably bankrupt me with legal fees if they wanted to. I thought of it the same as any type of reward people like to find ways to take advantage of (miles, cash back, etc) and I just found a loophole that was pretty high friction so kind of off the radar (friction = I had to buy an ATM!).

Did you just cycle the money in the machine, or did the cycle somehow involve taking a bunch of cash, depositing it in your checkings account, getting new cache delivered by courier, put it through the money machine, repeat... or a tighter loop I can't grasp how it would work with your account?

It was a lot of logistics with physical cash. But yeah I tried to run it as close to "real" as possible in case I did hit legal issues (isolating the entities, not comingling funds). Also, had to make sure for taxes that the cycled cash wasn't possibly viewed as income to either entity. There were a few optimization steps I found that helped me streamline the logistics but I still was withdrawal-ing cash from the ATM business account daily. To start the cycle over again.

I kept a small amount in the consumer accounts. Maybe $300-500. The cash took 2-3 days to do the loop if I recall. And this allowed me to keep do multiple $20 withdrawals each day on each account.

It got big enough that I employed someone to sit at the ATM and make transactions. Then I bought 2 more ATMs so they could multitask / reduce idle time during the 1 minute it took for the machine to process and dispense.

I stopped it when I realized the numbers were getting kind of big and a few banks had caught on and closed my accounts. Then because of the physical cash, I was worried about getting robbed. I was getting very paranoid about the whole thing and decided to wrap it up. I remember meeting a few times with attorneys during it to get varying opinions. Over time, the advise turned into "we think it's legal, but you should really stop it".

There was also another smaller but pretty invisible loophole I found with interchange. I could set the surcharge to $0 and so long as the cardholder bank didn't charge "foreign ATM fees" then I'd make about $0.50 per transaction. Much smaller, but order of magnitude more banks offer this feature versus the surcharge rebate feature. The surcharge and the rebates were line items on the bank statements. So, any person at the bank that looked at my account could see the fees and that it was costing them money. With this hack, there was no line item on my bank accounts (only the amount withdrawn). So it looked like the ATM owner did not benefit at all. But, in the background the ATM owning entity received ~$0.5 per transaction of interchange fee.

It sounds stupid, but at the time, my idea was to test this out and then sell a 'get rich quick' style ebook explaining how it works.

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

#62
We had a very large monorepo at my previous company and building Docker images required us to set the context at the root of the directory (libraries, protos and helpers scattered around the repo). On macOS this is extremely slow as Docker copies the context into the daemon. This used to take several minutes.

Fortunately, we also used Bazel. So I created a custom Bazel rule that aggregates all the required files of a target/service then builds the Docker image within the Bazel sandbox which only contains the files we need. This massively reduced the context size and thus the image build time. From several minutes to single digit seconds.

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

#63
A bit of a different meaning of "hack".

I was working for a medical device company that shall remain nameless. They had a system that was used in operating rooms that had a fairly nice user interface - bubble keyboard, touch screen, good graphics. It let you input patient information and stuff. (At least part of it was running embedded Linux under the hood.)

In the source code, I saw what it did with the patient name - it used a call to system() to store it in a file. So naturally, I tried an injection attack. I put in "[Name]; sync; sync; reboot". Sure enough, it rebooted the system.

But before the reboot, it had also saved the "patient name" in the file (and, because of the "sync", it had been written out). On boot, it read the information from the file and tried to treat it like a newly-entered patient name, which caused it to reboot again...

We had to re-image the device to recover. We added some validation to user input after that little demonstration.

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

#64
I had a trackball (ploopy nano) that had no buttons, a keyboard that didn't support qmk, and a WM that didn't support mapping clicks to keystrokes, so I couldn't use my keyboard to send the proper scan codes for a 'click'.

I wrote a uhid driver that listens on a socket and a cli that sends click/release events to the driver so I could map left and right click in my WM.

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

#65

I've worked on a single-machine computer vision system which used RabbitMQ to send messages around, including JPEG frames which were rather heavy, in contrast to other messages. After we hit a certain number of frames/second, RabbitMQ became a bottleneck. My solution was to write the JPEG frame in the shared memory, then pass around shared memory ID, offset and frame length, instead of the whole frame. Only services…

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, since their CV libraries are a dependency hell), you must use some kind of networking solution to communicate. RabbitMQ might be considered overkill, but it does the job and is robust.

It's not nice to talk that way about others' work, especially when your comment insults, but doesn't provide any insight whatsoever.

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

#66
post #25

I've worked on a single-machine computer vision system which used RabbitMQ to send messages around, including JPEG frames which were rather heavy, in contrast to other messages. After we hit a certain number of frames/second, RabbitMQ became a bottleneck. My solution was to write the JPEG frame in the shared memory, then pass around shared memory ID, offset and frame length, instead of the whole frame. Only services…

What's really awesome about this is I think you independently discovered a huge trick in performance optimization. "Zero copy" solutions for eliminating the overhead of moving frames around are very popular - if you look up that term you'll see it pop up everywhere. Companies/teams of engineers spend months coming up with this solution and its a reliable way to reduce overhead of moving data around. It works across a…

Thanks :)

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

#67
Back in 1988 we used a Toshiba ‘286 laptop for programming something on the manufacturing plant floor. That laptop came with the useful Multisoft PC-Kwik Power Pak on 3.5” floppy disk.

I owned a generic ‘286 12 MHz DOS computer at the time. Since PC-Kwik was the Toshiba edition it would not run on generic ‘286. So I used DOS program Codeview, also on floppy, to find and successfully patch the code in the executable program that checked for identification as a Toshiba product. My very first reverse engineering experience.

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

#68
I worked on a messaging convergence product in the early 2000s. I'd written several components including the POP3 server. The product owner had a demonstration scheduled with a potential telco buyer. Two weeks out, we learned that having IMAP4 capability was critical for the client. IMAP4 was on our roadmap, but still twelve months away. The requirement was to demonstrate IMAP4 in two weeks, not to provide a finished IMAP4 implementation, but neither of the architects could see any way of delivering a demo.

I had a bright idea in the shower one morning, went to work and told our project manager that I could deliver an IMAP4 demo in two days. I explained how, the architects admitted it would work, so I knuckled down and wrote a new API for our POP3 server that understood and responded to high level IMAP4 requests (we didn't need to return message parts or anything more atomic that an entire body).

Of course, the day after we finished testing this, the product owner decided we wouldn't include it in the demonstration, but that's life.

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

#69
Around 1993 I had my tonsils out, which involved general anesthesia. Back then they administered a prep drug that put the patient in a weird dissociated awake state that I would describe as not realizing you're awake. This being my third time through the process (knee surgery, wisdom teeth, now tonsils), I tried really hard to maintain self awareness.

We'll, it sorta worked. In this state I somehow recognized that the device placed on my fingertip must be a blood sensor of some sort, and that squeezing my finger might mess with the readings. I made it through two rounds of setting off alarms before the nurses caught me. I was immensely pleased with myself!

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

#70

I often create screen recordings for my classes, but it's very boring and time consuming. I'm a perfectionist, and if I mistype a command I prefer to re-record everything. Moreover, every time one of the tools used in the videos gets a significant update, I feel compelled to redo the video. I have started using xdotool [1] to create bash scripts that send mouse clicks and keystrokes to apps. Interleaving calls to xdo…

We used something similar in 2008 at CeBIT (which was the biggest IT trade show in Germany at the time). A publishing house for IT magazines set up a side area for minibooths and gave them out to a dozen open-source projects. I was there with a bunch others to represent KDE. We only had a few posters and stickers, nothing fancy, so we had to make our booth flashy somehow. My friend quickly hacked together something with a similar input simulation tool that opened applications from the start menu, flipped through directories in Dolphin, and such, and set it up to run in a loop. It sure did help us catch people's attention.
Post reply on HN