Live data from Hacker News

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

news.ycombinator.com

291–300 of 340 posts

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

#292
post #196

I 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

This is awesome! It would be perfect if there an occasional artefact line crossing the entire page vertically could be added. You know, those lines caused by an old crusty ink jet print head. Also a visibly cast shadow by the allegedly scanned edge of the paper due to misalignment on the flat bed would add to the illusion.

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

#293

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

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.

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

#294
post #202

Earlier 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.

Thank you. I just recently discovered the nRF52 as a potential solution for my own BLE project. To use a keyfob as a housing is brilliant and very 'stealth'. I have no experience with the nRF52 chips, but this will be a very useful resource for me.

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?

#295
I wrote a little script to constantly check for open appointments on ICBC (for license and motorcycle driving test slots). Has come in handy a few times already since usually everything is booked up months in advance. With this I usually find something much sooner within a few hours of running the script. https://gitlab.com/charsi/icbc-appointment-checker

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

#296

Easily 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…

I wrote something similar, I called it "Class Catcher" it was a VB program with the Web browser Control. I paired it with Pick-a-prof to get the best classes. I even sold a few copies via Facebook Ads.

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

#297

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…

That's just crime... I did something similar with the QR codes in my parking garage to park for free.

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

#298
While battling Photoshop, I ended up creating these two scripts:

Layer 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?

#299

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…

For people interested in this def look into autojump before doing this

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

#300

Earlier quoted context omitted.

Wow. Or, is this a wind up?

Wind up?

I think it's the British slang meaning "lie to get a reaction".

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.

Post reply on HN