Live data from Hacker News

Ask HN: Weirdest hack that you ever saw in production?

news.ycombinator.com

131–140 of 289 posts

Re: Ask HN: Weirdest hack that you ever saw in production?

#131
I had a piece of legacy, proprietary software that communicated to another machine by wvdial over an SSH TTY (?!). It inexplicably stopped working when migrated to a newer machine, but.... worked just fine while running under strace. It appeared to be some kind of timing/race condition brought on by the new machine being faster to bring up a connection. strace slowed it down JUST enough to work.

So naturally, it now runs strace >/dev/null in production, probably to this day.

Re: Ask HN: Weirdest hack that you ever saw in production?

#132
post #7

Using 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…

The funny thing about this was that the truly incompetent wouldn't have been able to do something like that.

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?

#133
post #54

Earlier 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

Isn't it what black magic is all about?

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?

#134

my 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.

Glad to see confirmation of using a rubber band to fix an IBM mainframe. Been there done that, but the story is so loony I wondered if anyone would believe me. http://laughtonelectronics.com/oldsite/comm_mfg/commercial_i...

Re: Ask HN: Weirdest hack that you ever saw in production?

#135

In 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…

bash/X11 equivalent:

  function mouse_around {
    while true; do
      sleep "$1"
      xdotool mousemove_relative 1 1
      xdotool mousemove_relative -- -1 -1
    done
  }
  
  mouse_around 60

Re: Ask HN: Weirdest hack that you ever saw in production?

#136
post #54

Earlier 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

Yes, it is derivable, but it takes a certain amount of (reckless) genius to put all together

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?

#137
Oh boy.

I 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?

#139
This was probably not considered a hack when it was implemented but at some point in the early 2000s someone deployed two binary programs on an old Compaq rack server running RedHat Linux of some version.

I 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?

#140

I 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…

If I had to guess, it was a hamfisted way of doing JS-style objects in C++. They could just slap properties onto objects, etc, and the build process will determine what each class needs. Clever, but terrible.
Post reply on HN