• Amazing Stories of Polio – in a shop window

    317-polio1-thumb-300x390-316.jpgOne reason I’ve posted less and less to my blog this year is because I’ve joined a Rotary club. Rotary has been a tremendous amount of fun and given me a real big buzz of feel good factor seeing the difference my effort, combined with others, can make as we ‘Do good things‘.

    The best thing for me this year has to be converting an empty shop window in Canterbury to an educational display about Polio, re-using enlarged images from a comic called “Amazing Stories of Polio”. I’m going to unashamedly claim credit for the idea of this window display, or at least, I joined ideas from other places to come up with this one. However it wouldn’t have happened without the help, both in time, effort and resources of friends who shared the vision.

    We’re not talking a small effort either. From getting permission to re-use the artwork, to finding the shop, to the managing agent agreeing, to the graphic design, the printing of the large panels (which in itself took many hours) and the hours spent hanging them carefully in the window of the empty shop.

    I’ve still a lot of things to write about the window project and I’ll probably never be satisfied with anything enough to put it here in full. So, without further ado, why not follow this link to the artist, Steve Buccellato’s blog to read all about it.

    Other ideas are in the pipeline. I expect I’ll be posting less and less to this blog as a result.


  • Backups for Google Calendar – a ruby application

    I admit I’ve not been so busy posting the to blog this year. One thing that’s kept me busy has been learning Ruby on Rails making my first opensource application.

    I’m a hobby programmer, so the idea of sharing my code is worrying. I’m sure there are lots of errors, bad practice and so on. On the other hand, I had a problem to solve at work and the application I wrote may help others. I use lots of open source applications for home and work so it seems only right to share my efforts with others.

    What have I created? An application that backs up google calendars for all of our office users.

    Why? Because occasionally we delete something we didn’t mean too. For example Mrs X phones up to cancel an appointment with Mr A. Mr A is out of the office but Mr B can edit Mr A’s calendar, so deletes the appointment. Except Mr A had all the Mrs X contact information on that appointment and hadn’t yet created our own internal computer record. We’ve no longer got any way of contacting Mrs X.

    How? The application I wrote reads the Private XML feed of a google calendar. That contains the most recent newly created or amended appointments. I check each entry in that feed to see if it’s new, or if it’s an existing appointment that’s been modified. If they are new or modified, I add them to a database. If they’re old and unchanged, I ignore them.

    One thing to note – it doesn’t restore appointments. As you’ve got all the content though, it shouldn’t be so difficult to add it again should you need to.

    Where to get it? I’ve shared it through github – http://github.com/steveroot/Google-Calendar-Backup


  • CRON – multiple cron jobs on one line (running consecutively, not concurrently)

    This post will (hopefully) remind me in the future how to do something very simple.

    A crontab is normally running one command on each line. EG:

    # m h dom mon dow command
    01 00 * * * /home/cronscripts/vine-warn-when-large-user-profile
    05 00 * * * /home/cronscripts/vine-get-remote-pc-backup.sh
    01 01 * * * /home/cronscripts/vine-samba-users
    01 02 * * * /home/cronscripts/vine-database-backups

    So the above jobs run at 00:01, then 00:05, then 01:01am then 02:01am.

    Instead, I can run these cron tasks one after the other by putting && between each task. EG:

    # m h dom mon dow command
    01 00 * * * /home/cronscripts/vine-warn-when-large-user-profile && /home/cronscripts/vine-get-remote-pc-backup.sh && /home/cronscripts/vine-samba-users && /home/cronscripts/vine-database-backups

    So these jobs start running at 00:01am. When vine-warn-when-large-user-profile finishes, vine-get-remote-pc-backup.sh starts immediately, and so on.

    Why is this useful?

    I have several backup scripts for our linux servers. Each script creates a tar archive of a directory, compresses it, SFTP’s it off site, then deletes the tar archive from the server.

    If the scrips all run at the same time, the server runs out of disk space. I need them to run one after the other. I can’t effectively guess when to start each one. The backup can’t start until after midnight and must be finished by 7am when users are likely to start work again. Some directories can take minutes to archive, compress, send, delete. Others can take 2 or 3 hours. One server also collects backups from a couple of other places, so that script has to complete before others start too.

    Running this scripts concurrently means no useful transfer time is lost and I don’t have to guess the time each script will take to run.


Search this site


Free apps

  • birthday.sroot.eu – Your birthday or other celebration date based on [years on other planets] / [how many seconds/days] / [how far you’ve travelled around the sun]
  • stampulator.sroot.eu – Calculates the combination and how many 1st, 2nd, large 1st and large 2nd class Royal Mail stamps you need on large envelopes and packets

Recent posts


Archives


Categories