Search Results: "tb"

10 June 2007

Russell Coker: costs of driving to work

Mark Greenaway expresses surprise that someone could spend $8000 per annum on petol. I own a 1999 VW Passat 2.8L that does 12.8L/100Km (based on my average driving habits - I record the amount of petrol purchased and the distance driven). I spend an average of just over $60 a month on petrol, so I’m approaching $800 per year. I catch the tram and train to work most days (probably drive to work less than 10% of the time) and use my car very little apart from that (most places that I drive to are close to my house). If I was to exclusively drive to work then that alone would make my petrol expenses approach $8000 per annum. If I was to shop at locations that weren’t so convenient or do recreational driving then the petrol expenses could be significantly greater. The $1000 a year I spend on public transport doesn’t seem so expensive! The http://www.smh.com.au/news/national/hybrid-cars-the-go-as-fuel-price-rockets/2007/06/09/1181089388315.html about the increase in sales of hybrid cars due to fuel price increases. In that article they note that Toyota representatives claim that Prius drivers travel more than the average 15,000 KM per annum. Recently the RACV magazine published an article based on the CNW report (the bogus report paid for by Exxon which claims that the Jeep Wrangler is better for the environment than the Toyota Prius). In response to this I reviewed all adverts for second-hand Prius and Wrangler’s on www.drive.com.au to determine how much these vehicles are driven. I counted a 2006 model as a 1yo car for the purpose of the average. On the 29th of April when I looked at the web site there were 90 Prius and 127 Wrangler on sale for which both the model year and the distance driven were published. Of these vehicles the average distance driven per year for the Prius was 15995Km, and the average for the Wrangler was 11,658Km. Someone who purchases a Prius instead of a V6 car (such as my VW Passat) can expect to save at least 7L per 100KM (based on the assumption of 12L/100Km for a V6 and 5L/100Km for a Prius - this is a conservative estimate, the savings could be greater). That would be a saving of at least 1120L of petrol per annum for the average Prius owner, giving a saving of >$1500 per annum with current petrol prices. Over the 20 year life of the vehicle the average Prius owner can expect to save at least $30,000 on petrol at current prices - but we do expect petrol prices to increase…

Russell Coker: putting HTML codes and other special characters into a blog entry

I often want to write blog posts about HTML code and about source code in various languages. One problem I have is that the characters I want to use have special meanings (EG < and >), another is that I indent source code to make it readable and I don’t want the spaces trimmed from the start of lines. I initially wrote a simple Perl script to replace characters such as < with HTML codes. I then had to extend it to escaping quote characters because Wordpress tries to get smart and change quotes in a way that might look nice when dealing with plain text, but is just a pain when dealing with code. The next problem I had is that when I used the <PRE> tag around some text to preserve the white-space Wordpress would double-space the text (IE insert a blank line between every two lines of code). This was annoying when reading it and in some situations would change the meaning of the code! The solution I have found to these problems is to use the below script and not use the <PRE> tag. Also I tried using the <CODE> tag, but it made no difference to the end result as far as I could see. The below script is what I am currently using. It is working well with shell scripts, HTML, and XML so far. Update: The way that -- is munged by Wordpress to – is something that I find particularly annoying. I already had this in the script but forgot to mention it in the post.
(more…)

9 June 2007

Russell Coker: configuring a Heartbeat service

In my last post about Heartbeat I gave an example of a script to start and stop a cluster service. In that post I omitted to mention that the script goes in the directory /usr/lib/ocf/resource.d/heartbeat. To actually use the script you need to write some XML configuration to tell Heartbeat which parameters should be passed to it via environment variables and which nodes may be candidates to run it. In the below example the type of web means that the script /usr/lib/ocf/resource.d/heartbeat/web will be called to do the work. The id attributes are all arbitrary, but you want to decide on some sort of consistent naming scheme. I have decided to name web server instances web-X where X is the IP address used for providing the service. The nvpair element contains a configuration option that will be passed to the script as an environment variable. The name of ip means that the environment variable will be named OCF_RESKEY_ip. Naming of such variables is arbitrary and a script may take many variables. A well written script (which incidentally does not mean my previous blog post) will have an option meta-data to give XML output describing all the variables that it accepts. An example of this can be seen by the command /usr/lib/ocf/resource.d/heartbeat/IPaddr2 meta-data. In the XML the resources section (as specified by --obj_type resources on the cibadmin command-line) describes resources that the Heartbeat system will run. The constraints section specifies a set of rules that determine where they will run. If the symmetric-cluster attribute in the cluster_property_set is set to true then resources will be permitted to run anywhere, if it is set to false then a resource will not run anywhere unless there is a constraint specifying that it should do so - which means that there must be at least one constraint rule for every resource that is permitted to run. In the below example I have constraint rules for the service giving node-0 and node-1 a priority of 9000 for running the service. In a future post I will describe the cluster_property_set and how it affects calculations of where resources should run.
(more…)

