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…
Ask HN: Small scripts, hacks and automations you're proud of?
91–100 of 340 posts
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#92I didn't feel like doing that deep of a dive to determine why it sometimes sees the NVMe drive, so instead I wrote a script [0] that uses IPMI to power cycle it until it can get an ssh connection. Originally I was sending a magic packet, but realized that was only a one-shot, so I switched to calling the IPMI executable via subprocess. No idea why I left the other stuff in there.
Anyway, this has reliably worked for well over a year at this point, dutifully restarting the server until it comes up. Some days it takes 1 attempt, some days it takes 5, but it always comes up.
[0]: https://gist.github.com/stephanGarland/93c02385e344d8b338aab...
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#93I automated the renewal process using TF and integrated it as much as possible with other services. I then integrated it into a CI/CD pipeline. It took DAYS to do these renewals (ironically of course, $30 per year for a fixed certificate would have been cheaper than the people time but #startuplife). It became a 30 minute process. It only took me two days of interrupted time to build this solution and get it working.
Still going after two years so it’s already saved about 900% on the labour costs.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#94One 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…
> but it’s all queryable through an undocumented API How did you go about querying this?
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#95I don’t have it on me but I worked for a company that was manually generating Let’s Encrypt Certs (about 20-30 of them) and manually deploying them every 90 days. I automated the renewal process using TF and integrated it as much as possible with other services. I then integrated it into a CI/CD pipeline. It took DAYS to do these renewals (ironically of course, $30 per year for a fixed certificate would have been che…
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#96We had great AP density so by the 2nd night I started working on an Expect script that would log in and boot 1 AP at a time per floor-building combo (multiple areas simultaneously), wait for them to come back, wait about 30 seconds, and move to the next AP on each floor. At first I did a dry run where the reboot was commented out and the "is it back yet" was delayed by a short timer to simulate a reboot delay + make sure the script would really run without a login timeout or something stupid. This would take a couple hours but it was better than taking everything down as clients under the specific AP being cycled would just roam and have a weaker signal for a minute (assuming the system had been booted the night before). We ran it the 3rd night in place of the mass reboot and watched it carefully. It went great so we left it to run every night. We had the nightly notice from an outage to a potential outage and stopped getting complaints because, except for a particularly unlucky laptop in a corner for 1 minute, nothing was really out of the ordinary. At this point we knew we were buying a brand new wireless system that fiscal year (already in the budget) so we ended up just riding the year out with this script.
In all it was a lame reboot script shorter than the table containing the lists of APs to boot 1 by 1 but it probably had more real impact than any fancier scripts/tools I made while I was there.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#97I don’t have it on me but I worked for a company that was manually generating Let’s Encrypt Certs (about 20-30 of them) and manually deploying them every 90 days. I automated the renewal process using TF and integrated it as much as possible with other services. I then integrated it into a CI/CD pipeline. It took DAYS to do these renewals (ironically of course, $30 per year for a fixed certificate would have been che…
what's TF?
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#98 yt-dlp --download-archive archive.txt --no-overwrites -o '%(playlist_index)s - (%(uploader)s) %(title)s.%(ext)s' --format bestvideo+bestaudio --yes-playlist --ignore-errors --write-info-json [PLAYLIST_URL]
Edit: if you use this, note that you should probably sort your playlist by Date added (oldest), otherwise the playlist_index doesn't work correctly. Or you can just leave out playlist_index from the filename if you don't care about it.Re: Ask HN: Small scripts, hacks and automations you're proud of?
#99- 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 a shortcut of the shortcuts folder and put in the folder.
Result is that you can hit Win-R, type e.g. "sho" and it would autocomplete "shortcuts", or "ti" for "timesheet" etc etc. Way faster than clicking around for icons, just a half-second until your oft-used app/spreadsheet/folder/website is loading.
Question: how can I do this on Mac?
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#1002: Auto restart ADSL modem on connectivity loss: https://gist.github.com/TalalMash/1fdb6363b46575d05530c6f654...