Ask HN: Small scripts, hacks and automations you're proud of?
291–300 of 340 posts
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#292I use the following tiny script to make PDFs look like they have been scanned. There are still entities that require you to physically sign a document and scan it. So far, everyone accepted PDFs like these: #!/bin/sh ROTATION=$(shuf -n 1 -e '-' '')$(shuf -n 1 -e $(seq 0.05 .5)) convert -density 150 $1 \ -linear-stretch '1.5%x2%' \ -rotate ${ROTATION} \ -attenuate '0.01' \ +noise Multiplicative \ -colorspace 'gray' $2
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#293On 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
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.Re: Ask HN: Small scripts, hacks and automations you're proud of?
#294Earlier quoted context omitted.
Sounds really cool, do you have a write-up of it anywhere?
https://blog.waleson.com/2022/03/the-worlds-first-cowboy-key... Source code here: https://github.com/jtwaleson/cowboy-bike-remote-ble I’m currently working on finalizing the PCB version, the first one had some flaws so the battery drained really quickly.
In your blog post you mention that "switching between 24km/h and 25km/h" is very important. May I ask why? Isn't such a speed difference almost negligible as you easily surpass it when pedalling?
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#295Re: Ask HN: Small scripts, hacks and automations you're proud of?
#296Easily my highest utility script so far was to get an edge while picking classes. At my university there were some classes which were very competitive and there was also system where tranches of students would get access to those classes earlier (e.g. groups of honors students -> groups of seniors -> juniors, etc). I was a lowly sophomore at the time, so I basically got what was left over. Before I could register I c…
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#297Bought 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…
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#298Layer Labeler (sequentially labels layers with prefixes and leading 0s): https://www.middleendian.com/pslayerlabeler
Mask Placer (because Photoshop trims transparent pixels when exporting multiple layers for no fucking reason): https://www.middleendian.com/psmaskplacer
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#299This 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…
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#300Earlier quoted context omitted.
Wow. Or, is this a wind up?
Wind up?
This is a fascinating story. How weird to look back and see someone saying "I don't see how a lot of money could be made from this" to something that became one of the fundamental money engines of the internet.