What are the best Web Galleries?

I am one of the few avid MobileMe users. I use the gallery and like it. Nice upload features, integration into iPhoto. Not perfect, but it does the work, plus I have lots of disk space. However, Apple makes the transition from MobileMe to iCloud. During this transition, several features of MobileMe will be dropped. Besides the very useful syncing of keychains between computers, the gallery will cease to function. Some strange photo stream service will be introduced, which does not seem to be a real gallery replacement, but more like a large cache of you last 1,000 pictures taken. Useful, but only to a limited extent. So what are my alternatives? I need (in order of importance):

  • Share with other people (who are not signed in, a la Facebook)
  • 5-10 GB space for pictures or more
  • Able to make photo albums, user gets a nice web browser based viewer
  • Option for users to download the photos
  • Optional high resolution versions of photos (2048 pixels or more)
  • Good integration with iPhone, iPhoto et al.
I would pay for that service, if it includes 10 GB space or more. 
I already found out that Flickr and Picasa Web offer unlimited space, but in the free version there are quite the restrictions (limited image resolution, image usage by hoster, limited number of photos that can be controlled, advertisements, …). Plus for example the Picasa Web Uploader for the Mac is horribly outdated (iPhoto ’08…?).
So what other options are there? Which one is the best?

Accessing the keychain in OS X from the command line

There is a very useful utility called security(1) in OS X, which lets you manipulate your keychain from the command line. You can easily im- and export keys and certificates using this. This is especially useful for AppStore developers, who code on multiple Macs. Having the signing keys in sync is kind of a challenging solution, if you don’t use keychain syncing via MobileMe. For example you can import a key like this into your login keychain:

$ security list-keychains
"/Users/yourguy/Library/Keychains/login.keychain"
"/Library/Keychains/System.keychain"
$ security import -k /Users/yourguy/Library/Keychains/login.keychain somekey.pem
1 key imported.

Hope this helps.

Note to self: codesigning for OS X and iOS on the command line

As a reminder for myself, here is how you can codesign an OS X application for the AppStore on the command line:

codesign -f -s "3rd Party Mac Developer Application: Your Company" -v YourApp.app
productbuild --component YourApp.app /Applications --sign "3rd Party Mac Developer Installer: Your Company" YourApp.pkg

There is a lot more to do, of course, like having the correct bundle ID set, but this speeds up codesigning, if you do not use XCode to build your application.

For iOS it is pretty similar, except you don’t need the productbuild:

codesign -f -s "iPhone Distribution: Your Company" -v YourApp.app

Valgrind checking of iOS programs

Well, this is awesome news. First, valgrind has been available for OS X for some time now. And second, you can use it to check your iOS programs on the simulator with it.

The idea here is to let your program spawn valgrind itself. Because you cannot tell the simulator to run the program through valgrind. Well, maybe you could build a funky bundle, but I think this works just fine. So here is the  code, taken from the above link:

#define VALGRIND "/usr/local/valgrind/bin/valgrind"

int main(int argc, char *argv[]) {
#ifdef VALGRIND_REXEC
/* Using the valgrind build config, rexec ourself
* in valgrind */
if (argc < 2 || (argc >= 2 && strcmp(argv[1], "-valgrind") != 0)) {
execl(VALGRIND, VALGRIND, "--leak-check=full", "--dsymutil=yes", argv[0], "-valgrind",
NULL);
}
#endif

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"PeepsAppDelegate");
[pool release];
return retVal;
}

You will obviously want to define the VALGRIND_REXEC macro, if you need valgrind output. You can also pass different command line arguments to valgrind. E.g. you can switch to different valgrind tools this way, or pipe everything to a log-file.
Update: I finally got around to trying out this method. One problem here is that valgrind will fail to run, since it tries to open /dev/random, which I guess is not allowed for sandboxed applications. But one can fix this by patching and recompiling valgrind, which is not too hard. Especially when using MacPorts. Furthermore, I needed to add –dsymutil=yes to the valgrind options, or else the program would just crash.

Pimping MobileMe #1: Expiration dates on folders

Well, MobileMe does not yet support the expiration of mails in folders. Especially for mailing lists, I want this feature. After let’s say 90 days the mails should be automatically deleted. I do not need to store mailing list contents for longer. So I took the nice tool imapfilter and wrote a config file that expires old mails from a selection of folders. I installed a cronjob on my web server that now automatically calls imapfilter every night. The config file (~/.imapfilter/config.lua) looks like this:

Myaccount = IMAP {
   server = ‘mail.me.com’,
   username = ‘your.name@me.com’,
   password = ‘yourpassword’,
   ssl = ‘tls1’
}


folders = {‘folder1’, ‘folder2’, ‘folder3’}


for k,folder in pairs(folders) do
   foldername = ‘Mailinglists/’ .. folder
   results = myaccount[foldername]:is_older(90)
   myaccount[foldername]:delete_messages(results)
end

My mailing lists are hosted under a sub-folder called “Mailinglists”, as you can notice in the config file above. You can tweak this to your liking. It might also be useful to set different expiration dates. It’s easy to augment the lua script to do so.

Migrating from GMX IMAP to MobileMe IMAP

I am currently migrating my >4GiB of mail data from GMX to MobileMe. I have been using offlineimap regularly to backup my mail data. So first step was to update the backup. Now the next step is to run imapsync, which can migrate whole IMAP accounts. The full command I am using for this is:

imapsync –sep1 ‘/’ –prefix1 ”  –ssl1 –ssl2 –authmech1 PLAIN –authmech2 PLAIN –host1 imap.gmx.net –user1 “yourname@gmx.de” –host2 mail.me.com –user2 “yourname@me.com”

I will report back once the sync has finished, this might take a while.

Update: Yup, it worked. My mail is now hosted on MobileMe. More disk space. What is missing at MobileMe is that it does not support automatically expiring mail folders. I.e. for mailing lists, I sort the mails into subfolders for each list. The lists are often high volume traffic, and not very important. So I’d like the mails to expire after, say, 30 days. With GMX this was not a problem, but MobileMe does not yet have such a feature. However, I found a nice tool called imapfilter. It allows you to do all kinds of stuff, besides other things it allows you to filter mails according to date and to delete them. This is what I will do. I’ll write another post, when I found out how to do that exactly.