8 June 2007

Russell Coker: Heartbeat service scripts

A service script for Heartbeat needs to support at least three operations, start, stop, and status. The operations will return 0 on success, 7 on failure (which in the case of the monitor script means that the service is not running) and any other value to indicate that something has gone wrong. In the second half of this post (not in the feed) I have included an example service script. It is a very brief script and does not support some of the optional parameters (monitor, validate-all, and meta-data). So this script is not of a quality that would be accepted for inclusion in a Heartbeat release but is adequate to demonstrate the concepts. The XML configuration for a service can have an arbitrary set of name-value pairs, and they are passed to the script as environment variables. For example the below script expects that the XML configuration item named ip will have the IP address used by the service, my script receives this as a variable named OCF_RESKEY_ip. My script doesn’t use the address, it merely allows it to be inherited by the IPaddr2 script (which is part of the Heartbeat distribution) and that script assigns the address to an Ethernet interface. The script is for testing Heartbeat, it mounts a filesystem and starts Apache (which is configured to serve web pages from the filesystem in question on the IP address supplied by the ip parameter). For test purposes the script looks for a file named /root/fail, if this file exists then the status check will always abort. An aborting status script means that Heartbeat can not be certain that the node in question has released all resources that it was using for the service. This means that Heartbeat will have to kill the node via the STONITH service. Such test scripts are the only way to test that STONITH works, and I believe that it’s a necessary part of pre-production testing of a Heartbeat cluster. Update: Made it display error messages in all cases and also reformatted it for better cut/paste.
(more…)

5 June 2007

Matt Brubeck: 5 Jun 2007

My toy is cheaper than yours. My recent purchases:

Martin-&#201;ric Racine: Do you want to take over CUPS maintenance in Debian?

Kenshi sent the following GPG-signed message to the Debian CUPS mailing list today:
Hi folks, As you know, there are many bugs about CUPS including Release-critical and I haven't an enough time to fix them. My primary motivation was to internationalize/localize it. Now it is already implemented by upstream. Unfortunately CUPS is too complex for me to maintain. I haven't a time to track bugs, I haven't an enough knowledge about Postscript or printer specific codes, and I haven't any testbed of user's printers. If you'd like to become primary CUPS maintainer instead of me, I pass a baton happily :) Of course I'll support you such as uploading. Thanks,
Interested parties should contact kmuto directly to manifest their intention.

3 June 2007

Bernd Zeimetz: gimp-plugin-registry

gimp-plugin-registry Dear lazyweb, since a few days there s gimp-plugin-registry waiting in unstable. At the moment the package contains several tiny GIMP plugins I like to use and which are not included in the gimp package or in other gimp-* packages. In my opinion a collection like this one was missing in Debian, since there re a lot of very nice plugins/scripts out there, which are too small to package them on their own.
Which plugins would you like to see in the collection? Packaging all plugins from http://registry.gimp.org/ doesn t make sense, so I d like to know which plugins other people are using and put them into the next release of the package. Any feedback is appreciated. P.S.: As I didn t find a real alternative for my needs, I ll stay with Dokuwiki. As far as I remember is a rss feed with proper html on Andi s todo list, and there re more other nice features going to come :-) Although somehow I still would like to rewrite Dokuwiki in python ;-)

Bernd Zeimetz: hi, planet && iso8859-15 to utf8 with netatalk magic

hi, planet && iso8859-15 to utf8 with netatalk magic Hi, Planet!
Welcome to my blog, and thanks to Martin for subscribing me. I m not going to bother you with any details about me, if you have any questions feel free to ask me on freenode or oftc (in case you re wondering: my nick is bzed).


