Live data from Hacker News

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

news.ycombinator.com

131–140 of 340 posts

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

#131
my favorite is a little command line helper called “o”. it’s a helper for copy and rename commands. If I want to edit a misspelled filename I can just type

o mv mispelled.txt

and it will make an interactive prompt that looks like:

mv mispelled.txt mispelled.txt_

but the last word is editable, so I can use the arrow keys to alter it in place

https://github.com/jes5199/o

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

#132

So certainly not impressive, and morally ambiguous, but when chatGPT first released, I worked with it to create a python script that crawled The New Yorker sitemaps, found articles with embedded audio versions, downloaded the mp3 by reconstructing the file url using the article ID in the page source, and then renamed the file to match the page title and saved it to a well structured Google Drive directory. Now when I…

I was trying to do this same thing to download my Dalle2 history all at once. but being behind cloudflare made it a bit hard.

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

#134
Problem: My kids and wife would start Air conditioner at lowest temperature (16 degrees Celsius) and forget to switch them off. At one point in time my electricity bill was 50% of my house rent.

Solution: I used Home Assistant and Frigate (local NVR) to detect if there are humans present in the room, if no humans for 10 mins, switch off everything. I actually use a combination of things to detect human presence, some of the things include motion sensor, PC active, user sleeping (10 PM to 8 AM), there’s also a switch I use to turn on sleep mode if I’m taking an afternoon nap (The switch automatically turns off after 3 hours). I also use a template to measure if the AC temperature is below 22, if it is, I set it to 22 degree Celsius. The automation above saved me 15-20% on electricity bill.

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

#135

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

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

#136

So certainly not impressive, and morally ambiguous, but when chatGPT first released, I worked with it to create a python script that crawled The New Yorker sitemaps, found articles with embedded audio versions, downloaded the mp3 by reconstructing the file url using the article ID in the page source, and then renamed the file to match the page title and saved it to a well structured Google Drive directory. Now when I…

Very cool! It sounds like you could have a career in software development if you wanted one.

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

#138

Problem: My kids and wife would start Air conditioner at lowest temperature (16 degrees Celsius) and forget to switch them off. At one point in time my electricity bill was 50% of my house rent. Solution: I used Home Assistant and Frigate (local NVR) to detect if there are humans present in the room, if no humans for 10 mins, switch off everything. I actually use a combination of things to detect human presence, some…

man! i hope your wife doesnt figure this out. ``` wife walks to thermostat - set 16C, walks away. thermostat: 22C! wife pikachu face - set 16C thermostat:.... ```

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

#139
Script to pull, patch and build libinput with a modified touchpad acceleration function to be more similar to Windows touchpad acceleration. Triggered by a pacman hook whenever libinput gets updated. I think they may have merged the ability to create custom acceleration profiles now though?
Post reply on HN