Feed on
Posts
Comments

Imagine that you have two hard drives in your system and are wondering how to best utilise them? You are also not interested in redundancy but would like to squeeze out some more performance out of your system. You know flash storage is coming, but it is not affordable for you yet, or you have an extra drive sitting on the shelf and are wondering if you could use it somehow. Answer is that you could – because spindles rule and it is more likely than no you can use them to your advantage.

Most obvious choice is to setup RAID level 0 (stripping) but I will not talk about that here. Rather, it will be about a less know ability of most mainstream filesystems (ext3, JFS, XFS) to use an external journal. All write intensive (even read intensive if you have access times enabled) workloads are
also pretty journal intensive and since journals are a separate area on each partition that creates a fair amount of seeking. Seeking is of course bad for throughput and this is where your extra spindle will come in handy. Idea is to have one separate journal partition on the second disk for each partition
from the main disk. With JFS for example, journal is at most 128Mb, which means that couple of those next to each other will occupy a tiny disk area, enabling pretty efficient seeks.

This setup will give you increased performance, but also leave a huge portion of your second disk unused. Some of it would be ideal for swap, which you could either have there exclusively, or have it setup with equal priorities for stripped swap for extra performance. The rest could be used for temporary storage, either good old /tmp or a custom partition. /tmp is interesting
because, on the one hand putting it on a second disk will remove the benefit of having an external journal (unless you turn it completely and put it’s journal on the main disk, but I do not think that would make much sense), but on the other hand and depending on your typical workload, it might be
beneficial after all. Because any operation involving packaging files from elsewhere into a temporary file in /tmp, or operating on a copy before copying it back, will benefit from a separate spindle regardless of the journal location. There will probably be more remaining unused space on this disk which could be used for a infrequently used custom storage partition or similar.

Since I consider this an advanced filesystem setup, I will not go into details on how to set it up here, because I do not want to be blamed for loss of data while converting existing setups. Interested parties will have to figure it out for themselves.

add to del.icio.us : Add to Blinkslist : add to furl : Digg it : add to ma.gnolia : Stumble It! : add to simpy : seed the vine : : : TailRank : post to facebook

Easiness of learning

Often I wondered what would be a better method for learning foreign languages, one which would provide easiness and joy? When asked whether they would like to learn one, most people would with excitement in their voices say, “Yes!”. 

Those who live in a foreign country often walk around and repeat to themselves: “I want to improve my English, German, French”. New methods, compact discs, iPods, college classes, self study packages… all that is available for everyone, but even with all that I have a feeling majority will give up soon after they start. So where is the problem? 

To learn we need to input time, money, energy and will.

Did you ever experience the feeling which comes straight after you put down a language book? Thoughts like; this is too hard, how will I pronounce that, how will I remember all that, oh who cares, I will forget everything by tomorrow anyway.

One common type of learning consists of reading a new text and pulling out the words and phrases which we don’t understand. Then we look up and write down their meanings and pronunciation trying to remember all that.  

I tried the opposite way. First I would only skim the text, write down new words and try to remember their meaning and pronunciation. Afterwards I would read the text again and as I would encounter all the new words I was recognizing them. I also felt easiness and a little bit of satisfaction which grew towards the end of reading. At the end I felt good and thought – I knew those words, that was easy, that was fun.  

Second factor is regularity because even the best method will not give you results if you do not practice often.

A very important third factor is not to compare yourself with native speakers. You will probably never speak as good as they, but you will progress even if you do not immediately notice it. Compare yourself with someone who is also learning it as a foreign language and that will give you a better answer about where/how you measure up.

At the end, what to say? I’m going to grab my Easy Italian Reader and give it a go.

For some reason MythTV’s built-in DVD player did not work well for me so I had to configure it to use MPlayer instead. That worked relatively well for some time, but every now and then there was a disc for which MPlayer would fail to automatically detect which track to play. Speaking of which, for those of you who maybe did not know, it tries to auto-detect it when you invoke it like this:

mplayer dvd://

When that would fail it would be pretty inconvenient to manually mess with MythTV setup and enter the correct track number so I wrote a quick and dirty Perl script to do it for me. It used to invoke lsdvd to find the longest track and run MPlayer on it. However lsdvd is also not perfect because it would fail on some discs because of some strict formatting checks, or at least that is what I thought. Well fix for that was easy – I just made use of MPlayer’s auto detection as a backup if lsdvd would fail.

This solution worked well so I decided to share it by posting here. You should be able to use it anywhere where you would normally use MPlayer, since it is supposed to transparently pass command line parameters to it, and just do it’s thing when it detects DVD playing mode.

