Live data from Hacker News

Ask HN: What's your "it's not stupid if it works" story?

news.ycombinator.com

111–120 of 510 posts

Re: Ask HN: What's your "it's not stupid if it works" story?

#111

I had a GCP Cloud Run function that rendered videos. It was fine for one video per request but after that it slowed to a crawl and needed to shut down to clear out whatever was wrong. I assume a memory leak in MoviePy? Spent a couple of days looking at multiple options and trying different things, in the end I just duplicated the service so I had three of them and rotated which one we sent video renders to and do eac…

Hah welcome to cloudrun! I was evaluating it a few years ago to host some internal corporate app.

It worked great and was way easier to deploy than k8s setups. However after some testing we found out that the core logic of the app - a long running process, would just crawl to a halt after some time.

It turned out google wanted to push you to use their (paid) queue / pubsub solutions, but they didn’t want it to be _too_ obvious, so cloudrun would actually throttle its cpu sometime after the request it was spawned was returned.

Our logic was based on pushing stuff in a queue and having it be processed outside of a request, but google just f*ked with that solution.

And it would have been fine if that was upfront info, but it was buried in a doc page somewhere obscure, small print…

Thats the time I realized how bad gcp can be…

Re: Ask HN: What's your "it's not stupid if it works" story?

#112
post #5

I had an old boiler that would sometimes trip and lock out the heat until someone went down and power cycled it. (It was its own monstrous hack of a gas burner fitted to a 1950s oil boiler and I think a flame proving sensor was bad.) Every time it happened, it made for a long heat up cycle to warm the water and rads and eventually the house. So I built an Arduino controlled NC relay that removed power for 1 minute ou…

I have a similar one. Our boiler has a pump to cycle hot water around the house - this makes it so you get warm water right away when you turn on a faucet and also prevents pipes in exterior walls from freezing in the winter. This stopped working, the pump is fine but the boiler was no longer triggering it. I just wired up mains through an esp32 relay board to the pump and configured a regular timer via esphome. Temp…

I'm thiiiiiiis close to installing a circulating pump. I plan to power it off the bathroom lightswitch, which I might just replace with a motion sensor.

Re: Ask HN: What's your "it's not stupid if it works" story?

#114

We have a production service running for years that just mmaps an entire SSD and casts the pointer to the desired C++ data structure. That SSD doesn't even have a file system on it, instead it directly stores one monstrous struct array filled with data. There's also no recovery, if the SSD breaks you need to recover all data from a backup. But it works and it's mind-boggingly fast and cheap.

Wow. How do design decisions get made that result in these types of situations in the first place?

Honestly it’s not too far off from what many databases do if they can. They manage one giant file as if it’s their own personal drive of memory and ignore the concept of a filesystem completely.

Obviously that breaks down when you need to span multiple disks, but conceptually it really is quite simple. A lot of the other stuff file systems do are to help keep things consistent. But if there’s only one “file“ and you don’t ever need metadata then you don’t really need that.

Very smart solution really.

Re: Ask HN: What's your "it's not stupid if it works" story?

#115

Around 16 years ago, Wordpress security was just not up to snuff yet, and my popular Wordpress-based site kept getting hacked by pharmaceutical spammers and the like. After several such incidents, I wrote a "wrapper" that loaded before Wordpress to scrutinize incoming requests before a lick of Wordpress code was executed. It had blacklists, whitelists, automatic temporary IP blocking, and that sort of thing. There wa…

When you say it loaded before Wordpress loaded, what exactly does that mean? Was it a proxy that handled incoming requests and passed them off to Wordpress?

Re: Ask HN: What's your "it's not stupid if it works" story?

#116
post #25

As a 12 year old: I tried to overclock my first "good" own computer (AMD Duron 1200 MHz). System wouldn't start at 1600 MHz and I didn't know BIOS reset exists. I ended up putting the computer in the freezer and let it cool down for an hour. I placed the CRT display on top and the power/VGA keyboard cable going into the freezer. I managed to set it back to the original frequency before it died.

When I was a teenager my friend would throw his laptop into the freezer for a few minutes every hour when we were playing games. He probably threw it in there hundreds of times, and it worked fine for years.

A friend had an overheating laptop that even an external cooler couldn’t keep up with so he got to sit right next to the open door in winter.

We called it the Frozen Throne.

Re: Ask HN: What's your "it's not stupid if it works" story?

#117
post #51

This was a while ago so it probably wouldn’t work today. I had to get past a captcha for automation and the solution I came up with was to always choose 2. If it was incorrect, just request a new captcha until it passed. For some reason, 2 was the answer most of the time so it actually rarely had to retry anyways

> For some reason, 2 was the answer most of the time

I’m getting flashbacks to LensLok™; the two-letter codes were often very hard to read though the plastic lens, and when you’d get the code wrong enough times, you’d have to load in the entire program again (from tape!), which took ages. There was also a “training” mode, of sorts, to help people familiarize themselves with reading the codes. In the training mode, the code letters were always “OK”. But here’s the kicker: For some unfathomable reason, the real code was very often (but not always) also the letters “OK”! So it was easier (at least on your eyes) to just always enter the letters “OK”, and hope it worked. What time you lost reloading for when it didn’t work you’d save by not having to adjust the scale to the size of your TV every single time.

Re: Ask HN: What's your "it's not stupid if it works" story?

#118
post #79

I implemented an enterprise data migration in javascript, running in end-user's browsers. (So no server-side node.js or such.) It was a project scheduled for 2-3 months, for a large corporation. The customer wanted a button that a user would click in the old system, requesting a record to be copied over to the new system (Dynamics CRM). Since the systems would be used in parallel for a time, it could be done repeated…

That’s horrible. I love it!

I’m not quite sure I understand why it was GET though. No way of running something like fetch or (more likely) XMLHTTPRequest?

Re: Ask HN: What's your "it's not stupid if it works" story?

#119
post #67

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.

Oh this is genius. That might just be my new humidifier hack.

Re: Ask HN: What's your "it's not stupid if it works" story?

#120
I used to work for a small medical device distributor. We used an e-commerce platform that, at the time, didn’t have an API. We wanted to synchronize our products with their platform as products were added, discontinued, copy/image changes, etc.

I ended up using capybara (a Ruby gem for writing browser automation instructions for system tests in web apps) to automate all of the “clicks” to make the updates in the system.

It actually worked pretty well. It wasn’t fast, but it was better than having a human keep the data in sync.

After a few years, the platform released a REST API, and we transitioned to that. But browser automations worked great in the meantime!

edit: spelling

Post reply on HN