News for hackers. Stuff that matters.
Re:Ask HN: Which scripts are you most glad you've written? by dangrossman on Tuesday November 11, 2014 @08:41PM (#8593535)
1. Recurring billing and dunning.

Subscription renewals are a little script that runs daily. If the charge is declined, a mail gets sent and a date for the next reattempt is set in the database for when the script should try again.

A series of charge attempts and mails go out on a schedule asking the customer to update their payment information or get in touch. The mails are all prewritten, and at least 75% of subscriptions are recovered through this automated process.

It saves time, I don't have to handle following up on declined charges myself (which I hate to do manually), and it's worth six figures a year compared to just letting subscriptions lapse because of one declined charge.

2. Off-site backups and code that validates they're complete and restore-able. It's peace of mind. No server runs forever; you will eventually need that backup.

Re:Ask HN: Which scripts are you most glad you've written? by vegedor on Tuesday November 11, 2014 @04:28PM (#8592297)
Definitely not the alarm for the next morning that took me half the night learning bash and fixing the alarm script. It looked awesome, though if I say so myself.
Re:Ask HN: Which scripts are you most glad you've written? by yzzxy on Tuesday November 11, 2014 @10:16PM (#8593821)
While I don't like Windows much and dual boot it mainly out of necessity, it was pretty easy to whip up a trigger (in the GUI task scheduler) for a script to trigger alarm music even when the computer was sleeping.

The procedure goes something along the lines of "RTC trigger wakes up sleeping computer, computer waits to connect to network, opens spotify url of playlist." It lets me turn off the LED and fan nightmare that is my desktop and still use it as an alarm.

Re:Ask HN: Which scripts are you most glad you've written? by musername on Wednesday November 12, 2014 @01:51PM (#8597382)
I'm not even sure how to access that in debian, nvm i didn't try to fix the apc issues, yet. I'm sure there's a command already, anyhow.
Re:Ask HN: Which scripts are you most glad you've written? by Pamar on Wednesday November 12, 2014 @05:11AM (#8594721)
A Perl script that parses a Progress ABL(1) source file "A" and spit out a new Progress ABL program that would correctly declare all the input and output variables of "A" and invoke it.

(At the time we had to deal with "stored procedures" with tens of input and output parameters, and testing these was a time-consuming and error prone problem, people would save invoking scripts, running them to find what had changed in the parameters list and manually update them).

(1) A 4GL proprietary language. Just think of PL/SQL with the practical parts surgically removed.

Re:Ask HN: Which scripts are you most glad you've written? by partisan on Sunday November 16, 2014 @07:26PM (#8616166)
A visio/VBA script to parse a Tivoli Maestro job configuration file and create a flow chart of the dependencies of each batch job. I was asked to manually document this and would have spent months documenting the hundreds of jobs. Also, the jobs changed on a frequent basis.
Re:Ask HN: Which scripts are you most glad you've written? by japhyr on Tuesday November 11, 2014 @11:32PM (#8594024)
A script to open all the files I need open, on the appropriate workspaces, for each of the projects I'm currently working on. It feels so slow to do that manually, and it's still satisfying watching all those files open themselves on various workspaces.
Re:Ask HN: Which scripts are you most glad you've written? by mod on Sunday November 16, 2014 @04:52PM (#8615592)
I use tmuxinator in a similar fashion.

Starts my vim instance, bash prompt, sources virtualenv, server instances, and console/repl.

I start-up in about 5 seconds.

Re:Ask HN: Which scripts are you most glad you've written? by haidrali on Wednesday November 12, 2014 @02:18AM (#8594380)
A Bash script to monitor OpenERP server, restart it if it has been killed by some other process. Note: OpenERP server used to stop working after 15 to 20 hours automatically. Thanks
Re:Ask HN: Which scripts are you most glad you've written? by mtmail on Wednesday November 12, 2014 @06:39AM (#8594959)
Hourly emails when disc is almost full (absolute and relative) and later automatic cleanup of old files on production servers. Saved me trouble countless times.
Re:Ask HN: Which scripts are you most glad you've written? by motyar on Thursday November 13, 2014 @03:03AM (#8600436)