28 March 2011

Setting up automated backups to a SSH server on mac os 10.6

This semester I'm writing my undergraduate thesis, and recently I came across the saying that data you don't have backed up at least twice is data you don't care about. Well I don't know about backing up twice, maybe if you have two SSH servers..., but I figure up backing up once is better than nothing.

Now I set up automated backups of my working directory, so that every 3 hours my computer checks whether I modified the files in the directory, and if so uploads the modified files to the server, all thanks to rsync. In order for you to be able to follow the method I used you need: any SSH server (to which you will backup), your computer running OS X 10.6 (though this should work on older versions of OS X as well).

1. In order for rsync to be able to run in the background and automatically, you will need to setup up public keys for your computer and your SSH account as done here: http://www.ece.uci.edu/~chou/ssh-key.html

2. You need to create a shell script that calls rsync to backup your directory over to the server.
I call my script 'backup' and it looks like this:

#!/bin/sh
rsync -qr /Users/maks/Documents/Spring2011/ Maksim@ssh_server.domain.edu:S11Backup

2b. Move this script to /usr/local/bin/backup
2c. Make the script executable by issuing the command chmod u+x backup
Note: You may need to manually mkdir S11Backup on your SSH server.

3. In ~/Library/LaunchAgents/ make the file backup.plist (touch backup.plist), this is the file where you specify when your backup script should be run. Mine looks like this, copy and modify the 'Label' string's key as necessary:





Label
local.maks.daily_backup
OnDemand

LowPriorityIO

Nice
12
ProgramArguments

/usr/local/bin/backup

StartCalendarInterval

Hour
3
Minute
0





4. Issue the the command
launchctl load ~/Library/LaunchAgents


5. You're done! Now every 3 hours your backup script will be run by launchd. To verify that your script is loaded you can execute
launchctl list | grep maks
where you should replace 'maks' with a part or the whole of the key you used for 'Label' in step 3.

10 November 2010

Dreaming

Hypothesis: when I am in the very tired state, lying in my bed, about to fall asleep and I read several poems closely (though for pleasure, not academically) then I am more likely to have dreams.

Data:
Date: 8Nov 9Nov
Read: Yes
Dreamed: Yes

09 July 2010

Refreshing your macbook

So I've been using my macbook for 1y10mo now, and it started feeling slower. Firefox would take forever to load, and booting up took long. The final straw was when it started freezing consistently: that reminded me of my experiences 10 years ago on Win98.

As it turned out the thing to do was to reduce the number of unnecessary processes running. To do this check your /Library/{StartupItems, PrivilegedHelperTools, LaunchDaemons, LaunchAgents}. Here I simply removed everything, most of it was vmnet daemons. Another thing is to turn off apache, and database servers, for me this was turning off psql, and mysql servers. The best way to turn off these servers is through the control applications that come with them.

07 March 2010

audiovisuophilosophical

An art form is only as broad as its medium is versatile. Verse is named so because its medium, the spoken and written word, spans much of human action and thought; and so by virtue of its medium, poetry occupies a central position among the arts. As a result the poet can use language to give his audience the rhythmic pleasures of song, the visceral aesthetic pleasures of fine art, and the pleasures felt from the growth of the mind due to philosophy; I call these audiovisuophilosophical (avp) pleasures.

Edit: it turns out the distinction of pleasures of poetry into these three categories is common. Pound famously names them audio visuo and logopoeia, Zukofsky later does the same without the fancy names.

05 March 2010

Automatically generating bibtex from LOC LCCN records

The Library of Congress has a lot of bibliographical information on all sorts of works. Much to my surprise it doesn't provide bibtex data for their entries. However, this isn't a hard problem to fix, I wrote a two line shell script to do this called locurl2bib (Library of Congress URL to bib). Suppose you want to find the bibtex entry for something that the LOC has, here's how I would do it with locurl2bib:

1. Find the entry at the LOC database.
2. Go to the LCCN record..
3. Copy the address of the LCCN record
4. Run locurl2bib on that address from the command line (on Mac OS X: /Applications/Utilities/Terminal.app), for example enter:
locurl2bib http://lccn.loc.gov/91158031

Installation:
1. locurl2bib depends on bibutils by Chris Putnam. Place them into your exectuable path*.
2. Download locurl2bib and place it in your executable path. Since it's a shell script you can view its source by opening it in a text editor. Have fun looking up bib entries at the LOC!

*On Mac OS X you will want to place the files into /usr/local/bin, and you can open this folder by pressing CMD-SHIFT-G in Finder and typing its address.

12 February 2010

Alternative Definition for Himeroeis

1) Want to understand me (you can)
2) Let me share with you (don't make me afraid by brash judgment; don't immediately assosciate ideas that I express with me, I am exploring what I don't know; try not to categorize what I say into personality traits)
3) Share you with me; let me be someone to you ('What will survive of us is love')

As I sit here coughing slightly, on call for EMS, after a day of leisure spent not on relaxing. My impression of the real world:
1) Most of the people I've known and know don't even meet (1). Big Oops.
2) Two people I know meet (1).
3) One person I know meets (1) and (2); used to (3)--but no longer.

Without a single person who meets (1)(2)(3), it is rather dull.

10 February 2010

Well, I had a poem here, but it's not yet ready. When it will be more ready, I will put it back.

In the mean while, this a wonderful introduction to the Belarusion culture of present and past. So indulge me and enjoy it, and leave your thoughts!

I should mention that I am starting to feel serious about verse in Belarusian.