Live data from Hacker News

Ask HN: What's your proudest hack?

news.ycombinator.com

401–410 of 414 posts

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

#401

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…

> I have started using xdotool [1] to create bash scripts that send mouse clicks and keystrokes to apps. Interleaving calls to xdotool with the "sleep" command [2] produce a convincing effect.

Can you share some of these scripts?

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

#402
post #399

I rewrote 2,650 lines of C as a seven line shell script. The previous programming team had written a data transfer program with its own implementation of ftp. I just used the one that was already on the computer.

Can you share this script? I'm interested to see how 2,650 lines of C got boiled down to seven lines of shell.

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

#403
post #256

In my first job I work on a database product in development that leaked memory slowly, leading to crashes after hours of usage. The software was written in C and there were no tools like Purify or Valgrind back then to deal with memory problem. It was a vexing problem that got punted until release time, when it became a show stopper. I looked into the problem and found that the memory allocation used malloc and free.…

Any good tools or approach similarly for java applications? Those which crashes due to memory leaks?

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

#404
post #401

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…

> I have started using xdotool [1] to create bash scripts that send mouse clicks and keystrokes to apps. Interleaving calls to xdotool with the "sleep" command [2] produce a convincing effect. Can you share some of these scripts?

Sure, here is one of them:

https://github.com/ziotom78/tnds-tomasi-notebooks/blob/maste...

And here is the recording, made with asciinema:

https://asciinema.org/a/544981

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

#405
post #402
post #399

I rewrote 2,650 lines of C as a seven line shell script. The previous programming team had written a data transfer program with its own implementation of ftp. I just used the one that was already on the computer.

Can you share this script? I'm interested to see how 2,650 lines of C got boiled down to seven lines of shell.

I just wrote

  echo "open $mainframe\

  \nuser $mf_username $mf_password

  \nsite lr=160\

  \ncd ..\

  \nmput \*\

  \nquit" | ftp -i -n -v > $ftp_log 2>&1
The program collected data from the telephone company's Nortel MD110 switches, tidied it up and sent it to their mainframes.

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

#406
Following up on my World Cup '98 adventures [1], on June 30th 98 I was home for the first time for a very long time, and suddenly I realized that the Argentina-England round of 16 was beginning, and Carlos didn't call me to check for updates on the software before the match (there were bugfix updates every day up until the last few days).

I called him "you didn't call, did you update the software before the match?"

- "I didn't want to bother you, all is under control" - "The latest software is the only one managing overtime and match end penalties, if you didn't update and the match end on a tie we're in trouble. Like we can't display scores to 2 billion TV viewers." - "Shit, I didn't check and didn't upgrade. Let's pray..."

What did you think happened? 90 minutes of game later, we're on a tie, and the software doesn't manage it. Of course it's impossibly risky to upgrade the software once the match is ongoing anyway.

Fortunately we could manage overtime manually by resetting the match in the software, then adding goals before starting up. - "Let's hope there are no penalties..."

What did you think happened? Overtime ended, and still a tie!

So we resetted the timer and score again, but we had no way to use the software to display the correct scores at the very end.

Therefore the only way was to manually update the score directly in the Antero software on the SGI Octane (instead of using the remote control PC), by rapidly typing in the data seconds before setting up the page on air. Of course, I was the only one knowing how to use Antero, so I was in front of my TV, watching the live broadcast, and telling Carlos on the phone as soon as the referee blew his whistle:

"On the keypad type 5000 then Enter. Hit tab twice. Enter 4. Hit Tab twice. Enter 3. Tab 4 times. Enter 5. Tab 2 times. Enter 3. Hit Escape. Press shift+* on the keypad. Press Ctrl+Enter on the Keypad. On air!"

And there it was on air before the world's eyes, correct score and stats.

[1] : https://news.ycombinator.com/item?id=33663732

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

#407
post #390

[dead]

OpenBSD had a similar issue with pkg_add, later it used caching (and anyway, curl connects much faster than ftp(1) ) and package updates are much faster now.

Nah, pkg_add works differently at a fundamental level. Yes, OpenBSD improved pkg_add significantly.

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

#408

[dead]

Hi, I really liked your probe ... and yes freebsd-update(8) may be useful for small updates from -pX to -pY but large updates like from 12.1 to 12.2 are real PITA. The HardenedBSD (FreeBSD fork) made its own hbsd-update(8) tool which just fetches whole new OS and after extraction installs/updates needed things. But its PITA for small updates :) Sorry to hear you have bad experiences with FreeBSD Froums ... but to be…

It's a strange thing, people like Shaun Webb that demonstrate high intelligence in a specialized field can simultaneously be mindless sheep and follow/advocate "the current thing"...

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

#410

Earlier quoted context omitted.

Interesting! I suspected the attack vector was my poor use of BTC rather than someone cracking AES so quickly, I'll look into this. I created the wallet using a popular opensource wallet app, and just moved some funds there. Don't know more than that... Thank you for the pointers!

Update: funds were not stolen. PortableSecret wasn't cracked (yet)! What happened is: the wallet app I'm using automatically performs CoinJoin[1] when funds are received (In fact, this is their business model! They take 0.3% of the amount to automatically anonymize all inbound coin). CoinJoin is a protocol that breaks up the sum received in tiny pieces and scatters them across a large number of "sub-wallets". So my w…

Not your keys, not your coins.
Post reply on HN