Live data from Hacker News

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

news.ycombinator.com

121–130 of 510 posts

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

#121
I did a lot of bad database things - one time a client wanted me to upgrade their vendor software system but they had a managed service provider that they were in an active legal dispute with.

So after the MSP basically stopped responding to them they asked us if we could upgrade "without" SA - our company's position was it was their data so anything they wanted us to do with it was fine.

So I had a conundrum - how do I get SA without SA? Well - I knew we had one loophole - we used xp_cmdshell for some critical features of the app, and an unprivileged user can run it.

If you're not familiar with xp_cmdshell it basically is a stored procedure that passes your commands out to a windows shell, but its pretty functionally limited on purpose.

I wanted to copy the data, move it around, make a backup, send that to a place, and so I wrote that code in powershell, then base64 encoded it (because it needed to survive shell encoding problems), then chunked it across the wire(because length problems), reassembled it, and then executed it with xp_cmdshell.

Worked like a charm.

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

#124
I had a database that was in a boot-crash loop because it had a corrupted innodb_history_list for a given table.

Everything would be ok if we could just delete the table, but that would involve opening a session and that wouldn’t be possible because of the immediate crashing.

On a whim I thought, “well what if I just have a really short amount of time to connect before it reboots?” So I opened up 5 terminal windows and executed “while true; do mysql -e ‘drop table xyz;’ done” in all of them

After about 10 minutes one of the hundreds of thousands of attempts to connect to this constantly rebooting database succeeded and I was able to go home at a reasonable time.

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

#125
post #8

I made my own version of AWS workspaces inside AWS because workspaces is a buggy piece of shit and the client sucks. It's just an EC2 instance which can be started and stopped by a makefile that runs awscli and I query the IP address and open it in MS RDP!

At my company we used AWS workspaces for training classes. Whenever we'd have a class, we'd create 1 or 2 spare workspaces. If someone couldn't connect to their workspace, we'd give them the connection information for one of the spares.

I was so happy when we reworked our classes to no longer use AWS workspaces.

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

#126
My corporate VPN wouldn't connect to same public IP after 24 hours (I work from home). So I wrote a very crude bash script on Raspberry Pi Zero 2W (which also runs local DNS server), which would telnet into the router 5 minutes before my login time, and reboot the router

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

#127
post #26

Earlier quoted context omitted.

How many memory leaks were discovered only during the winter code freeze, because there were no pushes being done, so no server restarts

At reddit we would randomly select a process to kill every 10 minutes out of the 10 or so on each machine, just so they would all get a restart in case we didn't do a deployment for a few days. At Amazon they schedule service bounces during code freeze for any service that is known to have memory leaks because it's easier than finding the leak, which isn't usually an issue since it gets deployed so often.

And as a nice bonus you get chaos monkey for free:)

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

#128
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…

Couldn’t that be achieved with a mechanical timer switch and zero lines of code ?

Probably that doesn't give you small enough time increments

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

#129

Back in the '90s I consulted at HBO, and they were migrating from MS Mail on Mac servers to MS Exchange on PCs. Problem was that MS Mail on the Mac had no address book export function, and execs often have thousands or even tens of thousands of contacts. The default solution was for personal assistants to copy out the contacts one by one. So I experimented with screen hotkey tools. I knew about QuicKeys, but its logi…

The voice thing is hilarious. Thanks for sharing.

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

#130

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…

Nice. I just had nginx requiring basic auth for anything hazardous.

Probably broke a few features I’m not using in the process. :)

Post reply on HN