I must admit having slightly re-arranged and cleaned up the script before making public therefore it is possible something got broken in the process. Either that or if you find some other problem with it please do not hesitate contacting me so I can post the improved version.

Here it goes:

#! /usr/bin/perl

use IPC::Open3;
use POSIX ":sys_wait_h";

# Parse some arguments we want to know about
$i = 0;
foreach (@ARGV) {
	$device = $ARGV[$i+1] if $_ eq '-dvd-device';
	$quiet = 1 if $_ eq '-quiet';
	if (/^dvd:\/{1,2}(\d*)/) {
		$dvd = $i;
		$track = $1 if $1 ne '';
	}
	$i++;
}

if (defined $dvd and not defined $track) {
	# Run lsdvd to get the longest track
	$pid = open3(\*IN, \*OUT, \*ERR, "lsdvd -Op $device");
	if ($pid) {
		$output = do { local $/; <OUT>  };
		waitpid $pid, 0;
		if ($? == 0) {
			eval $output;
			$ARGV[$dvd] = "dvd://$lsdvd{longest_track}";
			print "Longest track $ARGV[$dvd].\n" unless $quiet;
		}
	}
} elsif (defined $dvd and not $quiet) {
	print "Requested track $ARGV[$dvd].\n";
}

exec 'mplayer', @ARGV;

Linear polarisers are said to be problematic with modern SLR cameras due to possible interference with auto-focus and light metering systems. Unfortunately I only found that out after buying a set of three dirt cheap filters from eBay (UV, PL and a diffusion, all three for £10).

But as it turns out my Nikon D40 seems to work fine with it which was a relief. I know it is not a quality filter, even the manufacturer left it unmarked, but for me experimenting it is sufficient. It is labelled as “Made in Japan” although I got them from China so your guess is as good as mine from where they actually come from.

Cheap linear polarizer off eBay

I did get a couple of suspicious exposures with it, but it does not seem it was the filters fault since it sometimes happens without it as well. Depending on the scene and lightning it is sometimes necessary to use exposure compensation with D40 in general. But that is also completely normal since cameras can just measure light and do not actually understand the scene.

To summarise, from my experience both focusing and light metering on D40 seem to be unaffected when using this linear polarizer.

For the end here is one nice example of the effect polarizing filters makes when shooting landscapes.

Polarisation effect

There was some commotion lately about the new road tax rules expecting to hit us next year. Government sneaked through a retrospective change which is supposed to be “green” but some people say it unfairly penalises drivers of older cars who cannot afford a new one (there is even a petition about it here). I must admit to share that view, because regardless of anything else it does not seem fair to change the rules of the game so far back retrospectively, it almost smells of a hidden agenda. While I do not want to go into conspiracy theories I decided to entertain myself with a couple of calculations.

What I decided to calculate is the total carbon emissions you will be responsible for during your career as a driver. To do that I had to make some assumptions. First of all I assumed an average person’s driving career lasts 40 years and then I chose a couple of scenarios depending on how often that person chooses to change a car. Second assumption was that in 40 years from now carbon footprint of a new car manufacture will decrease tenfold. Lastly, the same tenfold reduction could happen with CO2 emissions (fuel economy) regardless of what fuel we might be using then. All those reductions progress linearly from today to the end of projections and are taken account of as our driver changes his cars.

Current car manufacturing carbon footprint numbers are taken from a study published by Renault (can’t find it right now, but I am sure it is Googleable) which expresses it to be around one fifth of lifetime CO2 emissions during a defined exploitation (set number of years, set annual mileage).

I have also plotted a set of annual mileages (expressed in kilometres per year) to see how the distance travelled affects the optimal car period change. Result of this can be found in the graph below.

Graph showing lifetime CO2 footprints

Looking at the graph three effects are nicely visible. On the left hand side we see the manufacturing effect, the initial carbon footprint unavoidable when you have a car made for you, which is dominant if you change them frequently.

On the right hand side, or in other words if you decide to keep a car for too long ignoring technological advances, you can see the effect that makes on your carbon footprint.

And the most subtle thing is the slope in the middle area of the graph where lines go from falling to raising depending on the annual mileage (which is in kilometres just to remind you).

In general it follows that a car should be kept for at least five years to alleviate the manufacturing costs and then it can be replaced any time from eight to twenty years since new. Granted I have overdone it a bit by plotting twenty and forty years between car changes which is not really realistic so that part can safely be ignored.

From the ecological perspective, for the average driver who does something like 12000 to 18000 kilometres a year (so around 10000 miles, or between red and yellow lines on the graph) it is obvious car can be kept safely for at least twelve years.