After a longer time of planning we ve upgraded our main file server at work: New machine, new storage (7TB - woohoo!), Etch instead of Sarge and UTF-8 for file names instead of ISO8859-15. Everything not a too complicated thing, except for renaming the about 10,000,000 files from ISO8859-15 to UTF-8 in a proper way.
In theory this is easy, as convmv happily takes care of the problem. But this did not work for us unfortunately, as we re not only providing NFS and Samba services, but also AFP (Apple_Filing_Protocol) via netatalk. Years ago you had to choose ISO8859-15 if you wanted to allow your Apple and Windows users to see the same, non-broken file names - not only because AFP didn t support UTF8 before version 3, which came out with OSX1). Normally you d think that a server would not allow a client to write a file with a file name which includes not supported characters - again, OSX and netatalk go their own way here:
Characters which are not supported by the underlying file system are character(!)-wise encoded using the CAP encoding. So we had to find a way to Luckily netatalk ships the uniconv(1) util2) which is able to take care of this problem. It also updates the CNID3) Database at the same time. There s two things you need to take care of in case you re using the dbd CNID backend: Be careful: uniconv assumes that all colons in a file name are part of a CAP encoded character. That s not a problem as long as you have only Mac and Windows clients accessing your server, as both systems do not allow colons in file names. In our case we found a number of cache files from Nautilus (which is running on our sunray/Solaris web-surf terminals as default browser) with colons in the file name. I hope no user will miss them ;-) Including a final synchronisation of all files to the new storage, about two hours it took uniconv to convert the file names and a aunch break, we were finished after about 14 hours of work. Until now it seems that our users didn t notice the change at all, except for those who realized that they have much more free space now. Looks like a successful weekend so far! :-D 1) and uses a NFD variant of Unicode normalization (UTF-8#Mac_OS_X), but netatalk takes care of this and translates it into the NFC form, which is used on most other platforms 2) it s called netatalk-uniconv in Debian and shipped with netatalk 3) Catalog Node ID, another crust from old Mac OS versions

1 June 2007

Cameron Dale: May-31-2007: HTTP Range Requests

I wasn't sure if some/many/all Debian mirrors responded correctly to HTTP/1.1 range requests for only part of a file, so I ran a test on them (download part of the etch Release file). These type of requests will be useful for downloading missing pieces from packages in the BitTorrent-like downloader that I'm writing. Here are the results of my test on the 221 HTTP mirrors:
Status Description Count
200 Full Data 1
206 Partial Data 208
302 Document has moved 2
404 Not Found 2
Couldn't Connect 8
Total 221
So only one mirror (debian.csie.nctu.edu.tw) was unable to support the range request and instead returned the entire file. It seems like using range requests will be fine, though I'll have to think about some kind of error checking for that one lonely mirror that's not like the others. There was also one mirror that responded with an old Release file. It seems like debian.ihug.co.nz has not been updated since etch was released.

30 May 2007

Russell Coker: Another Heartbeat 2.0 STONITH example configuration

In a Heartbeat cluster installation it may not be possible to have one STONITH device be used to reboot all nodes. To support this it is possible to have multiple STONITH devices configured that will each be used to reboot different nodes in the cluster. In the following code section there is an example of how to configure STONITH for two separate ssh instances. Of course this is not useful apart from as an example of how to configure STONITH. It would be quite easy to change one of those ssh configuration entries to use IPMI or some more effective method of managing machines. My previous post on this topic has an example of a simpler ssh STONITH configuration. It is convenient that the ssh method for rebooting nodes is available both as a shared object (which is used by the following example XML) and as a shell script (type external/ssh). The shell script can be used to give the same functionality as the shared object (with reduced performance) but the benefit is as an example of how to write external plugins. For a client I have just written an IPMI module that works with machines that have two Ethernet ports. When a server has two Ethernet ports you want to send an IPMI reset command to both of them in case the failure which requires a STONITH was triggered by a broken Ethernet cable. Unfortunately I can’t release the IPMI code at this time (more…)

Martin Zobel-Helas: Some impressions from German LinuxTag 2007

It is not high crowded here, but we have about 2-3 visitors at any time at the booth. No Tags

David Welton: Simple item-based collaborative filtering with Rails

I suspect there is room for improvements with this, since it is really simplistic, and I certainly am not an expert in the subject. But it works ok for small numbers of items:
def Pair.from_items(items)
  Pair.transaction do
    res = []
    all = items.reject    i  i.name == ""  .collect    i 
            i.name.downcase  .sort
    all.collect    i  ([i]*all.length).zip(all)  .each    i  
            i.each  j  res << j   
    res = res.each    i  i.sort!  .uniq.reject    p  
            p[0] == p[1]  
    res.each do  pair 
      p = Pair.find(:first, :conditions => 
                            ['val1 = ? and val2 = ?', 
                             pair[0], pair[1]])
      p  = Pair.new(:val1 => pair[0], :val2 => pair[1],
                     :num => 0)
      p.num += 1
      p.save!
    end
  end
end
Basically what happens is that for a list of items [A, B, C, D], it calculates and inserts into the database that A and B have been purchased/rated/viewed/whatevered together once. Same for A and C, A and D, B and C, and so on. After accumulating enough of these pairs, you can query the datbase for an item - B for instance - and see what it's been purchased with the most times, and recommend that to people who have shown an interest in B. When someone purchases a group of items togehter, you call Pair.from_items(the_items) and it takes care of inserting the various combinations.

29 May 2007

Russell Coker: Heartbeat version 2.0 CIB STONITH example configuration

Below is a sample script to configure the ssh STONITH agent for the Heartbeat system. STONITH will reboot nodes when things go wrong to restore the integrity of the cluster. The STONITH test program supports the -n option to list parameters and the -l option to list nodes. The following is an example of using it with the ssh agent:
# stonith -t ssh -n
hostlist
# stonith -t ssh hostlist="node-0 node-1" -l
node-0
node-1
The hostlist tuple is the only configuration option for ssh. It is assumed that you have passwordless ssh logins allowed between root on all the nodes in the cluster so the host name list is all that’s needed. The important thing to note about the constraint is that you are constraining the parent of the clones (which in this example has an ID of “DoFencing“) not a clone instance. ssh is the simplest and in many ways least useful method of STONITH, but it’s good for an example as everyone knows it. Once you get ssh going it’ll be trivial to get the other methods working. See below for the script to insert the XML in the CIB.
(more…)

28 May 2007

Russell Coker: paypal - are they trustworthy now?

Having read paypalsucks.com I am concerned about the safety of my money if I was to chose to do business with them. However there are many ways of making money by using them. Does Paypal still suck? If so are there any other better options? The merchantinc.com recommended by paypalsucks.com seems to only cater for business customers.

Russell Coker: New Blogs

After reading advice from ProBlogger I have become convinced that I should create separate blogs for some of the content that is currently on my blog. The first such blog that I will create will be about computer security. Naturally it will cover SE Linux to some degree, but the exact focus is something I have not yet determined. Here are the options I’m considering: Also if you have any other suggestions for blogs that you would read if I was to write them then plese send them in via a blog comment or email.

27 May 2007

Christian Perrier: Reportbug-ng l10n

Bastian, may I suggest "man podebconf-report-po"? Yes, you can use it also for non-debconf translations. Just use "podebconf-report-po --call --podir=." from the po/ directory of your software.

Bastian Venthur: Please help to localize reportbug-ng

I’ve just uploaded a new version of reportbug-ng. The biggest change in this release is the new reportbug-ng.pot file which contains some work for our brave localization teams. I’ve already translated rng into German, so rng is now available in German and English. If you want your mother language to appear in this list, please grab the .pot, translate it and file a l10n+patch bug against reportbug-ng with the translation attached. Thanks!

Alastair McKinstry: Darkness reduces Crime?

Thanks to Apparent Brightness for this snippet:
In the northern Swedish town of vertorne , a dispute between the local council and its electricity distributor has meant that the town has had no streetlighting for many months now (TV programme in Swedish about the controversy here). Today Swedish television and other media report that since the streetlights were switched off, thefts and burglaries have halved. Maybe the thieves are afraid of the dark , says council boss Arne Honkamaa. On the other hand, maybe it s being able to see the night sky that s reducing crime.
Tags ,

26 May 2007

David Welton: Airlines and rand()

Ilenia and I are looking for tickets to go "home" (Eugene, Oregon) this summer. We've had pretty good luck with Lufthansa in the past (as opposed to Air France, which lost a huge bag of my stuff), so we turned to them first to look for flights. I like the page they have for prices/dates, which gives you a nice way to look around for a better price without stabbing randomly at dates: Big long Lufthansa URL However, the maddening thing is that the prices change frequently. Not every day, but often after even 5 minutes! They bounce around up to 100 euro at a time. I understand the theory behind price descrimination, but this is the classic case where the customer ends up feeling like they're being made fun of and goes elsewhere. United, in our case, which offers a cheaper price for the same plane (they're Lufthansa's partner and thus share flights).

Evan Prodromou: 5 Prairial CCXV

Incredible day here in Montreal. The temperature got over 31C today -- about 88 F -- which made for a steamy, jungly day. Remember how I said we had predictions of snow flurries two weeks ago? Things change quickly. Of course, hot weather and high humidity are a recipe for smog. Add on top of that the fact that Montreal is in the middle of a public transit strike, and you've got a serious air quality problem. Fortunately we should have some rain this weekend to shake that out. tags:

EC2 I spent a big part of my day twiddling around getting a nice Ubuntu server running on Amazon Web Services. Amazon's EC2 is an innovative server-provisioning API; beta testers for EC2 can build or tear down servers for any purpose in a few minutes using EC2 and Amazon S3. I wrote a few years ago, in a widely-reproduced email, a reply making fun of Jeff Bezos and Amazon's supposed innovations. But let me be frank: Amazon Web Services are a shithouse crazy idea. I think that Jeff Bezos must have been a complete nutjob to bet the company on these zany technologies; I also think it's brilliant, and it's going to change the way we think about using computers. I included EC2 in Ten Web 2.0 APIs you can really use. I think that decision was really justified. My EC2 instances now run Ubuntu Feisty Fawn; lighty, MySQL and PHP. It seems to be a winning combination; I'm looking forward to using EC2 for a production Web or database server. tags:

rel-edit I mentioned already the great work that AboutUs.org is doing to organize a Universal Wiki Edit Button. I decided to kick in on the machine-readable side and proposed a rel-edit microformat. So far the microformats-discuss mailing list has been pretty positive on the idea, but I'm going to wait a few days before posting a draft on the microformats wiki. tags:

Salt I just finished reading Salt: A World History, a nice non-fiction book by researcher extraordinaire Mark Kurlansky. The book covers this important mineral, its importance to human life, and the many ways to extract it to make it available for us. The book covers mummification in ancient Egypt, salt taxes in China, fish sauce in Vietnam, and Mahatma Gandhi's great salt march in India. It's so comprehensive that it can really make your head spin; but it's also exciting to see world history refracted through these whitish crystals. I think it's a great book, and I'm looking forward to reading Cod: A Biography of the Fish That Changed the World, by the same author. But we just got Everything is Miscellaneous from Amazon this week, so I think I'll be digging through that before I get to Cod. tags:

reCAPTCHA I heard about recaptcha via Hugh's article about same. Brilliant idea; why didn't someone think of this before? (Update: it was about 5 minutes after I posted this that I realized, "Hey! That can't work!" So I went back and re-read the docs on reCAPTCHA again. Now I'm even more impressed.) tags:

I want to ride my I've been thinking of picking up a bicycle for a few weeks now, as the weather has cleared here in town. So today I went up to Garantie Bicycle on rue Marie-Anne and bought the cheapest damn bike they had that wasn't made specifically for pre-pubescent children. Woohoo! The last time I had I bike, I lived in San Francisco. It was a beautiful cherry-red Cannondale hybrid -- with that great fat Cannondale tube, but light enough that I could lift it with one finger. I rode it around SF a lot, and took it out for trail biking on weekends in Marin County and the Peninsula and even the Sierra Nevada. It was a tough bike to ride, but once you got used to it it was a dream to take up hills. But that bike was stolen at Burning Man 2001, during the actual Burn. It's a classic mistake: professional bike thieves go to Burning Man each year to snag bikes left unlocked by tired and idealistic Burners, especially at times when camps are left empty, like during the Burn. To be honest, it was kind of a relief: I'd already moved out of my apartment and was planning a trip around North America, and I didn't have room in my Citro n DS for a bike. Nor in my storage locker at the weird and wonderful Sunshine Storage in Oakland. But it was too nice a bike to throw away or give to one of my no-good friends, who were mostly too short for it anyways. So bicycle theft was the best solution. Sam Phillips had his bike stolen at the same time. The bike thieves left a lot of cheapo bikes around our camp. They liked mine and Sam's, though. Anyways, my new bike was quite inexpensive, and it weighs a metric ton. It's built like you're supposed to drive trains over it. I could never, ever carry it up a steep and muddy hill, and I wouldn't bother. Fortunately for me Montreal is really, really flat, so I don't really need to worry about riding this thing up hills. It will look pretty good with a baby seat on the back, though. tags:

Next.

Previous.