So naturally, it now runs strace >/dev/null in production, probably to this day.
Ask HN: Weirdest hack that you ever saw in production?
131–140 of 289 posts
Re: Ask HN: Weirdest hack that you ever saw in production?
#132Using the Google Sheets API to store session history and metadata for a nightly backfill job instead of, you know, a database. The program broke after the creator left and no one could figure out how to bring it back up. The engineer assigned to fix it pulled their hair out looking for the database creds, local SQLite3 records, anything that would initialize the backfill. Finally realized it wasn't just printing out…
Sounds more like some BS requirement from a clueless middle manager or a boss and a dose of malicious compliance.
Re: Ask HN: Weirdest hack that you ever saw in production?
#133Earlier quoted context omitted.
>I'd love to know who left those comments The legend himself, John Carmack. Fast inverse square root is really the perfect example of black magic in programming.
I always thought of this bit of code as a great example of applied numerical methods techniques, rather than “Black Magic” The magic constant is derivable from standard methods and one can even choose to optimize other measures of error. http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
Unorthodox technique, that you can explain if you try hard enough (in a sense, everything that reliably work could be explained and someone has to came up with in the first place), used by people who don't really understand it.
What do you think is a better example?
Re: Ask HN: Weirdest hack that you ever saw in production?
#134my dad put a rubberband on an ibm mainframe printer in 75 to make it work while ibm showed up to fix it. They came in and didn't get it to work. So my dad as he needed to print millions of water bills on time put the rubberband back in and ran his job.
Re: Ask HN: Weirdest hack that you ever saw in production?
#135In my startup days, we were working on a proof of concept with a really big bank. Because of their security rules, we couldn't have direct access to their systems - so if we wanted to do something remotely, we would have to start a webex, they would join and share their screen, and give us remote control. This worked great, except if we wanted to work over the weekend, since if we left the screen alone for more than…
I use a posh script like this when i dont want the computer to lock. $ws = New-Object -COM wscript.shell; while($true){ $ws.SendKeys("j"); Sleep 60;} Ive used it for demos that way the computer doesnt lock before the demo starts, its pretty short and easy to remember. Also on windows if you spam SendKeys("{Left}") everything you type is backwards and when you hit the windows key it freezes the computer in an interest…
function mouse_around {
while true; do
sleep "$1"
xdotool mousemove_relative 1 1
xdotool mousemove_relative -- -1 -1
done
}
mouse_around 60Re: Ask HN: Weirdest hack that you ever saw in production?
#136Earlier quoted context omitted.
>I'd love to know who left those comments The legend himself, John Carmack. Fast inverse square root is really the perfect example of black magic in programming.
I always thought of this bit of code as a great example of applied numerical methods techniques, rather than “Black Magic” The magic constant is derivable from standard methods and one can even choose to optimize other measures of error. http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
In the world where FizzBuzz is hard, applying the Newton Method is a rare thing.
Re: Ask HN: Weirdest hack that you ever saw in production?
#137I had just joined a “subscription based social site” as a backend developer. I think it was PHP 4 and MySQL 3 at the time.
Someone had realized that it would be great to have database “migrations” in code instead of using phpMyAdmin to modify tables.
Thumbs up, forward thinker!
So there was an ONE BIG migrations.php file that had our DDL in it with if statements around each one to see if it had already been run.
The statements didn’t have a version number or anything super simple and trivial. It was a combination of all the worst ways you could figure out if a column had been added to a table in MySQL.
When code was deployed, someone would visit http://example.com/migrations.php real quick to migrate the site.
Oh man, classic.
Re: Ask HN: Weirdest hack that you ever saw in production?
#138Re: Ask HN: Weirdest hack that you ever saw in production?
#139I think they're called lpr and lpd. But I've tried to find their source and it's not in any major printer packages. By running strings and hexdump on them I think my co-worker finally managed to trace it to a package of software made for a firewall. And embedded in there were these two programs for printouts.
SO that became well used in a major government branch that will go unnamed.
Fast forward to 2013 and it's my job to upgrade it. Replace its hardware and its OS.
Luckily the two binaries could be run from RHEL 6 but it was all on faith. I had no way to replace them or upgrade them because I had no idea what they did, what protocol they spoke.
So they're running to this day. I'm sure someone here who is more versed in printing might tell me that they implement some standard protocol that can be replaced by CUPS or something well known. I'd be thankful but tbh they work so they won't be replaced in my time with these systems.
Re: Ask HN: Weirdest hack that you ever saw in production?
#140I once worked maintenance on a large C++ program used in production by a lot of customers. It was odd in several ways, but the feature that stands out in my mind was the numerous classes that were not defined anywhere in the source code or libraries. If that sounds unlikely to you, it sounded unlikely to me, too. I wasted a lot of time trying to figure out where they were defined. I couldn't ask the original author o…