(Not so) dead man's switch
July 7, 2011 8:58 PM   Subscribe

Does anyone know of software other than Daisyman's DMS that acts as a "dead man's switch", i.e. will carry out a task (send an email or delete a file or similar) if I don't "reset" it within a certain time frame? If not, how would you suggest I go about writing such a program?

It MUST fill the following criteria:

1. if it is web-based, it needs to be require a password when I check in.

2. if not web-based, it must be able to be installed on Windows XP without admin privileges OR if that is not possible, an acceptable alternative would be one that ran on Ubuntu (with admin).

3. the time interval for checking in must be able to be set as small as 24 hours, but I need to allow for not checking in over the weekend. I.e. either it needs to be easily changeable so that on Fridays I can set it to not require a check-in until Monday, or it needs to be programmable on a variable cycle to require different reset intervals for weekends vs other days. This rules out this program, which would otherwise be perfect.

I am happy to create a program myself if necessary. I know C++, some python and various scripting thingies (html, javascript, applescript). I just haven't yet worked out the simplest way to implement such a thing, so any suggestions would be great.
posted by lollusc to Computers & Internet (12 answers total) 3 users marked this as a favorite
Schedule a task that runs with the weekly option set to Mon-Fri?
posted by Nonsteroidal Anti-Inflammatory Drug at 9:07 PM on July 7, 2011

Response by poster: Interesting idea! So then I'd just cancel the task when I get to my computer?

I think I need admin permissions on WinXP to run scheduled tasks, but I guess there's probably some similar scheduling thing on Ubuntu.

I'd still like to hear other solutions in case I can't get this to work.
posted by lollusc at 9:13 PM on July 7, 2011

Yeah, or have it check the most recent login, or a timestamped file, etc. Ubuntu would have cron, which will definitely do what you need.
posted by Nonsteroidal Anti-Inflammatory Drug at 9:17 PM on July 7, 2011

In Google Calendar:

1. Create a new event that repeats every weekday, with an email reminder.

if the task is "send an email" you're done. If the task is "delete a file or similar" you'll have to:

2. Code something up to watch a mailbox for the reminder message and perform the appropriate action (or maybe there's an existing script for this, it would be kinda surprising if there wasn't.)

Now, each day, log into Google Calendar using the password for the account and edit the event, removing the reminder for that day only.
posted by contraption at 9:21 PM on July 7, 2011

Best answer: If the reset task could be "logging into your ubuntu account", you might be able to do it with the lastlog command. Add a script (python or shell) to cron that runs nightly, checks whether you've logged in in the last 24-72 hours as appropriate to the weekday, and then does whatever.

(Be sure to check exactly what events generate lastlog entries so you know how it'll behave— logging in, opening a terminal window, ssh'ing in, etc.)
posted by hattifattener at 9:40 PM on July 7, 2011 [1 favorite]

Best answer: I would set a cron job to run a bash or Python script on weekdays to send you an email containing a datestamp of some sort. To indicate that you're still alive, you have to reply back before the next one gets sent- that gives you the weekend to reply to Friday's. Actually, I would set it to first check if the last one was replied to. If it was, it would send another query. If not, it sends the "dead man's email".

This assumes that checking and replying to an email is easier than turning off a Gcal notification; I would prefer it greatly.
posted by supercres at 9:44 PM on July 7, 2011

Response by poster: Wow, those are all great solutions! Thanks so much! I marked the last two as best answer because I will try them solution first, since I agree that checking and replying to an email or simply logging into my account is easier than turning off a Gcal notification, and also because it seems like supercres's solution would be OS independent.

I can set up a new email account only on my work computer for this, so that I can't cheat and reply from elsewhere.

(The whole point of this exercise, in case anyone is interested, is that I have an unfortunate habit of deciding in the morning that I could totally have the willpower to be just as productive working from home that day, and then... not. I need to make it relatively necessary to go to work in the morning. (I'm in a workplace where no one cares if I work from home or not). So I'm planning to set a "dead man's email" containing an embarrassing secret to be sent to a friend if I don't show up by 10am to stop it. I plan to make the secret embarrassing enough that it will provide an incentive, but not so embarrassing that it will ruin my life. Yes, I am blackmailing myself. What of it?)
posted by lollusc at 10:44 PM on July 7, 2011 [3 favorites]

Response by poster: Gah, "them solution" should just be "them", obviously.

Also, now I read it more carefully, supercres's solution is not OS independent, but I was looking for an excuse to dual-boot Ubuntu anyway.
posted by lollusc at 10:46 PM on July 7, 2011

Just out of curiosity, what happens if you get sick and take the day off, or it's a holiday and you forget to disable the dead man's switch before a long weekend, or you have a dentist appointment and come into work at 10:30am, or it's team meeting day and you don't go to your desk until lunchtime, or you miss work for a family emergency of some sort, or you were working late on something last night and your boss told you to take the morning off, or your car breaks down/train is delayed and you don't get until work until late? It seems like you'd trip the switch soon enough through some inadvertent action and your secret would be revealed, even though you didn't work from home at all. The tricky thing about blackmail is that once the secret is revealed, the blackmailer loses all his power. Unless you have a large number of quasi-embarrassing secrets about yourself to send to your friend, I don't see how this would last all that long.

I'm sure people would have a number of other suggestions to address the root problem here if you posted a new question about that next week.
posted by zachlipton at 11:31 PM on July 7, 2011 [1 favorite]

Response by poster: Oh, I have a bunch of secrets. And it only has to last long enough that I get back into the habit of going into work every day. Or at least until winter ends and my bike commute isn't so unpleasant!

Also, the secrets don't have to be deep, dark and desperate, just embarrassing enough that it's less effort to go to work than to explain about the email later. I certainly wouldn't use anything that could be a problem if I forget to disable it, or get sick or whatever. I DID consider that (quite likely) possibility.

I'm thinking along the lines of "I once peed in the sink" or something (note: that is NOT one of the secrets). This is meant to be along the same level of annoyance as those alarms which automatically donate money to a charity you dislike if you don't get up on time, only I thought an email thing would be easier to set up.
posted by lollusc at 11:43 PM on July 7, 2011

Response by poster: Also, this is why I said "or delete a file or something" above. I am considering other solutions besides the secret-revelation one. If that doesn't work well (not enough incentive, or I run out of secrets), I'm thinking about options like deleting a random file from my dropbox (which I can always undelete later, but it's enough of a pain to figure out which one got deleted and to log in to the site and roll it back that it might provide some incentive). Or there might be other annoying-but-not-devastating things my work computer could do to me if I don't show up. But underlying any of them was the task scheduling problem, hence my question.
posted by lollusc at 11:48 PM on July 7, 2011

Trivial method: write a script in anything (Python would be easy) that waits some fixed time and then performs the action. Kill the script manually to stop it doing anything.
posted by katrielalex at 7:51 AM on July 8, 2011

« Older What nightmare-inducing Made-for-TV movie...   |   Fever for a mambo, hungary for ? Newer »
This thread is closed to new comments.