Ask HN: Small scripts, hacks and automations you're proud of?
121–130 of 340 posts
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#122It 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.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#123I 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 least code, and the ones I feel I can talk about.. ):
* Put together a little box that polls varied knobs on a USB midi device to mangle the traffic going across its two interfaces. Allows for real time latency / jitter / packet loss testing https://twitter.com/ultrahax/status/1200902654882242562
* Studio LAN game browser didn't work across subnet boundaries ( studio is a couple of class B's ). Wrote a little daemon that'd take game discovery packets from one subnet, mangle the src addr, and send it on its merry way. Everyone can see everyone's games, happy producers.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#124 #! /bin/bash
function todo {
if [ $# -eq 0 ]
then
vim ~/Dropbox/todo/todo_list.txt
else
vim "$HOME/Dropbox/todo/todo_list_$1.txt"
fi
}
Sourcing this in my shell means I just have to type... todo
To automatically get into my default todo list which is synced to dropbox (and thus accessible everywhere on mobile as well).While, whenever I have a new project/etc come up, I can just
todo new_project_name
And get a new, nice clean file, with the same backups and multi-device accessibility.Re: Ask HN: Small scripts, hacks and automations you're proud of?
#125One of my favorite spa/hotels for a weekend retreat for my wife and I has absurd waitlists — takes a few months typically to reserve 2 nights. However, they have a 7 day cancellation policy that leads to a U shaped availability curve for rooms. The hotel website itself is inordinately difficult to search more than 1-2 nights (each day takes 6-8 clicks to search), but it’s all queryable through an undocumented API, so…
The only problem was selecting the bundle would automatically choose the seat (on the far side which weren’t good), skipping the seat selection modal.
I realized that if you had a seat in your cart, it would reserve it for 15 minutes and the bundle would pick the next available seat. Since I wanted central seats, I wrote a simple Puppeteer script which selected the bundle in multiple browser instances, reserving all the unwanted seats until mine was finally available.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#126Re: Ask HN: Small scripts, hacks and automations you're proud of?
#127I'm still super proud of that because it was so much fun to create. I recall "releasing" the program to a handful of friends, and they all seemed to like it, but it never really went anywhere.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#128To regularly remove any files in commonly dirty directories that haven't been viewed in a week
Keeps the desktop tidy: https://gist.github.com/higgins/b825103ce0bcf3fbefc79a439212...
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#129https://github.com/TorbFoundry/torb
"Torb is a tool for quickly setting up best practice development infrastructure on Kubernetes along with development stacks that have reasonably sane defaults. Instead of taking a couple hours to get a project started and then a week to get your infrastructure correct, do all of that in a couple minutes."
My ambition is to fill the space of Heroku and right now I can get something like a React App and a Flask API or a full Elixir Phoenix project started and running in less than 5 minutes on Kube, with a full infrastructure as code environment, reproducibility and more.
It's definitely not meeting my ambition yet, but it's definitely in a place where I think people can use it and get a lot of value from it. I've been testing it with some friends over a few months and have been dog fooding it on my other projects.
I just finished adding a file system watcher to it over the last few days so you can iterate and changes will quickly be reflected onto your cluster. Next I'm going to extract this out into a library from the CLI tool, build an API over it and offer a hosted solution and a web app.
I've been meaning to share it with people but I've been heads down building for maybe a little longer than I should have been.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#130 $ ch ls -vx
ls - list directory contents
-v natural sort of (version) numbers within text
-x list entries by lines instead of by columns
Script to provide `cut`-like syntax for a few `awk` features: https://github.com/learnbyexample/regexp-cut $ echo ' one two three' | rcut -f2
two
$ echo 'sample42string123with777numbers89' | rcut -d'[0-9]+' -f3
with