Search Results: "spa"

17 October 2006

Russell Coker: laptop security on planes

There has been a lot of discussion recently about how to take laptops on planes following the supposed terror threat in the UK which has been debunked by The Register and other organizations. There is an interesting eWeek article about this that contains the interesting quote "The built-in locks don't yet meet TSA specifications because they cannot be opened using the TSA master key" when reviewing a laptop case. Creating a master key is not that difficult and is explained in this PDF file. Theft by baggage handlers is quite a common occurance (see this google search for details).

So baggage handlers can easily reverse-engineer the TSA master key, steal laptops from baggage, smuggle drugs, and put bombs in baggage if they are so inclined.

There have been a number of cases of laptops containing sensitive financial, medical, and military data being stolen. Now someone who wants to steal data merely needs to work as a baggage handler and copy the hard drives of laptops before loading them. Data is more valuable if no-one knows that it has been stolen.

It would be ironic if an airline employee had their laptop hard drive copied and sensitive information about airport security was lost because of this.

Russell Coker: car-pooling

I am constantly amazed at the apparent lack of interest in car-pooling when travelling between LUV meetings and the restaurant where we have dinner. After the last meeting I was one of the first five people to arrive at the restaurant and we had arrived in three separate cars. For the most luxurious travel you can have four people to a car and a standard sedan class vehicle can legally and safely carry five people. So an extra seven people could have been comfortably driven to the restaurant and an extra ten people could have been safely and legally driven to the restaurant. But instead most people were waiting in the cold at the tram stop.

Things are quite different in Europe. There was one occasion when after an LSM (Libre Software Meeting) conference in Bordeaux we got 8 people in a Mazda 323, now that's what I call car-pooling! NB This is dangerous and illegal, so I can't recommend doing it.

Russell Coker: terrorist "weakest link"

In the game show The Weakest Link competitors get voted off, usually not on whether they are weak but on whether the other contestents consider them to be a threat. It's mildly amusing as a TV game show but not funny at all when carried out on an airline.

Recently a flight from Malaga to Manchester was delayed because two passengers were considered to be suspicious by other passengers (either 6 or 7 passengers refused to get on the plane because of this). The passengers were thought to be speaking Arabic (as if there was anyone on the plane who would recognise Arabic when they heard it) and because they were wearing coats and looking at their watches. The two men in question had been searched twice and found to be clean, but a bunch of idiots on a plane thought they knew better and demanded that the passengers in question be removed.

Lessons to be learned from this for travelling to/from coalition of the willing countries:
  1. Avoid the urge to check your watch when your flight is being delayed unless you are white. Non-white people who do what white people do in this situation are considered to be terrorists.
  2. When travelling to a cold place (such as Manchester) you want to have a coat to wear when getting off the plane. The airline staff won't allow you enough hand-luggage space to store a coat so you will want to wear it when getting on the plane. This is fine if you are white, but if not white just deal with the fact that you will shiver when disembarking.
  3. Learn to speak English for your travels. If you speak another language you will be considered to be a terrorist.
  4. Whatever country you visit, stick to major cities as much as possible. Smaller cities have more racists and nationalistically bigoted people, there probably wouldn't have been a problem on a flight to London.

Also just avoid the coalition of the willing countries in your travels as much as possible. There are much less problems in this regard when the government doesn't depend on terrorism hysteria to justify going to war on the basis of lies.

Mario Iseli: Init7

Hello :-) Yes, I’m sorry, it’s already a long time ago since my last blog entry. You know, I relocated and so didn’t have a lot of time. Since last week I’m “back in the world”, I have my new Internet access in the new appartement. 213.144.140.48/29 and 2002:d590:8c31::/48 are my new IPs, this meant a lot of work, specially the DNS moving was quite complex. Then also update my entry at RIPE and Switch.ch and all the other providers. Now, back to the topic, Init7. To change my provider was a plan I had already for some months, because I need some public IP adresses and a more or less fast bandwidth, then the price was also an argument. After long searching i had about 5 candidates. Finally I decided to go to Init7 because I heard a lot of positive stories about them, and I really was excited: Instead of 119.- per Month I do only have to pay 99.- because I’m a member in the LUGS, this was the first positive thing. Then I had a nice contact with the secretary of init7, when I needed something I got a fast answer by E-Mail, that was the next very positive point. And now the part which I find best: At home I have an own nameserver behind my ADSL connection. Ok, so I asked the provider if they could provide me a 2nd DNS on their side of the line. Then I got an answer from their techie which told (it’s translated): Normally we don’t provide 2nd DNS for ADSL customers. But, we can make an exception because you like this wonderful OS*. Just tell me the IP adress of your nameserver and I’ll create you access on the Web-console. * OS -> He saw in my mail signature that I’m a fan of Debian GNU/Linux. When I read this mail I really couldn’t believe it! Ok, I don’t want to make any publicity in my blog but I think a “positive echo” is necessary. The newspapers are ful of bad internet news, maybe cablecoms peerins problems, the swisscom monopol etc. The cause of all that is, they are 100% money-oriented, they don’t care about the customer. The only target for them is “get more money”. And Init7 is the opposite, they’re “customer-oriented”, they do almost everything that the customer is happy. And so I’m also motivated to pay my bills. ;-) Thank you very much for this great service, this is poorwise not the normal way in switzerland!

