fogbound.net




Thu, 8 Mar 2007

Automated Backups – Updated!

— SjG @ 3:50 pm

[Update — fixed the link!]

Automated Backups are a good thing. Automated Backups make the little birds sing, the rainbows shine, and little fauns gambol about in beautiful green forests. When computers are backed up, the butterflies flutter, the flowers bloom, and the fruit from the trees taste just a little sweeter. But when computers are not backed up, the universe becomes angry.

An angry universe is not a good thing. An angry universe makes little birds cry. An angry universe makes Cthulhu come and visit.

So. Automated backups. I’m partial to rdiff-backup because it allows me to not only back up data, but keep previous versions available. Backing up nightly doesn’t help if you accidentally overwrite the contents of a file with something, and don’t notice for a day or two. But with rdiff-backup, you can restore the version before the error.

Unfortunately, rdiff-backup really is designed for server-to-server backups, where each end of the transaction has shell access. Enter duplicity, a related project. It’s more designed for storing backups on servers that you don’t control and/or don’t trust. It allows encryption of your backup sets, as well as supporting a wider variety of protocols (ftp, scp, s3, etc.)

So with a combination of these two scripts, you can backup pretty much any POSIX-ish server to pretty much anything that you can ftp or ssh into. Still, it’d be nice if you could:

  • Check that the backups completed successfully, and get email confirming that success or warning on a failure.
  • Configure up all of your various backups by a simple text file, rather than remembering the different command-line formats.
  • Create groups of options that can be applied to backup tasks.
  • Issue commands on the backup source and destinations before and/or after the backup (good for dumping databases into a flat file, for example, and then deleting it after it’s backed up).
  • Get email confirmation on completion of backups.
  • Have some tools to simplify the securing of the backup process.

For these reasons, I put together this backup script, which is basically a Ruby wrapper for rdiff-backup and duplicity. It’s almost entirely configured via two human-readable yaml files.

It’s flexible, reasonably simple to use, and comes without any guarantees whatsoever. Feel free to use it yourself!

DISCLAIMER: it’s as-is. Not to be used in place of a certified Cthulhu-deterrent. Use at your own risk. To quote the duplicity page: “[it] is not stable yet. It is thought to have a few bugs, but will work for normal usage, and should continue to work fine until you depend on it for your business or to protect important personal data.” — that goes for me too, only double.


Tue, 16 Jan 2007

Javascript in Photoshop

— SjG @ 9:21 pm

Ah, it was such a happy day that a Photoshop junkie and programmer geek discovered that Photoshop could be scripted with a Real Object-Oriented Language, like Javascript!

And yet, as time goes on, this happiness is mitigated. Egregious bugs (such as the failure of Selection.bounds) pop up, requiring internet searches to get the workaround. Then, there are unexpected things, where the document units are not honored for selection translations.

Even worse, it dawns on the programmer that many useful functions are missing — functions that seem like natural features for scripting Photoshop — like, say, getting the RGB value of an arbitrary pixel from an RGB document, or getting the transparency of said pixel, or, even, say, changing that value. Of course, there are workarounds for all of these functions (e.g.,this ). But why should I need fifteen extra lines of code?

Then, there are errors that are in my code. I find that aliasing is a big problem when I’m creating virtual triangles and then getting the pixels from within them. For example, my script for simplifying the creation of images like this:

tessel-test5-big.jpg

has enough slop in the aliasing combines with the rotations and translations to yield problems like this:

tessel-test-detail.jpg

So maybe it’s time for me to start implementing this kind of thing in a vector-based program. I’ve played with the demo of Intaglio, and it looks good. And it’s scriptable too, albeit only using AppleScript, which I’ll have to learn.


Wed, 3 Jan 2007

Software: is it too much to ask?

— SjG @ 2:22 pm

OK. Entrepreneurs, read up. I’m gonna give you some ideas that’ll make you rich.

Start my ranting:

1. Can I really be the only person who wants to share Thunderbird/Seamonkey address books with a spouse? I mean, how hard can it be?

What I’d like:

  • Each of our “Personal Address Book” collections show up as a list on one another’s address books as a list (e.g., mine shows up on my wife’s machine as “Samuel’s Address Book”. It could use the machine name instead, if it’s easier).
  • We can see one another’s mailing lists in our address books
  • Manual sync is fine — automatic would be even better
  • Simplistic merging is OK, so long as there’s a way to resolve conflicts
  • Ability to mark lists as private or shared

