Archive for September, 2008

The Beard Project: Week Two

If you are wondering where week one is or went, sadly, like all my stunningly good ideas this one came a week late so there is no week one.  Anyways, on to the project.

Boredom, that is the primary driver here, that and seeing if I can grow a luxurious beard.  I have tried in the past but often abandoned it before the close of the fifth week out of itching or raised eyebrows and tsk-tsking from my wife.  This time I figured what I needed to see the project through was a visual reminder of my progress and the pressure of the Internet.  Let’s weigh the pros and cons…

Cons

  • Itches like hell
  • My wife disapproves of facial hair experimentation
  • Traps food

Pros

  • My daughter strokes it like a cat and says, “Niiiiiiiice.  Niiiiiiice.”
  • It gets me one step closer to my goal or rocking it like Shel Silverstein
  • Ups my *nix street cred
  • My wife disapproves of facial hair experimentation

Will I make it to week three without shaving it off?

Caching Static Assets Made Simple with Nginx, Varnish, S3

We serve some of our assets directly out of s3 and while it is convenient it is not the speediest way to deliver content.  The crew over at Viximo worked out how to bolt Varnish on the side of Apache so that they can cache their S3 content and I was so smitten with the idea that I wanted to adapt what they worked out for our configuration so I asked Chris Chiodo reveal the secret sauce.  Below are the configuration files I munged from what he generously shared.

Nginx

This is pretty straightforward, what I’ve done is made varnish an upstream server and am intercepting any content in photos, avatars, kit, or caboodle and passing it the request to it.

upstream varnish {
server varnish01:7000 max_fails=3  fail_timeout=30s;
}

location ~ ^/(photos|avatars|kit|caboodle)/ {
proxy_pass http://varnish;
}

Varnish

This was my stumbling block until I talked to Viximo, the problem was how I defined the backend and that for whatever reason it did not like or AWS did not like the request to the bucket-name.amazonaws.com.

backend media {
.host = "s3.amazonaws.com";
.port = "80";
}

sub vcl_recv {
set req.url = regsub(req.url, "^", "/bucket-name");
set req.backend = media;
set req.http.host = "localhost";
remove req.http.X-Forwarded-For;
remove req.http.X-Forwarded-for;
remove req.http.X-Forwarded-Host;
remove req.http.X-Forwarded-Server;
set    req.http.X-Forwarded-for     = "127.0.0.1";
set req.grace = 30s;
lookup;
}

sub vcl_fetch {
set obj.http.X-Varnish-Url = req.url;
// set a 1 day ttl for avatars
set obj.ttl = 1d;
set obj.grace = 30s;

if (!obj.cacheable) {
pass;
}

set obj.prefetch =  -30s;
deliver;
}

That’s it.  Simple and it works.

Catching Up In Five

Gabi and a Gabba

The push towards the end of summer has been marked by many hours on the job and less curating my interests.  The one thing that has not been pushed to the side, though, is time with Gabi. To spend as much time as possible with her I’ll get up early and go to bed late so that I don’t miss a hug, kiss, joke, or giggle.  She is an absolute joy to be around with her sly sense of humor, insatiable curiosity, irrepressible sunny disposition, and fanatical drive to do things herself. I love that little girl.

I miss summer even though it isn’t gone yet.


It has been unseasonably cold and I have been usually busy. I find myself sitting around today thinking about Gabi and the pool club and how I’d wouldn’t mind lounging around in the heat of July dangling my feet in the water as Gabi runs around splashing and swimming.  Summer cannot come back fast enough.

Morning Gauze

Management snapped this shot while I was off learning how to can tomatoes. I love the dreamy quality of it and how it captures those perfectly lazy mornings.

Building Google Chrome on Linux

Why not play along? It is that exciting. Like a Gentoo install fest.

/edit

A better part of the afternoon flushed down the drain for two executables: base_unittests and net_unittests.  Passed with flying colors but neither is a browser.

rm -rf /chrome





Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States