So it also follows the financial “incentive” (also called as stick, from stick and carrot show) to scrap our terrible un-green cars bought from 2001. onward is clearly wrong, or at least not based on ecological principles. Those cars have just entered the optimum period of their life and should be kept running for some time still.

Not only that, but such retrospective road tax changes do not at all take into account the amount of miles covered annually, which if sufficiently low justifies those motorists to keep their cars effectively forever. Choices for them are to start paying vastly higher annual tax or to scrap the car and fuel the economy a bit by buying a new one. And to hell with carbon footprint then.

P.S. This analysis was entirely and only based on carbon emissions aspect. It would also be very interesting to see what makes sense financially, and possible correlate that with ecology. But I must leave that for another time.

add to del.icio.us : Add to Blinkslist : add to furl : Digg it : add to ma.gnolia : Stumble It! : add to simpy : seed the vine : : : TailRank : post to facebook

We visited Paris recently where among other things I got to play a lot taking pictures with our still relatively new Nikon D40. Looking at the pictures at home I realised one of them looked pretty funky. Water in a fountain in front of Louvre turned out to have a very interesting look, like someone spilt a bucked of green paint in it and did not mix it well.

I was shooting at roughly ninety degrees from the sun (according to the shadows) which should create the strongest polarisation effect on the sky but I am not sure is that relevant for the water? Anyway, here is how it looks like.

I have the cheapest possible brandless linear polariser, the kind where you get three filters for £10 from China, but I don’t think that has something to do with it. My first theory was that depth of the water is crucial, but then there are some transparent patches in the middle of the fountain which does not check with it. So maybe it has something to do with the wind rippling the surface? I don’t know, but it sure looks strange. For end here is another picture, this time a tighter crop of the interesting area.

Recently introduced Western Digital GreenPower hard drives seem to be suffering from overly aggressive head parking under some workloads. By default, idle timer before heads are unloaded is set to eight seconds, so with a hypothetical workload where disk is accessed every nine seconds it would do several hundreds of unload cycles per hour. Since the maximum lifetime number of those cycles ranges from 300,000 to 600,000 (depending on the model), the drive could go out of specification in a few months.

And it is not purely theoretical because WD5000AACS in my MythTV box accumulated 11175 of those cycles in just 72 power-on hours! So I contacted WD’s technical support and after some back and forth received a DOS utility called wdidle3_1_00.zip which can control the IntelliPark (not so intelligent after all!) feature between disabled and 100ms to 25.5 seconds.

Good news are that setting is persistent across power cycles, otherwise DOS utility wouldn’t be of much use. The way to use it is to grab, for example, a bootable floppy image from the FreeDOS project, make a bootable CD with it and put wdidle3.exe in the filesystem itself. Then boot from that CD and invoke the utility to set the desired setting.

After setting the timer to the maximum value my disk is now behaving much more sensibly. I am still monitoring to see if I will need to disable it altogether, but so far it looks reasonable.

This actually happened last summer but it is often difficult to find time to write something up…

Anyway, the story is of a relatively experienced driver who moved to a different country and is getting screwed by insurance companies extorting money on account of the unknown driving record. At one point guy decides to go through the hassle of passing the driving test again (which also had some other contributing factors but that is another story) and here is what happens.

Previously the guy had accumulated two years of no claims bonus in this country and has been driving a typical family saloon, with a nothing-to-write-home-about 2.0 litre naturally aspirated petrol engine. Nothing special really.

Now he passes the driving test and gets a full local driving licence. Does the insurance premium go up or down? Anyone care to guess? Well up of course – because the guy is obviously a new and inexperienced driver now. Needles to say our guy was pretty pissed off and went to look for another company. Little did he know the fun is just about to start…

To cut the long story short – computer said no, and no and no. “Young” drivers are not allowed to drive such cars, death machines on wheels, those instruments of destruction, disasters waiting to happen. And humans also said no, they just couldn’t grasp our guys story.

This story does have a happy ending because eventually a more reasonable insurer was found, but still, the absurd of it all, the hassle and frustration simply wants to be recorded and shared.

P.S. Guy also asked me to send his thanks to the following: AON insurance for selling him a highly expensive and void policy, politicians for allowing insurers to do that and AON insurance again for wanting even more money once he suddenly became young again (miracle!).

After recently having built a small PC using Antec NSK 1300 case I felt to share my thoughts about it.

Having read a couple of reviews and owner impressions myself, I was expecting a pretty mature and solid product. Both because the case is not first in line but a successor to Antec Aria and the fact it is not among the cheapest on the market. At the end I was somewhat disappointed by couple of details which made me think this case is more about marketing and less about really good engineering and well thought out design.

