Live data from Hacker News

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

news.ycombinator.com

321–330 of 340 posts

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

#321

When I worked at IBM circa ~2006 you'd get a written warning called a clean desk violation if you left your workstation unlocked. I wrote a little daemon that'd l2ping my Nokia brick phone; if it didn't get a response for 30 seconds it'd invoke xscreensaver. Saved me a lot of paperwork. I currently work at a Call of Duty studio. My favorite hacks ( not super high tech, but the ones that had the most impact for the le…

These made me unreasonably happy.

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

#322

Earlier quoted context omitted.

I have an app to open the gate of my parking garage. However, apps are not that convenient while driving. Reverse engineered it and created an Android Auto app instead. https://daanmiddendorp.com/tech/2022/10/13/reverse-engineeri...

Very nice. But I'm not sure my car has Android Auto, it is a bit old... I managed to integrate mine with Google Assistant on my phone so I say "Hey Google, turn on the front gate" (it thinks "front gate" is a switch).

[deleted]

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

#323

Earlier quoted context omitted.

Neat! How did you reverse engineer the signal that your microcontroller had to send to the gate?

I got pretty far at decoding the signal with a RTL-SDR radio that I bought. It was a OOK code around 433mhz if I recall correctly. But I eventually abandoned that strategy as there was a simpler way to activate the gate through a direct electrical signal. So the device is just acts as a sort of switch now.

[deleted]

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

#324

Honestly, the script/hack/automation I'm still most proud of is from around 1983, when I was 12 years old, for my Commodore 64. Back then, all computer communications were over the phone line, and in my house, we only had one line, so I spent a lot of late nights, dialing into BBSs, often not going to sleep until the sun came up. Then, I would get in trouble at school for falling asleep in class. So I came up with a…

I wish I could give you an award. I’m also happy that HN doesn’t have that feature. So here have this instead:

            ___________
            '._==_==_=_.'
            .-\:      /-.
           | (|:.     |) |
            '-|:.     |-'
              \::.    /
               '::. .'
                 ) (
               _.' '._
          jgs `"""""""`

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

#325

Recently developed a small embedded device (using a nRF52840 microcontroller) that allows me to open my front gate remotely using my phone. I no longer have to carry around a gate remote. And my friends/guests can now open the gate from their phone as well. I couldn't find anything on the market for doing that so I'm glad I managed to do it (and it was a good opportunity to learn some embbedded programming and electr…

[deleted]

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

#326

This was a recursive `rm -rf node_modules` that turned into a rust learning project and got out of hand :) now supports 14 different languages/project types. https://github.com/tbillington/kondo .

Nice! Beeen looking for something like this for elixir

awesome, hope you enjoy!

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

#328

Earlier quoted context omitted.

Really cool idea. For macOS, I just found out about trash https://formulae.brew.sh/formula/trash

One of the few aliases I always use is: alias rm='trash -i' It will prompt you before moving files to the trash instead of deleting them straight away on macOS. I've also added the -i flag to the following: alias mv='mv -i -v' alias cp='cp -i -v' alias ln='ln -i -v' It warns me when a file might be overwritten in the target directory and will display a short protocol of the actions performed due to the 'verbose' flag…

> alias rm='trash -i'

This can really backfire. Ages ago, I used to have exactly the same alias for 'rm'. After a year or two, I got so used to 'rm' not really being destructive that one late night when I was really tired, I used it on a remote system without feeling the need to carefully check the file name. That remote system, of course, did not have 'rm' aliased to a safer version...

Long story short, I strongly recommend using a different alias name (e.g., 'rem', 'rmi' or so). In this case, the worst that can happen is getting a 'command not found' message, when the alias is missing.

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

#329

On any system I'm working on I add a stupid simple script named `can` that moves items to the trash can. I can't say how many times it has saved my bacon avoiding accidental permanent deletions over using `rm`.

Really cool idea. For macOS, I just found out about trash https://formulae.brew.sh/formula/trash

I use a similar thing that also handles when you forget -rf, with confirmation & stuff; https://github.com/MikeDacre/careful_rm

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

#330

This is more in the "hack" category, but here is a solution for bookmarking directories[1] that I am quite fond of: mkdir ~/.marks/ export CDPATH=.:~/.marks/ function mark { ln -sr "$(pwd)" ~/.marks/"$1"; } Then: mark @name # add bookmark called @name for the current directory cd @name # jump to the bookmarked location cd @ # list all available bookmarks It can list bookmarks, auto-complete, jump to sub-directories w…

[deleted]
Post reply on HN