suburbia

Premshree's (品速力) Personal Weblog

etc.

Previous Entry Add to Memories Tell a Friend Next Entry
UpcomingFS
suburbia
[info]premshree

I like to use the terminal when I can. Presenting UpcomingFS—access upcoming.org event information:

[ppillai@renegade ]$ ./upcomingfs.rb /tmp/fuse/ &
[1] 10700
[ppillai@renegade ]$ cd /tmp/fuse
[ppillai@renegade fuse]$ ls -1 texas
66002 - Nine Inch Nails
74539 - Suds on Sixth
77608 - Exposure Dallas - See and be seen.
77609 - Exposure Dallas - See and Be Seen.
[ppillai@renegade fuse]$ 

You can also view events in a city within a state (it doesn’t seem to work very well, though):

[ppillai@renegade fuse]$ ls -l massachusetts/boston | grep BarCamp
71709 - BarCamp Boston
[ppillai@renegade fuse]$ 

To view an event's details:

[ppillai@renegade fuse]$ ls -1 massachusetts/boston | grep Band
79932 - Live Band Karaoke - Beatles Night!
[ppillai@renegade fuse]$ cat 79932

Live Band Karaoke - Beatles Night!
==================================
                 
The Milky Way is hosting a special Beatles theme at the first and best Live Band karaoke night in Boston.

Sing the Beatles backed by a live band!

Prizes for best song and best costume.
No cover, as always.
22:00:00 to 01:00:00, 2006-05-30 to 
[ppillai@renegade fuse]$ 

To unmount the filesystem:

[ppillai@renegade fuse]$ cd..
[ppillai@renegade tmp]$ fusermount -u /tmp/fuse/
[ppillai@renegade tmp]$ 

Get the code here. You’ll need fuse and the ruby bindings. (I just got a Linux box; it’s got to be of some use other than writing Java.)


(Leave a comment)
This is just...crazy. I once tried to write a simple read-only user-space filesystem using NFS and C, and implementing all these NFS functions took quite a lot of effort. Now FUSE and Ruby seems to have simplified the whole process a lot.

You shouldn't have gone the NFS way ... assuming the VFS way was available at the point.

Actually, FUSE is what has simplified things. There are several language bindings available.

Cool. How about packaging it up into a gem for us lazy folk?

When i try to wget the script i get

HTTP request sent, awaiting response... 503 Service Unavailable
08:23:00 ERROR 503: Service Unavailable.

-Suman

Could you try again? There doesn't seem to be any problem:

[1] premshree: ~$ wget http://premshree.seacrow.com/code/ruby/upcomingfs.rb
--10:06:57--  http://premshree.seacrow.com/code/ruby/upcomingfs.rb
           => `upcomingfs.rb'
Resolving premshree.seacrow.com... done.
Connecting to premshree.seacrow.com[72.3.253.73]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2,803 [application/octet-stream]

100%[==========================================================================================================================>] 2,803          2.67M/s    ETA 00:00

10:06:59 (2.67 MB/s) - `upcomingfs.rb' saved [2803/2803]

[2] premshree: ~$

Nice. Except I am having problems compiling fuse on BSD. Should be a charm with my linux at home...

It won’t compile on FBSD. It supports the Linux kernel 2.4.21 and later. FWIW, there’s a Fuse for FreeBSD project.

nice hack. ruby code is so well written that a ruby novice like me can grasp it quick.

good work.

Thanks. :-)

And welcome to LJ!

(Leave a comment)