Case itself can accommodate three 3.5″ and one 5.25″ device but the power supply has a grand total of one SATA power lead. Strange – and allegedly it is a new design with a new power supply. So one must use Molex to SATA adapters which doesn’t help in keeping inside tidy and easy to work in and it also doesn’t help airflow. Also that one SATA power lead is pretty damn short. So short it is impossible to connect it and then close the pop-out drive bay (or open it for that matter). Other leads are much much longer, which makes little sense in my opinion, especially since on some motherboards SATA connectors will be just underneath the drive cage so usefulness of it’s pop-out feature goes down.

My second gripe is the top panel mesh window. Boasting aluminium-plastic-aluminium side and top panels for sound insulation and then having a big window just above the noisiest parts of a computer (PSU and CPU) kind of defeats the purpose, or at least lessens the effect. Especially since PSU itself is a custom design so it would probably be possible to do something smarter.

Overall build quality is solid except for the front panel. Boring black flimsy plastic with the crap climax being the optical bay eject button. Really Antec what were you thinking there?! I am genuinely afraid to press it so it doesn’t fall off. I am so sorry that I don’t have any pictures of it but the “mechanism” has to be seen for it’s crappines to be appreciated. It has no guides, no spring, just a plastic blob suspended on a plastic stringy-springy-joke.

In general I guess the case is relatively quiet but I would not call it silent computing. Also, bundled expansion bracket fan was too noisy so I am not using it. Thanks to a low power CPU I can currently afford it.

Another design flaw are the ultra bright blue LEDs which serve for front panel illumination. They are slightly too powerful and not shielded from the sides which is a problem in dark environments. Of course they can be disconnected which is what I will do. I guess blue is popular as are high amounts of it.

So that is all what I have to say about this case. Other reviews are all positive so I felt the need to mention the negatives and keep things balanced.

Linux on HP Pavilion s7500

One of my recent acquisitions, bought to replace ThinkPad R40 as a primary home PC, is this cool little desktop from HP. Actual model number in the UK is s7510.uk, while elsewhere it can be also found named as s7000 or s7500.

First of all I must say that it isn’t as quiet as I expected it to be. The fan is always on (although spinning slowly), which might be because HP messed up the ACPI DSDT code, or it may be by design. But having an AMD Turion64 ML-34 inside, I expected it to only spin-up the fan on demand.

Another thing which leads me to believe DSDT is messed up is the temperature reading which is, no matter what you do, always at 40degC.
So I tried to disassemble it and pass it trough Intel IASL compiler. And indeed, there were many errors and warnings. Here you can grab the acpidump output and DSDT code if interested.

Are those problems also responsible for the fact that there are no processor C-states reported by ACPI I do not know. But here is the relevant output:

astrid:/home/tvrtko # cat /proc/acpi/processor/CPU0/info
processor id: 0
acpi id: 0
bus mastering control: yes
power management: no
throttling control: yes
limit interface: yes
astrid:/home/tvrtko # cat /proc/acpi/processor/CPU0/power
active state: C1
max_cstate: C8
bus master activity: 00000000
states:
*C1: type[C1] promotion[--] demotion[--] latency[000] usage[00000000]

And here is the lspci output:

00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge (rev 10)
00:01.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge
00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller
00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller
00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller
00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller
00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 11)
00:14.1 IDE interface: ATI Technologies Inc Standard Dual Channel PCI IDE Controller ATI
00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge
00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge
00:14.5 Multimedia audio controller: ATI Technologies Inc IXP SB400 AC’97 Audio Controller (rev 02)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:05.0 VGA compatible controller: ATI Technologies Inc RS480 [Radeon Xpress 200G Series]
02:01.0 FireWire (IEEE 1394): Agere Systems FW323 (rev 61)
02:03.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
02:08.0 Ethernet controller: Atheros Communications, Inc. AR5006X 802.11abg NIC (rev 01)

Wireless NIC currently does not work because of an unknown reason. Atheros chipsets should be well supported in general but this one unfortunately isn’t. Here is the link on the issue as reported on madwifi.org.

Everything else works mostly fine under SUSE 10.1 32-bit version. Analog VGA output is remarkably sharp (or is this thanks to Samsung 740T LCD monitor?), it honestly looks like it is hooked up via DVI.

All in all it’s a cute little desktop. If HP could release an updated firmware which would improve the DSDT table it would be perfect. But with the exception of wireless support, it is completely usable as is.