2. Can I really be the only person who wants to share a checkbook program with a spouse? I mean, how hard can it be?

What I’d like:

  • Ability to enter checks / charges / deposits into a common account register
  • Ability for either person to perform reconciliation
  • Ability to have accounts that are not shared

3. Can I really be the only person who wants to have an intelligent, revision-capable backup script that doesn’t require shell on the destination end? I mean, how hard can it be?

What I’d like:

  • rdiff-backup, only permitting an ftp-based push of the backup file.

More to come, as I experience more outrage.


Fri, 29 Dec 2006

eAccelerator Weirdness

— SjG @ 4:52 pm

I’ve been busy setting up a new hosting environment for a bunch of static HTML and PHP-based web sites on a Go Daddy Virtual Server. It was going swimmingly, until I came to an old CMS Made Simple site (running 0.10.x), which merely returned blank pages. Newer versions of CMS Made Simple ran fine. I could find nothing in the virtual host’s web error logs, the php log, the mysql error logs, the eaccelerator error logs, or any other system logs — except in the main Apache error log, there was:

child pid XXXXX exit signal Segmentation fault (11)

Searching around, this looks like it could be some kind of threading issue; however, I’m following the recommendations and using the Apache 2 prefork MPM.

Eventually, the (weak) solution I came up with is to turn off eaccelerator for that virtual host. This remedies the situation, although I can’t say it makes me very happy, since I don’t understand exactly what’s going on (or what the problem is).

I’d welcome insight into this.

Details: Fedora Core 4, Apache/2.0.54 (Fedora), PHP 5.0.4, eAccelerator 0.9.5.


Thu, 28 Dec 2006

Who Controls the Internet?: Illusions of a Borderless World

— SjG @ 12:30 pm

by Jack Goldsmith and Tim Wu, Oxford University Press, 2006

This interesting three-part book describes the evolution of the Internet from an academic network governed by utopian techno-idealists into an increasingly partitioned collection of networks under the control of national governments. It also predicts that the future will continue in this direction of many localized nets.

The overall conclusion of the book is that this evolution is a (mostly) Good Thing[tm], as human beings can’t be trusted to conduct business without the treat of violence. The assumption that the purpose of the internet is to facilitate business is not really questioned. Of course, I’m oversimplifying their case. There is also discussion of the value of information, its relationship to proximity, and the desire to allow enforcement of local standards.

I remember many of the events described in the history — most notably, the transfer of the DNS Root and its aftermath — but can’t say I really appreciated their significance at the time. I do recall being impressed with the anarchic, cooperative culture of the early internet. The philosophy of the Cypherpunks (e.g., “information wants to be free”) is a compelling idea, except when it comes to my credit card number. John Gilmore’s famous saying that “the net interprets censorship as damage, and routes around it” is also a sentiment I still feel is powerful, but I fear that the mechanisms of censorship are getting ever more sophisticated. I also still have hope that ubiquitous communication can help humanity.

However, Wu and Goldsmith’s points are well made. I remember, in particular, believing in 1995 that the internet was going to connect everyone in the world, and promote an unprecedented era of communication and peace. After all, I was in communication with people all over the world using the internet (in English, of course). Then, in December of ’95, I embarked on a trip through Asia and the Middle-East. Something about these utopian beliefs kept nagging at the back of my mind as my travels progressed, and I met people in different countries and from different backgrounds. It wasn’t until months later, on a bus ride through the Sinai Peninsula, where from my window I could see Bedouins struggling against a mini-sandstorm that the realization broke through. Yes, these people and I share a common humanity — but then, that was about the limit of what we shared. If I were to visit with them, I could perhaps learn of their beliefs, culture, hopes, expectations, and so on. But simply tapping words into a keyboard from half a world away, such an exchange would be nearly impossible. How could I begin to understand their world without seeing, feeling, and smelling it?

Well, today, I have friends I have never personally met, throughout many nations that I have never visited. I chat with them, some daily, as I work on projects. I communicate with them mostly in English, a little bit in German, and even less in Spanish. Does this contradict my pessimism above? Well, yes and no. We have a common starting point (e.g., the projects), and, to be frank, relatively common culture: we are, for the most part, Europeans, Americans, Australians.

So maybe the internet is not the borderless world we once hoped for, but it’s also not (yet) the parochial collections of fiefdoms that it could become.