Earlier quoted context omitted.
Definitely Kopia. I was skeptical at first, it's a relatively new tool and not much is known about it (at least on HN) but it's uber-fast and compresses extremely well. Detection of duplicate blocks seems both more aggressive and faster compared to Borg and Restic. It's honestly a win on all fronts. It can sync to remote places -- which I don't care about as I have a local directory where it does its stuff and I then…
What's your opinion on bupstash?
Ask HN: Small scripts, hacks and automations you're proud of?
241–250 of 340 posts
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#242It uses OLE to open Word documents and print them to PDF. Nowadays Word has a save to pdf option, but initially the script would print to postscript and then convert to PDF with Ghost.
It runs from IIS, but over the years it has been used as a CLI tool or with Apache.
So far nothing has shown to be as reliable as this script at converting to PDF. It would be great not to depend on Word or even Windows, but there's nothing that can convert with the same level of fidelity.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#243This 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…
I gave up on bookmarking so I now use an alias to quickly find what I am looking for with fzf and fd:
p () { cd $(fd $1 $HOME -d 4 -i -E Pictures -E Desktop | fzf) }Re: Ask HN: Small scripts, hacks and automations you're proud of?
#244On Windows: - Created a folder called "shortcuts" - Copy the folder URL into the system path (Control Panel, Environment variables something something) - Create a shortcut of anything I want to hyperlink to and put in there, with descriptive names - In IE, I think the setting was to enable autocomplete. For some reason that was linked to the autocomplete of the run menu item in Windows. - For extra bonus points, add…
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#245Easily 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…
The problem was that it was essentially always used at the maximum because most people had such small jobs to run + other queues were not as efficient. Because of the inner "fighting", the HPC admin essentially blocked the possibility to have jobs pending. So first come first serve.
So basically I've set up a cron job to look prepare my jobs and look for empty slots during the night. I remember looking at results in the morning while sipping on coffee and the head of the lab congratulating me for my "dedication" as she saw I submitted jobs at 3AM!! :)
At the end of the internship, I basically had a script "assistant" that I would use to prepare the calculation jobs, unite them so I could use them on "bigger" queues, do most of the post-calculation analysis (essentially producing CSVs and graph for me).
And I am too, chasing that high to this day.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#246Re: Ask HN: Small scripts, hacks and automations you're proud of?
#247I made a CLI tool for quickly starting new branches with draft PRs, asking for reviews, etc: https://github.com/dbalatero/work-cli Made a bunch of Hammerspoon plugins for macOS: - https://github.com/dbalatero/SkyRocket.spoon - mod+click to resize/drag windows - https://github.com/dbalatero/VimMode.spoon - Vim mode everywhere - https://github.com/dbalatero/HyperKey.spoon - pop-up menu for when you forget your keybinds…
oh I've been down the "I can just fix macOS" road. The sooner you move away the better. so much time wasted on plugins like these. you effort will just be null the second apple change the usability apis enabling hammerspoon, like they did countless times before. I don't even rename the name of the fallen apps before it. instead now I contribute things as long lived proper features on KDE and hopefully advance humanit…
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#248CronBin: https://github.com/theowenyoung/blog/tree/main/scripts/cronb...
Both scripts are deployed as single file js in the free tier of Cloudflare's Workers, and my personal workflow relies on these two simple services for all persistent data storage and scheduled tasks.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#249A useful hack I've implemented in several projects is to accept the stored password hash as a valid password. It is generally possible to impersonate a user but there are always subtle differences in the way those sessions work. Accepting the hash lets people with database access perform a real login if needed.
> 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?
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#250I 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