Russell Coker: fair trade is the Linux way

I have recently purchased a large quantity of fair trade chocolate. Fair trade means that the people who produce the products will be paid a fair price for their products which will enable them to send their children to school, pay for adequate health-care, etc. Paying a small price premium on products such as coffee and chocolate usually makes no notable difference to the living expenses of someone in a first-world country such as Australia, but can make a huge difference to the standard of living of the people who produce the products. Also fair-trade products are generally of a very high quality, you are paying for the best quality as well as the best conditions of the workers.

I will share this chocolate at the next LUV meeting, hopefully the people who attend will agree that the chocolate is both of a high quality as well as being good in principle and that they will want to buy it too.

The Fair Trade chocolate I bought cost $6.95 per 100g. I went to Safeway (local bulk food store with low prices) to get prices on other chocolate to compare. Lindt (cheaper Swiss chocolate) costs $3.09 per 100g and has a special of $2.54. The Lindt and the Fair Trade chocolate are both 70%, but the Fair Trade chocolate is significantly smoother, has a slightly better aroma, and a better after-taste. So the Fair Trade chocolate costs slightly more than twice as much as Lindt, but I believe that it has a quality to match the price. Then I compared the price of a cheap chocolate, Cadbury Old Gold chocolate is also 70% cocoa and costs $4.29 for 220g, this makes it between 3.5 and 4.4 times cheaper than the Fair Trade chocolate. But if you like chocolate then Cadbury products probably aren't on the shopping list anyway. I believe that the Fair Trade chocolate I bought can be justified on the basis of flavor alone without regard to the ethical issues.

All Linux users know what it's like to have their quality of life restricted by an oppressive monopoly. We are fortunate in that it only affects us in small ways, not in our ability to purchase adequate food and health care. As we oppose software monopolies that hurt us in the computer industry we must also oppose monopolies in the food industry that hurt people in third-world countries. The fair trade programs are the best way I know of doing that. Hopefully after tasting the chocolate many LUV members will want to buy it too.

Russell Coker: more security foolishness

Dutch police arrested 12 people for acting suspiciously on a flight to India. A passenger said "They were not paying attention to what the flight attendents were saying", I don't pay attention to the flight attendents either. When you fly more than 10 times a year you learn how to do up your seat-belt and when it's appropriate to use your laptop, so once you know where the emergency exits are you can read a book ot talk to other passengers. The 12 people who were arrested were apparently exchanging mobile phones - strange, they have never asked people not to do that.

The 12 people have since been released. The cost of canceling flights due to security scares is significant for the airline companies. The fear that this induces in the public (both of terrorism and of stupid police) causes them to be less likely to fly which hurts the airline industry even more as well as also hurting the tourism industry.

The US is more dependent on air travel than any other country due to a severe lack of public transport. Australia is also very dependent on air travel due to large distances and no land connection to any other country. The UK also seems to have more of a need for air travel than other EU countries.

If exchanging mobile phones can interfere with air travel then people who dislike the US and the other countries in the coalition of the willing/stupid can cause serious economic damage by trivial things such as exchanging phones in-flight or writing BOB on a sick bag without any risk to themselves.

The war on terror is already as good as lost. William S. Lind's blog is a good source of information on some of the ways that the US is losing. It's a pity that the Australian and UK governments are determined to take their countries down with the US.

Russell Coker: planet debian, spam, and SE Linux

In regard to my post yesterday about Planet Debian I received the following response:
James Purser said I'm betting that your feed is an atom feed. We had the same problem on PLOA with Jeff and Pias feeds when they switched to atom. Planet needs to be upgraded.
Well I am using an atom feed, so this probably explains it. Sorry for the inconvenience to the Planet Debian readers, I guess that things will stay the way they are until it is upgraded.

Also when viewing my blog entry in Planet Debian I realised that much of a spam message had got pasted in to the URL field for the Planet Debian link. Oh the irony that I only found this embarassing error because of a bug in the Planet software.

