|
Wed, Nov 19, 2008
![[Icon]](rsc/img/chain_link.gif)
Well, it isn't, it's only November and the sight of all the Xmas decorations in shops already annoys me.
But I'd kinda like the 10 year anniversary UserFriendly book and I can't afford to buy it because I've been out of work for over a year.
Just thought I'd mention it. You know, just in passing... O:o)
Tue, Nov 18, 2008
![[Icon]](rsc/img/chain_link.gif)
As you may recall, I'm planning on starting up my own business. And I said some time ago I'd been able to test the basic principle and it seemed workable.
Well, today, at long last, I took delivery of the raw materials that will go to make the product I will actually sell. So instead of using some scavenged material here and some inferior ebay-sourced stuff there, I was able to construct a proper prototype of the actual product that, all going well, people will be buying.
I just gave it the first test run. Nail-biting time :o)
And after all the worries I've had (and believe me, I've had a lot!) it didn't go okay.
It went perfectly.
Seriously. I've been planning workarounds for all the things that were sure to go wrong for weeks. I was convinced I would need to make concessions somewhere. Of all the possible problems, surely at least one or two would crop up..?
Nope. None of them. Everything works. The only places where it didn't work as expected where were it worked better.
I'm really, really happy right now :o)
Mon, Nov 17, 2008
![[Icon]](rsc/img/chain_link.gif)
Today, amongst other things, I looked into setting up an ebay shop. I came across the following statistic:
75% of eBay Shops sellers surveyed said that opening an eBay Shop increased their sales.
This begs two questions:
Sun, Nov 16, 2008
![[Icon]](rsc/img/chain_link.gif)
I've been more or less stuck with using Windows on my laptop for a long time because I get online using mobile broadband, which is plug&play in Windows but not with Linux.
I finally got around to tracking down a web page that covers how to connect, and (Despite the weird and painful way the network manager messes around in Ubuntu lately) I got the modem working.
Initially, there was no DNS - as the page says, the ISP's own DNS seems not to work. But luckily, I know the IP address for this website, to which I have SSH access. And links is installed. So I was able to gain full web access remotely, google the solution - sort out bind9 - and am now fully up and running on Ubuntu using mobile broadband.
Yay!
Thu, Nov 13, 2008
![[Icon]](rsc/img/chain_link.gif)
Some time ago, I wrote what I expected to be a fairly uninteresting blog post explaining in a fairly non-technical way why it was that Linux doesn't need to be defragged the way Windows does.
It proved rather more popular than I expected (It hit Digg's front page twice before I put in anti-Digg measures to prevent my server getting melted) and still gets read hundreds of times a day.
I still keep an eye on where referrals to it come from, and go look at some of them occasionally. And I still occasionally see people who are adamant that fsck tells them that some of their files are non-contiguous (fragmented) and this is a problem and they want a solution.
So here's another blog post about file fragmentation on Linux.
Am I bovvered?
So you have some files that are fragmented. And this obviously is slowing your machine down. Right?
Wrong.
This is the first thing you need to get your head around if you're out to keep your hard drive performance as high as possible. A file being fragmented is not necessarily a cause of slowing down.
For starters, consider a movie file. Say, three hundred megabytes of file to be read. If that file is split into three and spread all over your hard drive, will it slow anything down?
No. Because your computer doesn't read the entire file before it starts playing it. This can be easily demonstrated by putting a movie onto a USB flash drive, starting playback, and then yanking the drive out.
So since your computer only reads the start of the file to start with, it matters not in the slightest that the file is fragmented: So long as the hard drive can open those 300MBs in under half an hour (and if it can't, throw it away or donate it to a museum) the fact that the file is fragmented is of no concern whatsoever.
Your computer has hundreds if not thousands of similar files. As well as multimedia files that you WANT to take several minutes to access, you have all kinds of small files whose access times are made irrelevant by the slowness of the application that reads them: Think about double-clicking a 100KB file to edit in Open Office - however long it takes to open the file, it's irrelevant considering how damn long it takes to get OOo loaded from a cold start.
You might like it
The next thing you need to bear in mind is that a file being all in one place doesn't necessarily mean that it'll get read faster than a file that's scattered around a bit.
Some people are adamant, having watched Windows defrag a FAT partition, that all the files should be crammed together at the start of the disk, unfragmented. This cuts down on the slowest part of the hard drive reading process, the moving of the head.
Except it doesn't.
Everything crammed together makes sense in certain applications. A floppy disk or read-only CD/DVD for example. Places where one file is being read from a single disk, and the files being crammed tightly together isn't going to guarantee that a single file edit will instantly re-fragment things.
However, this is the 21st century. Your hard disk is not a hard disk, it's a hard drive with multiple discs (AKA platters) inside it, and the times when you would only be reading or writing one file at a long time are long, long gone.
It is perfectly feasibly to think that in one single instant, my PC might be:
All of this could quite feasibly happen at the same time: Probably happens a hundred times a day, in fact. And every single one of these requires a file to be accessed on the hard drive.
Now, your hard drive can only access one file at a time. So it does clever things, holding writes in the memory for a while, reading files in the order they are on the drive rather than the order they were requested, etc. etc.
So the chances that your hard drive has nothing to do other than try to read a fragmented file are really pretty low. It's fitting that one file into a queue of file reads and writes that it's busy with.
Imagine this scenario: Your computer wants to read three files, A, B, and C. Here's a disk where they're non-fragmented:
01 02 03 04 05 06 abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh 000AAAAA A0000000 0BBBBBB0 00000000 00CCCCCC 00000000
And here's one where they ARE fragmented:
01 02 03 04 05 06 abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh 000AA000 0BBB00CC 0AA00BBB 000CCC00 AA00000C 00000000
Assuming your multi-tasking hard drive wants to read all three of these, which will be quicker to complete the job?
Answer: It makes no difference because the head still needs to go from '01 d' to '05 h' in one go, whether the files are fragmented or not.
In fact, the fragmented files might well be faster: The drive only has to read the first two blocks to get the first portions of each file. That might be enough that the applications accessing these files can begin their work with all three files at this point, whereas the non-fragmented version would only be working with one file at this point.
In this (highly simplified as usual) example, you gain a performance increase by scattering your files around the drive. Fragmentation is not necessarily a performance-killer.
But even so...
Okay, so even Linux's clever filesystems can't always keep you completely clear of performance-degrading fragmentation. The average user won't suffer from it, but certain types of file usage - particularly heavy P2P usage - can result in files scattered all over your drive.
How to keep this from causing problems?
Carve up your hard drive!
Logically speaking, that is: Partitions are your friend!
Being simplistic again, the main cause of fragmented files is large files that get written to a lot. The worst offenders are P2P-downloaded files, as these get downloaded in huge numbers of individual chunks. But documents that are frequently edited - word processing, spreadsheets, image files - can all start out small and get big and problematic.
So, the first and simplest thing to do: Have a seperate /home partition.
System files mostly just sit there being read. You don't make frequent updates to them: Your package manager or installation disk write them to disk, and they remain unchanged until the next upgrade. You want to keep these nice tidy, system-critical files away from your messy, frequently-written-to personal files.
Your system will not slow down due to large numbers of fragmented files if none of the system files are fragmented: A roomy dedicated root partition will ensure this.
But if your /home partition gets badly organised, then it could still slow you down: A pristine Firefox could still be slowed down by having to try and read a hideously-scattered user profile. So safeguard your /home as much as possible too: Create another partition for fragmentation-prone files to be placed in. P2P files, 'living' documents, images you're going to edit, dump them all in here.
This needn't be a significant hardship: You can have this partition mounted within your home directory if you like. So long as it keeps your own config files and the like away from the fragmentation-prone files, it'll help.
Backups
So partitioning can cut down on the influence fragmented files can have. But it doesn't actually stop the files being fragmented, does it?
These days, hard drives are cheap. Certainly they cost less than losing all your data. It makes a lot of sense to buy a second hard drive to backup your files to: Far quicker than burning files to DVDs, and more space to write to as well.
In fact, you've got so much space, you could even set up a script to do this:
As simple as that, you have your fragmented files both backed up and defragmented. And it's actually quicker and better to defrag like this: Writing all your files in one go to a blank partition is far quicker than having to shuffle bits of them all over the place trying to fit them all around each other; and you're not cramming them all together in one place like Windows does, so they have "room to grow" in future, again making them less prone to fragmenting - you're working with your filesystems' in-built algorithms, instead of against them.
A sensible partitioning strategy and occasional backup-defrags will keep your data secure and structured far better than one big partition with everything haphazardly dumped in it.
Don't look for a defrag utility to hide a poorly-thought-out hard drive arrangement. Invest some effort into organizing your data and you won't know or care if there's a defragmentation tool available.
Wed, Nov 12, 2008
![[Icon]](rsc/img/chain_link.gif)
I had an event to get to last night. It's an hour's drive away, so I left with an hour and a half to spare. I noticed petrol was low, but I always get 400 miles from a full tank before the fuel light comes on, and I'd only done 350, so I wasn't too worried: I'd get petrol at the other end no problem. I'd put the road address into my satnav and it knew where we wanted to go, so off I went. Plenty of time.
Halfway there, at only 375 miles since the last refill, the fuel light comes on. It's NEVER come on at so low a mileage before, not ever. But I'm on the motorway and there's no fuel stations on the M25, so I figured what the hell, there's still 4 litres left in the tank when the light comes on, that's enough for 40 miles, I only need to get 25. It's fine.
Carry on, and just as we approach the satnav's "Destination" flag I see that right beside it is the icon denoting a petrol station. Great, I think, I'll fill up there, I have plenty of time.
Only, there isn't a petrol station there. Just a car sales place - it often seems to get those two mixed up. Plus there's no sign of the place I wanted to get to. The tricky bit is, you see, that they gave me a name but no street number, so the satnav could only get me to the road, not the exact part of it.
And it's a long road, and it's dark, so I pull over and grab my laptop, which has mobile broadband and so can get online and find me directions.
Or so I thought, but despite having full-strength signal, it was so slooooooow! It was painful, grinding slowly away and even at one point telling me that it couldn't locate google. FFS!
Expecting to be pulled over for about a minute, I hadn't turned off the car engine - it takes more than a minute's worth of petrol to start the engine, etc. But I was waiting longer than that for the web to help me, and suddenly I notice a flashing light - the petrol light giving me its warning that the tank is no longer low, it's down to fumes. Uh-oh...
Satnav, don't fail me now: Take me to the nearest petrol station. No, not that one, I already know you're wrong about that one. The NEXT nearest one. Just half a mile around the corner. Off we go. But around the corner is a solid line of traffic and some traffic lights.
Lights and cars slow progress to inches. At one point, I turned off the engine and just coasted down the slight slope in an attempt to keep fuel use to a minimum. Slow and painful, and very worrying because altho the car is small, it's heavy enough to not want to get out and push if it runs out of petrol. But progress was made and at long last, I got to the petrol station. Blessed relief!
Refuelled, I again tried in vain to get my laptop to tell me where on the road the damn conference venue was, and resorted at last to asking a bloke standing by a street light where it was. He was very helpful, and I got to the conference place, which I had driven right past earlier but been unable to see in the dark due to the crappy signposting, and was only a minute or two late.
It was a great evening. Really.
Mon, Nov 10, 2008
![[Icon]](rsc/img/chain_link.gif)
The cold that has been the bane of my life for a couple days is finally mostly gone. I'm still having a bit of trouble with how dry the air is in this place though. In an attempt at cheap & easy humidification of my bedroom, I bought a budget aromatherapy oil-burner, one of those things where oil floats in a shallow dish of water heated by a candle.
So the last few nights I've basically filled the dish to the brim with water, maybe put a drop of olbas oil in it, and left it to burn itself out. I'm not sure that it's helped vastly, but it certainly hasn't done any harm.
This morning, whilst trying to get organised, I came to a bag I bought off ebay recently, something to keep the pads, books, and pens I seem to require at all hours of the day in. I hadn't done anything with it so far, so as I was in an organisey mood, I started putting things into it - pens, ink, paper, etc.
Then at one point, I looked back at it, only to spy a wasp sitting on it.
A damn wasp. In November.
My normal strategy would be to grab a glass and up-end it over the thing to stop it flying away. But the glass I had in my room at the time was a pint glass (Because I was trying to stay hydrated) and still half-full. No good at all. I needed something NOW.
All that was available was the glass dish from the oil burner. So I used that.

Having trapped the little monster, I would then usually find a swatter, lift the glass, and kill it. However, the glass dish is fiddly and shallow, and really not the kind of thing I want to mess about with with a wasp under it...
What was needed, I felt, was a way of slowing the wasp down.
The first choice for slowing down buzzy insects is hairspray - gums them right up, they just drop out of the air. But I don't even have a comb, let alone hairspray.
So, second choice: Cool it down. Insects aren't warm-blooded.
So I stuck it in the freezer under that glass dish and left it there for a while.
When I came to remove it, it was quite emphatically slowed down.

No longer even seeing the point of wasting time swatting it, I just lobbed it out of the front door, into the driving rain.
That'll teach the evil little bastard to try surviving through November.
Question is... what should I leave as feedback on eBay for this item..?
![[XKCD] [XKCD]](http://imgs.xkcd.com/comics/a-minus-minus.png)
Sun, Nov 09, 2008
![[Icon]](rsc/img/chain_link.gif)
I think it's pretty much where I want it now, so here, for anyone who's interested, is the PHP that generates the dynamic blogroll in the sidebar. Feel free to steal it to put Magpie blogrolls onto your own sites :o)
Feedback is always welcome!
<?php
// Turn off error displays - we'll handle this ourselves later
ini_set('display_errors', 0);
require_once('../magpierss/rss_fetch.inc');
// Tell MagpieRSS where to find the RSS feed
$rss = fetch_rss('[RSS feed]');
// Put in a link to the blog with its favicon
echo "<img style=\"border: 0px solid ; width: 16px; height: 16px;\" alt='icon'
src=\"[Favicon]\" />
<a href=\"[Blog URL]\">
[Blog name]</a><br />";
// Now to process the actual RSS feed. If the feed is valid, grab the most recent item
if ( $rss) {
$short_items = array_slice($rss->items,0,1);
// To be polite, only update every half-hour (1800 secs)
define('magpie_cache_age', 1800);
// Tell Magpie to use UTF-8 encoding
define('magpie_output_encoding', 'utf-8');
define('magpie_input_encoding', 'utf-8');
define('magpie_detect_encoding', 'false');
foreach ($short_items as $item) {
$title = $item['title'];
$href = $item['link'];
$longdesc = $item['description'];
$desc = trim(strip_tags($longdesc));
$title = trim(strip_tags($title));
// Keep things a reasonable length: 60 character headings and 300 characters from the articles
if (strlen($desc) >= 300)
{
$desc = substr($desc,0,299)."...";
}
if (strlen($title) >= 60)
{ $title = substr($title,0,59)."..."; }
// Insert a "Link" icon that will link (duh) to the most recent post:
echo "<a href=\"$href\"><img alt='[Link]' title=\"";
// To prevent double-quote issues, use htmlentities (Thanks Cosmin!)
echo htmlentities($desc);
echo "\" src=\"[Link icon]\" /></a>
<font size=\"1\">$title</font><br />";
}
}
// In case of an error fetching the RSS feed, 'fess up
else {
echo "<font color=red><font size=\"1\">Unable to fetch RSS</font></font><br />";
}
?>
:: Next >>
LittleRedBoat
I am not boasting in the slightest, I promise
Venn Will I Be Famous?
Somalian Pirates
on books and reading
Brand new blogging software
An Enforced Break
You should Fire your Web agency when ?
Learned the Hard Way![[Link]](http://geekblog.oneandoneis2.org/skins/112/rsc/img/chain_link.gif)