Live data from Hacker News

Ask HN: Small scripts, hacks and automations you're proud of?

news.ycombinator.com

221–230 of 340 posts

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#221
post #216

I built a script that finds appointments at the citizens' office in Berlin. At first, it just collected stats. That was to test a theory that you have to check early in the morning (turn out it's false). Finding an appointment is notoriously difficult, and people often depend on the results of those appointments to start their life here. So I built a UI for the script and put it online. Not just code on GitHub but a…

Thanks so much for this tool; it saved me from untold frustration when I moved to Germany. I’m happy to see that the city blessed it.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#223
post #216

I built a script that finds appointments at the citizens' office in Berlin. At first, it just collected stats. That was to test a theory that you have to check early in the morning (turn out it's false). Finding an appointment is notoriously difficult, and people often depend on the results of those appointments to start their life here. So I built a UI for the script and put it online. Not just code on GitHub but a…

Thanks so much for this tool; it saved me from untold frustration when I moved to Germany. I’m happy to see that the city blessed it.

Thank you for the kind words! We met once, and it was interesting to hear why appointments are so broken. I left them with a deep sympathy for their situation.

A good example is that people book multiple appointments and don't show up. Over 15% of appointments are no-show. However they can't ban people or set up any barriers that would disadvantage citizens.

That being said, they're hard to work with, simply due to being too busy to respond. It's frustrating.

But there are some encouraging developments happening. The creator of the booking system was put in a position to change things. We're supposed to meet soon, and I'm excited to see what will come out of it.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#224

I have a Python script, called t.py and a bash alias "t" that calls it. I use it for quick navigation in the terminal instead of "cd" and "pushd/popd". The basic format is: "t So, "t 1" goes to parent directory, faster than "cd .." Then, "t 4" goes to "cd ../../../.." And of course "t" will print out all the options. "t a" goes to my main development git worktree, while "t b" goes to place I build from. But the real…

I also have 't' as a shortcut, but 't' creates a randomly named directory in /tmp and jumps into it. 't ' creates a directory ~/workspaces/_ and jumps into it. 'tl' always cd's into the latest directory created using 't'. Really useful if you are messing around with code and serverside stuff.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#225

Earlier quoted context omitted.

> Accepting the hash lets people with database access perform a real login if needed. ... and if anyone managed to say do an SQL injection and retrieve said hashes, then that then would give them access to your users accounts, right?

And also access to those users’ other accounts if they reuse passwords (most people probably do)

Knowing hashes alone wouldn't allow you to do this normally - usually you use a "salt" during the hashing process which would lead to different hashes with the same password.

Without doing the OP's "trick" however, if you somehow managed to get a hashed and salted password then it still wouldn't be enough to gain access to someone's account.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#226
Bought one of these on Swedish Craigslist: https://www.walmart.com/ip/Star-Micronics-TSP654IIU-24-GRY-S...

Which was the same they used at my university in the cafeteria. Managed to plagiarise the same receipt we got when ordering food (which you needed to show the kitchen to get a plate of food) and was thus able to eat for free for the rest of my enrollment.

Not even my professors could teach me to do GUIs in Java but this thing sure was ‘Swinging’

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#227
When i was still onboarding at my first (junior) c++ job i organized some ruby scripts for running tests. It wasn't a rocket science, but it seems that team didn't really cared about copy-pasting bunch of code to write new tests. Im proud of this because they found it useful.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#228

Not technically difficult, but I remember that it made me feel very proud: Back in high school (2004-ish) I made a small PHP script to generate a .m3u of my whole MP3 collection and I exposed this from my home PC. Since I could install Winamp on the school PCs this allowed me to stream my music collection. Another one was a password rotation script for my university. There was an idiotic password policy that required…

They forgot to rate-limit it =P

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#229

This bash config allows you to cd directly to the most commonly used directory with a specific name. It also has tab autocomplete. It does require logging all used directories though. tabChar=$'\t' function prompt_command { echo "$(date +%Y-%m-%d--%H-%M-%S)$tabChar$(hostname)$tabChar$PWD$tabChar$(history 1)" >> ~/.full_history } export PROMPT_COMMAND=prompt_command function c { while read -r _ dir do if [[ -e "$dir"…

https://github.com/ajeetdsouza/zoxide

+1 for z. one of the best timesavers available.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#230
Don't have the code around but using a cheap NFC sticker at multiple places in my house to pause/ resume audio. I'm using a RPI with mopidy and made a small microservice that does the pause/resume when triggered. Super handy when I want to leave the apartment and come back to my music.

A GET request (by the phones browser) is sent when I "touch" the phone to any of the stickers, the backend is a simple nodeJS express script that listens for GET request on a route.

Post reply on HN