This brings me to another issue, Security Enhanced X. With SE-X (before you ask, I didn't invent the acronym) you can use SE Linux to control communication between windows on an X desktop. With a modification to the clipboard manager (klipper in the case of KDE) every piece of data that's copied from an application will have a security context assigned to it and this context will be checked against the context of an application that is to be the target of a paste operation. Klipper will also have to support relabeling clipboard data. Therefore if I want to cut text from my email client (Kmail) and paste it into Firefox then I would have to relabel it with the appropriate MCS categories. This would permit me to paste text from an email into a web form with a few extra mouse clicks, but would prevent me from accidentally pasting the wrong text. Keeping in mind the fact that there are many more embarassing things that could be accidentally pasted into a blog entry than the contents of a spam this doesn't seem overly difficult.

PS Before anyone jumps to conclusions. When I receive GPG encrypted email or other material that should be kept confidential I try and avoid cutting it, and if I have to do so I clear the clipboard buffer afterwards. Keeping spam a secret is not really a priority to me so I didn't take adequate precautions in this case.

Russell Coker: Rip It Off unless you use windows?

The music sales website www.ripit.com.au has the advertising campaign ripit - don't rip it off. However the web site displays the below message when viewed on a Linux machine. The "step by step guide on how to enable Firefox" is really a guide on how to get IE code running in a tabbed window in Firefox (so you can get all the security problems that Firefox normally prevents).

Ripit has a big advertising campaign (TV and all the other places) with the slogan "ripit - don't rip it off", but it seems that this has the caveat that people who don't use Windows aren't wanted as customers. Are non-Windows users expected to "rip off" the music?

What are the options of buying music without dealing with the music cartel? I'm sick of all the things that they do, preventing free trade to articially inflate prices in some countries, ripping off the musicians, putting root-kits on CDs. Eventually the recording industry has to be destroyed. Most money from CD sales goes to the recording industry (not the musicians), the products provided to the customers are of low quality and customers are routinely treated like dirt, the recording industry does no good for society.

From now on I will not buy any CDs or DVDs of music from the recording industry cartel. I will only buy music from web sites that support standard Internet protocols. If a music company doesn't want to support Firefox then they don't want my money. For any music industry people who read this, don't get the idea that I'm unable to pay for music. I have a large collection of CDs (thousands of dollars worth) and was just starting to buy music DVDs when you finally offended me too much.

Thank You for visiting the Ripit Music Store

We have detected that the browser you are using is not compatible with the Music Store that you are attempting to access. This site has been designed to work with Internet Explorer Version 6 or above. Please launch the site in Microsoft Internet Explorer 6 or click here to download Microsoft Internet Explorer 6.
Also, music can only be downloaded via your Windows PC as this store is not compatible with Macintosh.
If you are using Mozilla Firefox, please click here to view the step by step guide on how to enable Firefox to surf the Soundbuzz Music Store

Russell Coker: more on clean energy

One new technology for saving fuel in cars is the 6 stroke engine. This is an engine that has two power strokes for every intake of fuel. The first power stroke is from the fuel burning, the second is from water being injected into the cylinder and boiling rapidly using steam for power. A significant amount of the weight of a car or truck engine is the cooling system. With water being injected into the cylinder after every burn the engine will require no other cooling, this can mean a weight reduction of up to 500KG for a truck engine! It is claimed that this technique can "improve a typical engine s fuel consumption by 40 percent". Note that this technique could be combined with the technology in a Prius for even greater efficiency.

Simon Richter wrote an interesting response to my blog about clean energy. I'm guessing that the part of Germany he's from is similar in some ways to Amsterdam (where I used to live).

In Amsterdam tiny cars are used a lot more than they have been in most places. There is the Smart Car but there is also a tiny car that can only seat one person (I'll update this entry with a link if someone provides me one). The tiny car appears to weigh ~200Kg, has a maximum speed of 30Km/h, and is narrow enough to fit in bike lanes. Such cars will take little petrol and can be used for shopping. The short-distance car idea is being used by many people already in northern Europe.

Simon suggests having a standard baggage container that fits in all cars. I don't think that would work as there are many different design factors (parking space, cargo capacity, and aerodynamics) which force designers to choose different shapes.

I think that a better idea would be a standard baggage trailer that could be towed by any small car. It should not be difficult to design a trailer that can be safely towed at 30KM/h behind a tiny car. The supermarkets could rent such trailers to shoppers for a nominal fee. Then most shopping trips could use the cargo capacity of the tiny car, but when buying supplies for a party you could rent a trailer from the supermarket.

Another option is having shops deliver goods to you. I have observed an increasing number of people doing this at my local supermarket. Of course you would still need to take ice-cream home yourself and maybe milk and meat too.

Electric scooters are also a good option for travel. Unfortunately in Australia there are few good options for securing them at the moment. As an electric scooter is light enough to be carried it needs to be chained to something secure. In the Netherlands this wouldn't be a problem as the bicycle infrastructure includes plenty of bike racks to which you can chain your bike, scooter, etc. Of course the Netherlands is entirely flat so there's no need for an electric scooter. Melbourne has a lot more hills and most people aren't fit enough to ride a bike so scooters are needed to replace cars.

Regarding depersonalised cars. That would require a significant social change as currently cars are extremely personalised. One thing that I had been thinking about is the idea of sharing cars with neighbors. For example if you have an apartment building and there are a few people you trust then you could share a tiny car for going shopping. Sharing a car used for driving to work or for entertainment would not work well as the car would spend most of it's time in use (or at least parked somewhere away from home). Sharing a car that's used for small journeys would be much easier as such a vehicle would spend most of it's time at home.

In Australia most families have two cars. One is used a lot (spends maybe 70 hours a week away from home) and the other is used much less (maybe 10 hours a week). Instead of owning two cars it would be possible for families to own one car and share another.

Regarding the Pebble Bed Reactor, could the people who advocate it please read the Wikipedia article. The limiting factor is not thermal expansion (solids do not expand nearly enough) but the Doppler effect (fast neutrons are not as effective at triggering fission). But in spite of that issue, let's not consider an untested new reactor design to be the savior of nuclear energy. I think that most people who read my blog have a science or engineering background and know from experience that new technologies often don't work too well in the first version. When a new CPU has a bug it's usually not a big deal. When a new OS or application has many bugs it's often expected (expecially when the OS or application comes from a monopolist). But if a new design for a nuclear reactor turns out to have a bug then it will be a more serious issue.

Russell Coker: SE Linux is like a moat filled with sharks with la...

Here's an interesting blog entry comparing SE Linux and AppArmor. It has some amusing comments, one of which I used for the title of this entry.

There are two things I don't like about AppArmor. One is that it doesn't label Inodes but instead bases it's access control on file names. This means that renaming a file may change the access granted to it, and a file with multiple hard links may have different sets of access granted to each name. The hard link problem is a killer, imagine that name A grants execute access to the file and name B grants write access, therefore you have the ability to create an executable file.

The other thing I don't like about AppArmor is that it's goals are low. The current implementation of AppArmor can be compared to the SE Linux targeted policy. The difference is that AppArmor is currently achieving everything that it was designed to do while the targeted policy is intentionally providing less security features to give greater ease of use. There is a well defined transition path from targeted to strict, and from strict to MLS. There is no transition path from the current AppArmor implementation to something better.

Rumor has it that Suse have bought the rights to a MLS system and that they want to get LSPP certification. LSPP certification requires that access control be based on Inodes not file names (IE renaming a file may not change the access that is granted to it). It will be interesting to see how they integrate AppArmor and a MLS system.

Russell Coker: vision

At the start of the year I suffered a minor injury to my left eye. This brought my vision down to slightly below average for my age. A doctor and an ophthalmologist both thought that my vision was good enough at this level and that I don't need glasses. But the ability to use a small font means that I can have more text on screen and thus do my work more effectively. Since about March I have worn glasses all the time. Regardless of what the experts say I want to have good vision all the time and there is a significant difference between my vision while wearing glasses and that without.

It's often recommended that people get their eyes tested about every 2 years from when they are in their late 20's and also get a test done a few months after any eye injury. I strongly support such recommendations for anyone who works in the computer industry. Even if your vision is slightly less than it could be it will make a difference to your work. I have not found glasses to cause me any inconvenience, I'm sure that it would be bad for children to wear glasses but for adults the only potential issue is when playing sport (which is less demanding on your vision than reading an 8 point font on a typical monitor). I am constantly amazed by TV and radio adverts which say "do you wear glasses, if so then you must have considered LASER eye surgery". Glasses are fine (IMHO) and I will not consider having a LASER or other dangerous object pointed at my eyes unless I am in danger of death or blindness!

The testing apparatus that an optometrist uses is interesting to inspect if you like machines. It is a device with a huge selection of levers for inserting different lenses in front of your eyes until they discover the combination that gives you the best vision. If you get your eyes tested make sure you get the optometrist to explain everything, you can learn many interesting things.

Recently, I have had a further eye problem. Recently my central vision went blurry with a shimmering affect for about 40 minutes, but the peripheral vision was OK. An ophthalmologist diagnosed this as a migraine, apparently I got a very mild one with only a minor visual affect but no headache etc. One thing that is apparently possible when experiencing migraine related vision impairments is the ability to act on visual information without consciously knowing it (EG catch a ball without seeing it).

A migraine is a better diagnosis than I had feared. The movie Super Size Me (the topic of tomorrow's blog entry) contains an interview with a main who describes a diabetic vision problem that sounded similar to mine. Migraines don't cause permanent problems while diabetes can, and diabetes requires lots of unpleasant blood tests and injections.

Apparently migraines are often triggered by physical events or food items. If you suffer one then it's recommended that you write down as much information as possible about the previous 24 hours to help track down the cause. If you experience something similar to what I describe then do not take this blog entry as medical advice, instead rely on a doctor and whichever specialist they refer you to. But do write down everything that happened prior to the medical problem (keeping an accurate diary can't do any harm).

The Wikipedia entry on Migraines has a lot more interesting information, but don't take it as medical advice either. One particularly interesting thing in the Wikipedia article is the note that migraines may be caused by not having suitable glasses, or prevented by wearing special glasses.

Russell Coker: review of Australian car web sites

It seems that Toyota isn't alone in having non-functional web sites. In fact it's better than some, the basic information on the cars is available and it is possible to get contact information for car dealers, also they have a feed-back form on their web site (to which I submitted my previous blog post). Incidentally the Lexus site had much the same problem as the Toyota site (hardly surprising as Lexus is the luxury marque from Toyota). But I expect that if I phoned Lexus to ask about their vehicles I would get a better call-center experience which would make me less inclined to blog about them.

Daihatsu vehicles are sold by Toyota. Their web site doesn't use Flash, but it has so little content that it doesn't count.

I decided to quickly review the web sites of car manufacturers that sell in Australia for a fair comparison. I found three sites worse than Toyota, two sites that were equal (counting Lexus), and six that were better than it.

Holden has the worst site, they don't display any information if you don't have flash, they don't even display a phone number! I wonder how much Adobe pays web programmers to pull this sort of stunt. I can't imagine Holden management saying "if a customer comes to our web site and doesn't have Flash then don't display our phone number or any other contact information, they can use Flash or buy a Ford instead". Obviously some web monkey has run amok and done their own thing without following directions. Probably some people need to be sacked in the Holden web development group.

Volvo Cars has a very bad site. Most of the content is involved with Flash in some way and refuses to load. There is a mailto reference that is broken, and the overview page for the S60 seems to have a JavaScript loop (I aborted the load after it loaded 245 pictures and was still going). The Volvo page for their other business is quite functional although minimal.

Hyundai has a bad site. The front page works OK, but some of the sub-sites to display information on vehicles redirect to sites such as evolveddriving.com.au which are "optimised for 1024x768" and require Flash and Quicktime while others do strange things like changing the size of the browser window. Overall it's a very bad site, but at least I could find the contact details for my nearest dealer, and it has a feedback form.

Subaru has an OK site. The only thing I couldn't access without Flash is information on their AWD (All Wheel Drive) technology. Unfortunately they provide no email address and no form for sending feedback.

The main Ford web page claims that Flash is required, but their site just works without it. In a quick test I was unable to find any functionality on the Ford site that is missing because of not having Flash. Ford have a well designed site.

The Volkswagen site makes no mention of the fact that I don't use Flash, it does however have some strange unused spaces in the middle of the screen. I guess that it recognised that I don't have Flash and made a semi-successful attempt to work around it. I could get all information I wanted including dealer contact details.

The main Mazda web page displays a message about Flash not being installed and offers a link to a non-Flash version of the site. The Flash section is at the center and the buttons at the sides work if you don't have Flash. This seems to be a well implemented site.

Citroen has an OK site, no flash that I noticed (although there were large blank areas on the screen at times indicating that something was missing), the information was all available and browsing was reasonably easy. One thing that annoyed me was that there were movies available but only through some sort of JavaScript that tried to play them in my browser. I have never bothered setting up my web browsing machine for playing movies (among other things it has no speakers) so this is a problem for me.

Peugeot has a good site. No apparent flash and it's reasonably easy to use. It has more pictures than Kia but the JavaScript navigation stuff is fancy. One nice feature is a single page with pricing summaries for all models. If you have $X to spend on a Peugeot you will easily discover which ones you can afford.

Kia has the best site I saw! Not only is there no flash, but it's well designed, easy to navigate and it loads quite quickly. Please review the Kia site as an example of how to do it properly!

Let me know if I've missed any makes and I'll post an update.

Russell Coker: more about MX records


In response to my previous post someone pointed out that MX records have an obvious benefit of offering multiple servers at different priority levels.

I don't believe that this is a benefit for many machines on the modern Internet. Most systems that have secondary MX records implement them poorly, they have less SPAM checks on the secondary MX server, and it often doesn't even have a canonical user-list! This is a really serious problem, spammers apparently often target the secondary MX server (I don't have evidence for this but many people assert it to be true and it would obviously work so is likely to be true) and it's well known that spammers often guess account names (a quick scan of the logs of any mail server will prove this). These factors combine to make a secondary MX server without a canonical list of user-names a serious spam problem, it will receive mail and then bounce it to innocent third parties (the vast majority of spam has a forged sender nowadays).

If you have the ability to run a well configured secondary MX server with a canonical list of valid account names (which must be maintained independently of the master mail server for obvious reasons) then there is the issue of why you would want to do so. What problem does it solve? In the early days of the Internet mail storage machines were often end-nodes on the network, many hops away from the central well-connected machines. This meant that sometimes connections would time-out or the hop count (which was smaller then than it is now) would be exceeded. Having a well connected server being a secondary MX server was a significant advantage for a small mail server in those times (by todays servers almost all the mail servers of 1993 are small and the biggest servers of 1993 were medium sized by today's standards).

I just did a quick search for machines with secondary MX records (IE multiple MX records at different priorities). The only significant mail service with such configuration that I could find was gmail. Hotmail.com, ibm.com, microsoft.com, aol.com, and zonnet.nl all have multiple MX records at the same priority - this is a cluster of primary mail servers not a primary/secondary configuration. The evidence suggests that mail servers such as hotmail.com do not benefit from a secondary MX record, so I doubt that any other domain needs it either.

In response to a comment on my previous post, I have previously mentioned in mailing lists the issue of spammers attacking secondary MX servers, but I couldn't see it when reviewing my blog archives.

Above is day 10 of the beard.

Wouter Verhelst: Linux 2.6.18 vs NBD

Version 2.6.18 of the kernel contained a small(ish) change to <linux/nbd.h>:
--- nbd.h	2006-10-17 19:53:55.000000000 +0200
+++ /usr/include/linux/nbd.h	2006-09-20 05:42:06.000000000 +0200
@@ -37,19 +37,28 @@
 /* userspace doesn't need the nbd_device structure */
 #ifdef __KERNEL__
 
+#include wait.h>
+#include mutex.h>
+
 /* values for flags field */
 #define NBD_READ_ONLY 0x0001
 #define NBD_WRITE_NOCHK 0x0002
 
+struct request;
+
 struct nbd_device  
 	int flags;
 	int harderror;		/* Code of hard error			*/
 	struct socket * sock;
 	struct file * file; 	/* If == NULL, device is not ready, yet	*/
 	int magic;
+
 	spinlock_t queue_lock;
 	struct list_head queue_head;/* Requests are added here...	*/
-	struct semaphore tx_lock;
+	struct request *active_req;
+	wait_queue_head_t active_wq;
+
+	struct mutex tx_lock;
 	struct gendisk *disk;
 	int blksize;
 	u64 bytesize;
@@ -68,11 +77,11 @@
  * server. All data are in network byte order.
  */
 struct nbd_request  
-	u32 magic;
-	u32 type;	/* == READ   == WRITE 	*/
+	__be32 magic;
+	__be32 type;	/* == READ   == WRITE 	*/
 	char handle[8];
-	u64 from;
-	u32 len;
+	__be64 from;
+	__be32 len;
  
 #ifdef __GNUC__
 	__attribute__ ((packed))
@@ -84,8 +93,8 @@
  * it has completed an I/O request (or an error occurs).
  */
 struct nbd_reply  
-	u32 magic;
-	u32 error;		/* 0 = ok, else error	*/
+	__be32 magic;
+	__be32 error;		/* 0 = ok, else error	*/
 	char handle[8];		/* handle you got from request	*/
  ;
 #endif
Which meant that the userland NBD utilities would not build against that anymore. The Debian packages are unaffected (they ship their own nbd.h since they need to build on non-Linux ports, too), but that doesn't mean we can leave it like that. The first hunk is unimportant, as it's enclosed within an #ifdef __KERNEL__. The others represent an interface change: rather than having u32 and u64, they come with __be32 and __be64. Nothing that can't be fixed with a few #define lines, but still something that had to happen. So today I released nbd versions 2.7.8 (from the outdated 2.7-branch), 2.8.7 (from the current stable and supported 2.8-branch), and 2.9.0-test3 (from the current development branch) to sourceforge, and released version 1:2.8.7-1 to Debian unstable. I'll probably also release 1:2.9.0-test3-1 to Debian experimental "some time soon", but not just yet. Apart from the obvious #define lines, the 2.9.0-test3 release also fixes some issues (in contrast to -test2 which was a bit of a crashing horror, -test3 actually works) and has revamped multi-file support. Most of the changes in -test3 (in fact, most likely all of them apart from the #define lines) were done by Phillip Hellewell, whom I owe a beer if I ever see him. Occasionally, the 2.9 line has some extra code and features that aren't available in 2.8, such as configuration file support and the ability to serve multiple block devices from one nbd-server parent process. Check it out if you have a chance and/or are interested. On top of that, the 1:2.8.7-1 release also contains some fixes in the debconf stuff, that close 3 bugs. Am I cool or what? Nah.

Jeff Bailey: Redirect versus refresh

I spent the weekend cleaning up my vanity site, CSSizing it and such. Since I moved a few documents around, I wanted to make sure that they were still findable. Most of the site wasn't PHP before (it is now for common navigation / footer includes, etc.) so I had the challenge of how to send people to the new pages.

It's most common to find "refresh" pages, ones that you go and they redirect you to another location with a 0 timeout (and often a cute little notice that says if your browser doesn't DTRT, you should click the link). There doesn't seem to be another meta tag that could do the redirect trivially.

This is another case where PHP wound up being useful. Since I moved my weblog from my homesite to LiveJournal a while ago to let comment spam be Someone Else's Problem, I had that and a whole directory of stuff underneath it that was no longer there.

jbailey@titanium:~/web$ cat weblog.php
<?php
header("HTTP/1.0 301 Document Moved");
header("Location: http://jbailey.livejournal.com/");
exit();
?>


Now works for http://www.raspberryginger.com/jbailey/weblog and any of the directories underneath it. Another side trick to this is that if I had a file foo.html, I can create a foo.html.php file with the same sort of thing in it. Apache's automatic extension tracking will find the .php file and sort it out automatically.

One thing I did discover is that if I have "weblog.tar.gz" and "weblog.php" sitting side by side, apache will prefer the .tar.gz file. *sigh*

Martin F. Krafft: Digging the iAudio

A little while ago, I finally gave in and bought myself a music player. Now I find it hard to imagine how I coped all these years without one -- I did not have a music player since my MiniDisk player from about seven or eight years ago. I bought the iAudio X5L with 30Gb of space as part of a fall special sale, and even though it's still a bit on the expensive side, I am glad I did go with the X5L as opposed to the X5 or models by other manufacturers. Here's my analysis, which isn't all positive:
  • The iAudio players can play more formats than any other player I've seen, including, of course, Ogg Vorbis and Flac.
  • The casing is sturdy and smooth; the player is a little heavy but not too heavy. The display is gorgeous, although I would not watch videos on it even though I could. All in all, it feels and looks great.
  • The software seems archaic at first, but after a little use it's quite enjoyable and intuitive to use. It does not compare to the scroll wheel of the iPod when scrolling large directories, but it does quite alright. I really appreciate being able to browse while listening. Also, the display contains a lot more information than on any other player I've seen.
  • One quickly gets used to the joystick; however, considering that the right direction is the one used the most, it starts to go loose after only a bit of usage. This has not really been an issue so far, though.
  • The X5L has only 30Gb of storage, as opposed to the 60Gb you can get with the X5. However, the L in the product title refers to long-life, and the battery in the X5L lasts about twice as long as the one in the X5. I just took the device for a spin in the alps and after two 5 hour train rides of continuous playing, and another 6 hours of playing at the cottage, the battery was still around 40% full. If I ever run out of space, I could exchange the internal 1.8" harddrive for a bigger one.
  • I can use the device to record from microphone or line-in (using an adapter) directly to MP3, and the microphone's quality is quite fair. This is great!
  • The sound quality is good, but all the sound enhancers, like BBE and Mach3Bass are useless; better leave them off.
  • When connected to a computer, the harddrive appears to the machine as a regular USB storage device, so no software is required to maintain the data on it.
  • I am a little annoyed by the fact that the USB connector on the device can only be used to connect cameras and the like to store data on the X5L's harddrive. In order to dump data onto the device, you have to connect a little dongle and then attach the USB cable there.
  • It does not appear to be charging while connected via USB. I am not sure about this yet though, since the configuration menu offers an option to enable and disable charging via USB.
  • I've been told that firmware upgrades aren't rare and that they're easy to apply.
  • It comes with two years of warranty (as opposed to the default one year in Switzerland).
Altogether, the player isn't perfect, but it does what it should (and more) quite well. I can warmly recommend it. It comes in at a slightly higher price than the iPod, but quite frankly I am happy to support the manufacturer Cowon for its product line and philosophy of supporting open formats and caring for the customer. NP: Porcupine Tree / Tarquin's Seaweed Farm (Side B)

16 October 2006

Evan Prodromou: 24 Vend miaire CCXV

I'm glad to see that Debian vote 2006-06, to reaffirm support for the Debian project leader, has passed, and that associated counter-proposals to recall the DPL have been defeated. The central issue has been Dunc Tank, a project to raise money to support certain Debian developers with the goal of getting Debian's next release, etch, out on time. There's been more heat than light on this issue over the last few weeks in various Debian- and Linux-related venues (mailing lists to media), and I'm happy to see that we've come to a conclusive resolution and can hopefully put the issue behind us. I've been impressed with Anthony Towns's aplomb in dealing with this issue, and I'm glad that he'll be staying in the DPL seat. We have one of the best, if not the best, Linux-based Operating Systems available. But Debian's late releases have become a laughingstock, and our users have to resort to backports and workarounds to keep running a stable release version of our software. With luck, putting extra resources into getting out a release will serve our users better and restore our reputation for delivering software in a timely fashion. tags:

Daisy, Daisy, give me your answer, do The wp:2001: A Space Odyssey (film) jokes are probably a little too thick on the ground, but I'm glad to see the launch of the HAL Project at le Sans Fil. HAL is a distribution system for getting locally-produced digital art, music and video out on a community wireless project like le Sans Fil. Kinda puts the "community" back into "community wireless"... a great idea. The HAL Project software is of course available for download as an Open Source project, which is good news for other community wireless projects out there. tags:

15 October 2006

Florian Ragwitz: Random seeking on gzip streams

After asking the lazyweb on how to seek on gzip streams I got a very useful and comprehensive reply by Paul Sladen. As my previous searches on this topic didn't turn up to much useful things I'd like to publish Pauls reply (with his approval) here to help other people having the same problem as well:
Paul Sladen:
Seeking on compressed streams is a little like reading sectors from a harddisk; to read one byte requires reading a much large sectors. Two things are needed, the sector size and the sector length. On a hard-disk the sector length is nominally 512 with the mapping between an offset and sector start often as simple as: $offset >> 9. In compressed streams, the relationship between stream position and sector start is non-linear. Using a non-linear mapping is more involved as searching a lookup table is required. Mapping between an uncompressed position instead cannot be calculated and a 'zmap' table listing all sector start position and corresponding on-disk points needs to be created. The size of a sector must be determined aswell. Bzip2: It is fairly easy to seek on compressed bzip2 streams. In a Bzip2 stream, each block is totally separate and self contained---have a look a the 'bzip2recover' program. 'bzip2recover' scans through a bzip2 stream locating each block/'segment' (normally 900kB of input, so ~200kB of compressed output), then copying each segment to separate bzip2 file. Gzip: Seeking on gzip streams is somewhat more involved; Gzip uses a dictionary design where back-references are made to uncompressed data within the last 32kB ("the window"). The only safe place to start reading a 'sector' in a gzip stream is somewhere where that the dictionary size is zero. An empty dictionary occurs at the start of a stream, or where the stream has been 'reset'. Gzip resets: A gzip 'sector' (the length required to be read, to safely decode a byte) could be the full length of the file-size, or could occur more frequently. A gzip sector start occurs when the stream is reset---resetting the stream more frequently leads to more sector starts, but a reduction in compression thanks to less use of the sliding dictionary. Trade-off. The "gzip --rsyncable" is an example of stream resetting; in this case the stream is reset (and the dictionary closed) each time that the sum of the last 4096 octets of input data, modulo 65536(?) equals a magic number (zero normally). In exchange for the extra reset/start points, you get a size increase of 4-5%, but a better "hit rate" for random access. Gzip reset point lookup tables: More likely you'd want to reset the stream every eg. 4096kB of input, then save the corresponding position of the output stream for a give input position. This lookup table of start positions needs to be stored somewhere. 'squashfs' does in a separate file; 'zsync' in the zmap. (If you wanted to define a standard, these reset points could be stored in the 'extra' or 'comment' fields at the start of a gzip file; storing them with a suitable header would enable some degree of seeking for sufficiently intelligent readers---files could be post-processed to add this data). Storing a LUT takes space; adding extra reset points and storing the LUT data for these extra points takes more space---but I found storing the LUT as a set of double-deltas cut it down; could be gzipped aswell. Gzip partial resets: A gzip stream doesn't just contain 'reset' points, but also 'partial reset' points, a partial resets the huffman tables, but doesn't reset the dictionary. It's safe to stop reading at a partial reset (which effectively shortens the sector length). Whilst not normally possible, partial reset points /are/ able to be used as a starting point /if/ you can populate the previous uncompressed 32kB that forms the dictionary window from another source---'zsync' does this when reconstructing a file, however 'zsync' only does construction in a linear fashion, from the start of a file. Further Reading: Magic words to search for: zsync, squashfs, apt-sync, succinct Succinct is my unfinished project. Succinct involves many parts, one of which covers what you're doing. It might be good to break separate off seeking of compressed streams into a separate project---many small pieces make big problems easier! What I might do is store the LUT in the EXTRA field of the gzip header (limited to 64kB though). Though, within 64kB it would always be possible to construct a useful LUT; based on the final length of the input data, it would be possible to reduce the granularity of the LUT such that it only mentioned 50%, 30%... even 5% of reset points. The LUT itself could be gzipped for extra gain. Hope that's useful, -Paul PS. In all the cases (except one) that I mentioned gzip, I probably meant 'zlib' or 'deflate'! :)
In a later mail Paul also added the following:
Paul Sladen:
BTW, in my search around a bit later for something I turned up two more things that might be interesting: dictzip, examples/zran.c in the zlib source 'dictzip' is a similar idea to what I suggested at the end of the previous email. A lookup table is built and stored in the EXTRA section at the start of the gzip file and the utilities ('dictzcat' et al) then use this look-up table for random-access on the data. 'dictzip' are still slightly wide of the mark, forcing a flush/chunk every 58969 bytes. That number is chosen so that even in the worst case, the compressed version will never be more than 216 in length. However I think their math is slightly wrong as even in the worse case, gzip only generates 5 bytes per 32kB for an uncompresed store. -> ~65514 by my reckoning. Squashfs uncompressable chunks by setting the top bit of the file offset to indicate a true store. Their lookup table format appears to be flexible enough that I /might/ be able to create a table by scanning an existing stream rather than re-encoding. Depends about the 64kB limitation. Mmm.
Thanks Paul!

Russell Coker: day 8 of the beard


The beard is still growing steadily, and I'm still waiting for the beardly powers that some of the bearded delegates at LCA 2006 assured me that I would develop.

Russell Coker: electric cars

Here's an interesting post on the Green's site about the Indian Reva electric car and the attempts to get a permit to drive it on Australian roads.

From the Reva site it seems that the Standard model is a 750Kg two-door hatch-back car to seat four people that bears a resemblance to the most widely known Smart Car. The top speed (of something like 50 or 65Km/h) is also reminiscent of the smaller Smart cars. The Reva site indicates that the Indian government is offering a subsidy to people who purchase such vehicles to try and solve pollution problems.

In Australia we have a standard of living that is a lot higher than most people in India experience. But it doesn't have to continue like that. If the poor leadership shown by the Australian government continues and the Indian government continues doing sensible things then our positions could be reversed.

If there is a Reva in Victoria then I'd like to try driving it, even if only on private property.

Next.

Previous.