2008.05.17

Washington Post: The U.S. government has injected hundreds of foreigners it has deported with dangerous psychotropic drugs against their will to keep them sedated during the trip back to their home country, according to medical records, internal documents and interviews with people who have been drugged. WTF? Seriously? I don't want to believe it, but it's no longer surprising. 2008-05-17T10:03:21ZUntitled entry permalink

The last eight years of American politics has been so unreal that even McCain is an improvement. Although before America goes imitating Prime Minister's Questions, you may want to watch a few. They are hardly a great advertisement for parliamentary democracy. 2008-05-17T09:57:08ZUntitled entry permalink

The Freethinker has a brilliant interview with Ophelia Benson. 2008-05-17T09:48:07ZUntitled entry permalink

Obama: I won't enforce medical marijuana laws 2008-05-17T09:46:22ZTitled entry permalink

Obama sez: I think our federal agents have better things to do, like catching criminals and preventing terrorism. The way I want to approach the issue of medical marijuana is to base it on science. And if there is sound science that supports the use of medical marijuana and if it is controlled and prescribed in a way that other medicine is prescribed, then its something we should consider.

Ah, sanity from a presidential candidate? The ability to talk about marijuana without rabid froth appearing in the mouth of the speaker? I'm really starting to like the guy.

Only, the Republicans object on the basis that he is sacrificing his constitutional duty to uphold the law. That's rich. Isn't the Constitution just a goddamn piece of paper which you can undermine through signing statements and in attempting to undermine freedom of speech, the right to a fair trial, habeas corpus and other essential freedoms. If it's a choice between not enforcing fundamental civil liberties and not enforcing medical marijuana laws, oh boy does America need Obama.

Using Git for application preference tracking 2008-05-17T14:49:26ZTitled entry permalink

My parents are using Git. Only, they don't know it. They use Apple's Aperture, a professional photo management tool for the Mac. But one point of irritation is that if you go and set up a bunch of printer presets on one user account, you then need to do it all again for the other account. Having a geek nearby helps with this sort of thing, especially if they are proficient in that Satanic language called AppleScript, and with some non-shitty languages too.

Here's how you do it - turn the application's preference folder into a Git repository (in this case, ~/Library/Application Support/Aperture - note the space!). Then you need a pretty interface - because non-programmers don't use the command line. This is where CocoaDialog comes in. It's a really simple utility you can invoke which will let you get user input. Fire off a little thing for a textbox to get the commit message, then pipe that back to Git. I used Ruby as my glue language, but if you are so inclined, you can use any scripting language - Python, Perl etc. If you are a Mac programmer, you could build your own interface on top of Cocoa and Objective-C. Static typing makes me say "meh", so I used Ruby. Which is fine, since Ruby is sexier than your programming language of choice.

The rest then is pretty easy - make it so the person can trigger the AppleScript in whatever way seems sensible - from the Script Menu, from Quicksilver or LaunchBar or whatever else you can think of.

Then you set up a cron job to 'publish' the git repository, which is as simple as copying it to a public location - I used /Users/Shared/ - and then set up another cron job for each user to do a git pull from the repository. You now have a one-to-many preference sync system. Why not just use a script to copy the files over? Well, you can use .gitignore on each repository, thus keeping some of the preferences separate (in Aperture, you may want to sync the print and export settings, but not, say, metadata or keyword settings). And you get the advantage of having a full change history - meaning if a person screws up their preferences, it is possible to just revert them.

If you want to do many-to-many sync, it’s actually extremely difficult in this scenario. Despite the fact that Apple’s property list format is all XMLish (although it uses element sequentiality rather hierarchy than to mark relations, which is somewhat demented), the printer preferences for Aperture are actually stored as binary-in-XML. I know. It makes me want to smash my head against the desk in sheer frustration. The binary format makes doing hand-merges a pain in the arse. It’d be possible to write a way of merging the relevant property list files, but it’s something I’d rather avoid.

Does this need Git? Well, no. You could use CVS, Subversion, Mercurial or Perforce if you like. Git adds nothing special, except for the fact that it’s made of unadulterated win - and it’s the version control system that I now have burned into my brain. That and the repos are tiny, checkout times are really fast and so on.

Links from del.icio.us

 

Login with your OpenID:
No. 810
Tom Morris
Currently in: East Sussex, England
Usually in: East Sussex, United Kingdom
AIM: tommorris
YIM: tom.morris

I am a , an , like to code in and noodle about with and the . I also have a BA in philosophy from London, and am in preparation for an MA. My philosophical interests are in Victorian-era German philosophy, Kierkegaard, Robert Nozick, hermeneutics and current approaches to the demarcation problem in the philosophy of science. Musically, I like jazz fusion, soul and P-Funk. My musical nirvana would be a mixture of Beethoven, Miles Davis and George Clinton topped with a side-serving of Erykah, Jill and Angie.

Elsewhere:

  • GPG Key
  • del.icio.us
  • Flickr
  • Twitter
  • digg
  • Jaiku
  • LinkedIn
  • ma.gnolia
  • blip.tv
  • upcoming.org
  • MetaFilter
  • LiveJournal
  • CiteULike
  • Technorati Profile

RSS Feed Subscribe:

RDF

« May 2008 »
SuMoTuWeThFrSa
 123
45678910
11121314151617
18192021222324
25262728293031

View in month context

On this day in: 2006 2007