Blog /What to do in the Event of a Spontaneous Ejection

May 13, 2009 03:40 +0200  |  Employment Geek Stuff Linux 3

It happens, especially in recessions and when it does, there's often little or no warning. You come into work on a Friday, work through the day, and at the end of the day, as you're heading out of the office, the boss comes to you and says something to the effect of: "Sorry, but you're done here."

Not long after you manage to get over your panic attack, your boss drops another bomb: you're not allowed to access your computer again. All of your personal email and/or files that you have on there are going to be backed up into hard drive somewhere and gods know what the sysadmin is going to do with it.

Now one might argue that if you're putting personal stuff on a company computer, the company owns that stuff, and legally speaking, you might be right, but morally, it's your stuff that you access at work because work takes up the vast majority of your day. It only seems fair that if they're going to give you the boot with zero notice that you have a chance to keep your emails and IM conversations with friends and family private.

So, in case you've ever wondered what might be a good way to keep your data more-or-less safe in such situations, I thought that I would post a little how-to here.

Option One

Don't put personal information on your company computer. It will save you all kinds of hassles, even if it does make life at work considerably less bearable.

Option Two

If you're going to put personal information on your company computer anyway, the best way to secure it is to have your computer continuously check a remote source (under your control) for instructions. You can then leave the instructions blank until Something Bad happens. For example, on a Linux machine:

  1. Create a tiny script file (call it "remoterun" for the sake of this example) and put this in it:
          #!/usr/bin/env sh
          curl -s | sh
    Now make it executable.
  2. Log into the server hosting and place a file called instructions.txt in the document root. It can contain anything you want to execute on your machine. I recommend the deletion on your home directory (so long as there's no company data in there) and the removal of your personal account from the box. If you choose though, you can be a little more zealous and delete your music files, any background wallpapers you if you want. Just don't delete anything belonging to the company or they will be well within their rights to come and kick your ass in all kinds of unpleasant ways. Here's an example of a simple instructions file:
          # Delete my music
          rm -rf /opt/share/music
          # Delete my account
          userdel --force --remove daniel
          # Delete the remoterun script
          rm -f /path/to/remoterun
    This part is very important: Do not put anything in this file that you do not wish to run immediately. The above would nuke your personal data, so only put destructive instructions in the file when you actually want to delete stuff. Until then, you can just leave it blank.
  3. Now that you have an instructions file, you just need to make sure that your office computer runs the remoterun script every hour or so. That way, the machine will run your instructions within an hour of you setting them up on In Linux, you can do this with cron:
    # crontab -e
    That will allow you to edit the crontab for the current user (be root, it's best for this kind of thing). Now you just add the crontab line:
    00 * * * * /path/to/remoterun

That's all there is to it. Every hour, your office machine will connect to and execute whatever instructions.txt says. Windows users, I'm afraid you're on your own but the theory is the same.

Now remember kids, use your powers for Good, not Evil. I've provided the above so you can be a responsible person while protecting your private life from someone who shouldn't have access to it anyway. I hope that you will do the same.


13 May 2009, 4:59 p.m.  | 


Now all I have to do is edit this file ...hmmm...

13 May 2009, 5:43 p.m.  | 

Oh please, like I didn't think of that. Different name, different host dude :-)

17 May 2009, 12:50 p.m.  | 

can I use my powers for mediocrity?

Post a Comment of Your Own

Markdown will work here, if you're into that sort of thing.