zmugfs 0.1 RELEASED!

After two and half months of development, I would like to announce the first release of zmugfs (yes, the Halloween release) :). I was inspired to write this program when I got my wife, Elizabeth, to try out Fedora to import her digital pictures because “it just works in Fedora”. But uploading using the website was a bit lame, so I thought, “it would be cool if you could open up nautilus and see your pictures, then copy them to the folder to upload them”.

That’s how zmugfs was born. What the heck is zmugfs? It’s a FUSE-based filesystem written entirely in python (my new favorite language) which connects to your account on using their JSON apis.

DOWNLOAD zmugfs here!

zmugfs requires zmugjson and fuse-python to work, actually requires a paid account to be useful.

Installing on Fedora 7:

  • yum install fuse-python
  • download the f7 rpms of zmugfs and zmugjson
  • configure it with your username and password ($HOME/.zmugfs/zmugfsrc or /etc/zmugfs/zmugfs.conf)
  • /usr/bin/zmugfs <mount directory>
  • DONE!

Installing on Fedora Core 6:

  • yum install fuse-python (from the extras repo)
  • download the rpms of zmugfs and zmugjson
  • configure it with your username and password ($HOME/.zmugfs/zmugfsrc or /etc/zmugfs/zmugfs.conf)
  • /usr/bin/zmugfs <mount directory>
  • DONE!

Or if not a Fedora user, and you should be, try the tarballs.

Here’s a sample config file:
# number of images to cache
# amount of image data to cache in megabytes
# 50 ~ 25 images

Halloween at work

Tonight we had our annual Halloween party for the kids at work. My boys talk about this even ALL YEAR LONG! This year they went as Jedi’s, Adan as Obi-wan and Marco as Anakin. They even posted to show off their Jedi skills. Here are some of the pictures, be sure to check out the gallery for more.

“toasted” oatmeal

IMG_0038, originally uploaded by jmrodri.

On Sunday morning, the boys come in to get me out of bed at 8:30am. Adan and Marco proceed to tell me they tried to make oatmeal. I was immediately thinking they spilled something. Then Adan says they couldn’t get the oatmeal out of the microwave because it was too hot. So far I’m thinking, wow not bad. Then Marco says it’s hot and black. That’s when I start to worry.

I walk downstairs to a stench I can only describe as burnt popcorn. That blackness you get when microwaving something for a bit too long. I walk into the kitchen, see two cups of milk on the table with napkins our usual setup. A bowl of oatmeal on the counter with milk already poured in and the gallon of milk on the counter as well. No spills or any problems so far. Then I look in the microwave to see the “toasted” oatmeal with the metal SPOON still in the bowl. SIGH! Then laughter.

I was proud they were 95% of the way through the oatmeal routine which means they have been paying attention this whole time 🙂 and they didn’t make a mess at all. Not one drop of spilled milk.

I asked the boys, “how long did you put it in for?”. Adan replied, “four zero seven”. So I told them nicely, “aw, no it’s only 70 seconds. And you can’t put metal in the microwave.”

I put the bowl in the sink to soak in water. Sunday night, I took a picture of it. It probably won’t come out because it still look bad after soaking in water all day.

rpm tip

I was writing a spec file today, yes I like writing them, and wondered what macros were defined. I looked in /etc/rpm/ but couldn’t find the one I was looking for. But as we all know, man is your friend, a quick 'man rpm' revealed --showrc.

rpm --showrc will dump out the config including macros and their values.

disk cache for zmugfs

Tonight I wrote the disk caching logic (well most of it). zmugfs will now look in the memory cache for the imgdata, if it doesn’t exist it looks in $HOME/.zmugfs/cache for the file. If it can’t find it there, it does the final attempt to read it from smugmug itself.

I haven’t figured out how I’m going to calculate the size of the disk cache, that’s the last step to finishing that feature, otherwise it’ll use whatever disk space you have.

That’s it for hacking tonight. Off to watch TV.

zmugfs fixed on Fedora 7

Yesterday I ran into a slight road block with simplejson. But with some playing around in the python interpreter I was able to see what the problem was with how simplejson 1.7 calls object_hook.

Take for instance the following string:

simplejson 1.3 would pass the above string into the object_hook as is. With 1.7 {u’key’: 10} is passed in first, followed by {u’foobar’: u’baz’, u’array’: [10, 20, 30], u’comp’: None}

Unfortunately, when {u’key’: 10} is passed in we have no context as to what this is.

I know, you all want to know what my solution was to the problem. 🙂 Well, it was quite simple, I continue to look for the key “Categories”, but if the argument does not contain it, I return the string unaltered. That’s it. Now zmugfs works on Fedora Core 6 and Fedora 7.

zmugfs on Fedora 7

I tested out zmugfs on Fedora 7 today and it completely blew up. The objecthook function being passed into simplejson.loads() behaves differently. On Fedora Core 6 (using python 2.4.4 and simplejson 1.3) my objecthook method is called once with the entire JSON response which I can parse and return a Tree object. On Fedora 7 (using python 2.5 and simplejson 1.7) it gets called 152 times with each call being a subset of the original response.

I really would like it to run on Fedora Core 6, but it’s pretty dead since Fedora 7 has been out and Fedora 8 will be out soon enough.

So will zeus abandon FC6 support for something new like F7 or F8? Or will zmugfs be updated to work on all Fedora’s? Stay tuned for more zmugfs on zeusville. Same zmug channel, same zmug time!

<insert cheezy soap opera music here>