Skip to main content

Jonty's blog

Happiness is? - part 2

I came across this quote today on the intertubes and I absolutely love it.  I think it's more or less what I was trying to imply in that poem I wrote however many years ago, but I certainly didn't realise it at the time.

"for a long time it seemed to me that life was about to begin - real life. but there was always some obstacle in the way, something to be gotten through first, some unfinished business, time still to be served, a debt to be paid. at last it dawned on me that these obstacles were my life. this perspective has helped me to see there is no way to happiness. happiness is the way. so treasure every moment you have and remember that time waits for no one...
Happiness is a journey, not a destination."

Other people are so much better at expressing themselves than I am!

Advanced directory listings with lighttpd and php

Before I start, I'd like to make it clear that 95% of this code came from Evan Fosmark, who also had the original idea.  I've just mashed together some different bits of code and customised it to meet my needs!

When I migrated my website from my old hosting account over to my Virtual Private Server yesterday, I soon realised I had overlooked something that, if left unchanged, would end up annoying me quire a bit - directory listings. 

My VPS only has 128MB guaranteed RAM, and that means it's running lighttpd instead of the altogether meatier Apache.  This doesn't bother me in the slightest - if anything, I prefer lighttpd anyway.  I've learned how to use it over the past few months and I find it fast, easily-configured, and definitely 'light'!  One of the sacrifices you make for this lightness, however, is that the directory listings aren't anywhere near as fancy as Apache's.  There are no filetype icons, and no option for sorting the file list by date/size/type. 

This led me to look for another way of generating directory listings for my stuff subdomain, which probably gets more use than the main site because it's where I plonk all the random things that I need to share, but don't deserve their own page on the site.  Finding Evan Fosmark's Enhanced Lighttpd directory generator saved me from having to use my meagre PHP knowledge to write my own script, but it only worked for the root folder that the index.php was placed in.  I wanted it to work, or at least appear to work, for the subfolders too!  This is where I remembered mod_rewrite:

  1. Stick my modified index.php into your root folder and remove the .txt extension
  2. Add the following to lighttpd.conf (or make your own config file, I saved mine in with the rest of my subdomain configs):
    $HTTP["host"] =~ "stuff\.jontysewell\.net" {
            url.rewrite = ( "^/(?!(.+\.\w*)).*$" => "/index.php?q=$0" )
    }
    

    Obviously, replace the host line as required.  This regex will make sure that any directories are sent to the generator to have nice indexes made, while files aren't redirected and are downloaded normally.

  3. Get the CSS file I use from here, and edit the $css_file variable at the top of index.php to reference wherever you put it.
  4. To get fancy pants filetype icons like I have, download whatever icon set you like (I'm using Tango icons) and save the relevant files into an .icons folder in the same folder as your CSS.  (thanks to Jace for this bit of script)

And that's about it, I think!  If you found that hard to follow, bear in mind it's the first time I've written a guide for this sort of thing, and feel free to ask for help if you need it.  I can't guarantee I'll reply within any reasonable timeframe, but it's worth trying!

If I ever get some more time I'd like to modify the script further so that I can put one copy of it in a central place, and use lighttpd rules to give fancy listings to any number of subdomains.

December 2009 Snow

The winter of 2009/10 has certainly seen more than its normal amount of wintry weather for Derbyshire.  During the first snowfall in December I decided to pick up the camera and go for a walk through Holymoorside - a very picturesque place to be at any time of the year!  Here are some of the photos I took.

Site updates

That's right, I've finally got around to installing a WYSIWYG editor!  I'm using CKEditor, which looks pretty good.  As well as that, I've decided to consolidate my assets (and save some money) and migrate my website and hosting onto my VPS.  Apart from this actually giving my VPS something to do, there shouldn't be anything different at your end.  Funnily enough, it should actually work better than it used to!  I never realised but the old installation wasn't using the correct font for some reason, and now it is, and I think I prefer it this way.

I just need to figure out some e-mail forwarders so that my @jontysewell.net addresses continue to work, and that should be it.  If there is anything you find that doesn't work, please send me an e-mail and I'll try to fix it - there's a lot of little things that I don't have time to test.

Nothing else much seems to have changed on the site, I'm just pleased that I can do things like this and this now without much effort. :p


Oh, and there are new smileys, too. The old smiley plugin never really worked.

Happiness is?

I was looking through the big folder in my Documents called "Old" yesterday, and I happened across some rather old English homework from when I was fourteen (well okay, that's only three years ago; it feels like a long time):


http://www.jontysewell.net/files/happiness-is.pdf

I remember spending more time on the design than the actual words back then, but it made me think. Do I have a little bit all to myself? No. I made a resolution last year that I should always try and be positive, but it just gets harder and harder! One of two things happens. I'll start enjoying something, but then think 'hang on, I shouldn't be doing this; I have x and y and z to do for school!' or just plain 'I shouldn't be doing this anyway', and then it's gone. That, or every time I start enjoying myself at something, it ends!

For what it's worth, I don't hate going to school or doing school work. I just resent the fact that all the people who talk to me about school concentrate on academic achievement as being the sole most important thing. I know they don't think that, but it's hard to convey because it's just the way the world works nowadays. So I've decided that as well as trying to concentrate on pure academic achievement to get me to university, I'm also going to concentrate on getting out of the house, and showing everyone that they can just trust me.

Syndicate content