757

I’m going to Portland. I’ll be there Monday, leave again maybe Wednesday or Thursday.

Everyone who can, please Write something to Eli★.

Efficiently implementing content-negotiation

The only feature of Apache that I miss using Lighttpd is content negotiation.

In a nutshell, content negotiation takes an abstract resource URL like http://example.org/2005/chart and maps it to the files on the filesystem based on the available files and their mime-types, and the mime-types in the requestor’s Accept: header.

Given that URL, an Accept: header suggesting image/svg+xml; q=1, image/*; q=0.5 and the files /www/example.org/2005/chart.png and /www/example.org/2005/chart.svg, the server would see that there is a image/svg type file, which matches the highest preference, and return that along with a Varies: Accept header.

The efficiency problems come from needing to know the available files and their mime-types. At the most efficient, an expensive scan for available files will happen for one hit, and be cached for subsequent hits. However, cache consistency is a difficult problem, and many of the solutions are as inefficient as no caching at all. Very recent linux kernels support the inotify mechanism which would work to monitor efficiently and keep the cache consistent, but it’s not a generally portable solution.

The simplest implementation would take the URL, and check to see if it’s immediately satisfiable — this is the same efficiency as normal serving, without content-negotiation. If it’s not found, then ir must perform a directory listing (one open call, some read calls). This gets expensive for huge directories. (Directories of over 1000 files, though the expense depends on the type of filesystem). Candidates are selected, mime-types mapped, and selected according to the criteria in the HTTP spec. Unless there are extremely many alternatives or an absurdly large Accept: header, computing this isn’t computationally intensive, on the order of O(m * n).

However, to send Content-Length: headers, at least one stat() call must be made, and to handle dangling symbolic links, a stat() for every file under consideration (though since dangling links are an edge case, this could be implemented as a fallback, not normal operation.).

The biggest issues are the ones dealing with unusually large directories, where a linear scan of the listing can take a long time, and if caching is performed, how to keep cache consistency and still gain from the cache.

Thoughts are always welcome. I’ll probably implement this in Lighttpd at some point.

755

I think true joy is the unshakable feeling that life is wonderful.

754

Miri Ben-Ari knocked my socks off.

753

I would seriously tackle these things about GNOME, given the chance:

  • Add a ‘reveal in file browser’ command to Rhythmbox’s context menu,
  • Make the filename display in Rhythmbox and any program that gets it so horribly wrong into one box rather than two, one for folder and one for name,
  • Make the mouse-during-alt-tab work à la MacOS,
  • Make Epiphany block per-window, not the whole process when a dialog pops up.
  • Make process startup times as low as possible, by delaying initialization as much as possible, and eliminating as much as I can.

752

I need to track down some music by Transglobal Underground.

Rails app deployment

I’ve been working on getting mailr to work. It’s not easy.

There’s a host of tiny deployment issues that have to be smoothed out. Shebangs are wrong, developed on a Debian-variant, I can tell — the shebang reads #!/usr/bin/ruby18. There’s dependencies on Rails being installed, being the correct version, and being in a similar place as on the developer’s machine.

It ships in development mode, so one has to understand rails’ three-database development framework before you can install it. The docs assume you know this — I only know it having worked with Rails a little, but your usual sysadmin is gonna have a fit when first they have to install ruby, then install rails, then install a couple other dependencies, then start learning how to develop with rails to get an app off the ground.

There’s evidence in the rails environment.rb that the rails files were copied into vendor/ as is typical of rails, but they’ve been sloppily omitted — I’d prefer that rails worked this way from the start, really, since making local copies is equivalent to static linking. Great if disk space and memory are free, I guess. Makes it a pain to roll out a library update to a bunch of apps, though. Sloppily ripped out is bad, too.

It also requires a DRB backend process to handle persistent connections. That’s no problem, though I had to correct some of the code (and it requires it to be run with the current directory being lib/ in the mailr distribution. There’s no startup script for it, no SysVinit script, no suggestion of a cronjob to start it, nothing. You’re on your own here.

This is something I see a tendency toward in rails. The conventions that are convenient for a developer with a shell always open within the rails app files are a hindrance to actual deployment on a unix system. There’s path issues, lack of startup scripts, and you have to understand rails development process to even get an app running. Keep working, guys.

Oh, and it doesn’t work with my imapd.

750

My camera is at least under warranty.

Note to self: go to the beach at least every 11 months.

749

Photos of human products and waste. Urban grit that’s not like shooting fish in a barrel.

748

I watched Brazil, which is quite definitely the most bizarre movie I’ve ever seen. It’s like Fight Club mixed with Monty Python, some forties detective novels and a bunch of dryer hose. I wish raijna had been there to see it with me. I think I love it but I’m not sure yet.

747

I am blessed to love someone who can share themselves without fear.

I am proud to be someone who can be loved that way.

746

elliotpp‘s post about privilege hit me really hard today. To sum up: When you’re seen as a girl, you can rebel and stand up, stick your chin out when you walk, look drivers in the eye and take the road. When you’re seen as a man — especially a white, clean-shaven, normal-looking man — that’s assumed. Rebelling is quieter, stepping back to give someone space. Not letting someone defer to you when they’re perfectly right where they are. There are no “others” to help. Helping anyone is helping ourselves.

This is something I’ve known and felt for a long, long time, and never expressed well. It’s become one of the paradoxes that I deal with, to be comfortable with the power I carry, and to keep it, to keep claiming it. And to use it to help everyone I can. At the same time, the changes in my life are ones that would stereotypically be putting me at a disadvantage — but do they? The more feminine I end up being, the more opportunity I have to support others by standing up, by not letting others push me about. My loss of privilege is my ticket to take what I can. I’m not sure how I feel about that.

Thinking about Affirmative Action, and the perception problem it can create, that someone can rise because of their race, gender or other minority identity, past those of greater skill. I fear the same perception problem — that I disadvantage myself to prey on the good will of others. My fears make me aware of the opportunities of others, and make me devote a lot of my time to standing up for people, and to seek out those with no voice.

It strikes me initially that there’s a paradox about being transsexual, working so hard to divorce ourselves from the stereotypes of our birth sex, only to have ‘normal’, or even ‘healthy’ be to express those traits as freely as we can.

745

Tagged by silverspring, I now list five simple pleasures I like most.

  1. Rain, more than anything. Rain has always been a soothing force in my life, and I miss it when it’s not around. The first time I danced, no really danced, it was alone and in the rain.
  2. Silence. My world is one of the few that does have silence or nearly so on a regular basis. After 9 or 10 here, the road is quiet. I can go walking and hear the wind on the trees, even if it’s only blowing softly. I hear grasses rustle, and animals moving about in the fields.
  3. Warm tea. Tea is the center of the calm parts of my life. When I really do it right, I can sit quietly for an hour and really just feel and be. It’s my meditation, and it keeps me working all winter. Summer’s heat takes it from me mostly, and I miss it.
  4. Trees with moss under them. They give me hope.
  5. Scarves. I never imagined I would get such joy from throwing a piece of fabric around my neck and charging out into the cold, but I do. I laugh and smile a lot more when I’m wearing them. Start out a bad day, throw a scarf around my neck and tell me to go outside, and I’ll come in smiling.

I don’t particularly want to tag many people, but I’d love to know what klibs has to answer this meme.

744

I really figured out why I fall in love with who I do.

I’m attracted to personal integrity that shows.

743

Gorgeous sunrise out there, and my camera decided to E18. Bastards.

Oh, well. Time for quiet, camera-free walk.