Search Results: "spa"

29 January 2009

Julien Danjou: What's new in awesome 3.2

We're working since several month on awesome 3.2, and here is what you'll get soon: We've done a nice job. :-) Thanks to all contributors! See you soon for the first release candidate version

MJ Ray: identi.ca and twitter OLPC - One Line Per Contact

I ve been having fun with identi.ca and twitter recently, but some of my contacts, friends, followees, subscriptions (or whatever you want to call them) send many more messages than others. One contact gave a running commentary on his progress up the floors of a building yesterday. Fine, but a bit of a torrent of data. If someone posts and leaves it for a while, it s sometimes an explanation of where they ve gone, so I d like to check people s last tweets. I ve seen some clients do that and it seems there s a method in the API to do it. The API returns XML, so I m using XSL to transform it to xhtml (I ve still not taken the time to learn the XML CSS ways) with the following commands:-
	wget --no-check-certificate -O - https://username:PASSWORD@identi.ca/api/statuses/friends.xml   \
	sed -e '1a\
<?xslt-param name="site" select="identi.ca"?>\
<?xml-stylesheet title="Site Summaries" type="text/xsl" href="twitters.xsl" ?>
' > identica.xml
And here s twitters.xsl which converts the downloaded xml to xhtml:-
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0"
 xmlns="http://www.w3.org/1999/xhtml"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="site">twitter.com</xsl:param>
<xsl:template match="/" xml:space="preserve">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title><xsl:value-of select="$site" /> Friends</title>
<link rel="stylesheet" type="text/css" href="mirrors.css" />
</head><body>
<dl class="statuses">
<xsl:apply-templates />
</dl>
</body></html>
</xsl:template>
<xsl:template match="/users/user" xml:space="preserve"><dt><a href="http:// $site / screen_name "><img src=" profile_image_url " /><xsl:value-of select="name" /> (<xsl:value-of select="screen_name" />)</a> - <a class="time" href="http:// $site / screen_name /statuses/ status/id "><xsl:value-of select="status/created_at" /></a></dt><dd><xsl:value-of select="status/text" /></dd>
</xsl:template>
</xsl:stylesheet>
Have fun! (And what have I done wrong?)

Bdale Garbee: Facial Dignity

People keep asking me about the beard thing... Here's my take on what happened and why. Just before I left for LCA 2009, my wife offered to send along one of the limited edition prints of her award-winning waterfall photograph. She knew from prior years that the LCA organizers often host an auction or raffle to raise money for some worthy charity at the conference banquet. Since the photo was taken at Milford Sound on the way to last year's LCA in Melbourne, there was a connection between the photo and LCA. We had no idea what this year's charity might be, nor did we anticipate that her photo would become the centerpiece of the evening's fund-raising activities. The charity selected this year was an organization that is trying to save the Tasmanian Devil from extinction. Professor Hamish McCallum, the chief scientist with the program, gave a talk after dinner and before the auction began. The native population is suffering from a fatal facial tumor disease that results in horrible lesions, and is likely to kill off all the Devils within a decade or three. My family and I all have a strong love of nature, and Karen and I had the pleasure of touring Tasmania after LCA 2003 in Perth, so this seemed like a great charity to raise money for with her photo. As often happens at LCA, the auction and related fund-raising activities got complicated. This year, the photo alone was bid up to $2500 (which was very cool!), before people started offering things for higher bids. For years, going maybe as far back as Perth, I've been cajoled about shaving my beard if the bidding hit some level, and have always said no. This year, someone offered $5000 if I would shave my beard, and again I said no. Much later, after more cajoling and many counter offers, when the bids and various matching offers had us approaching $20,000 in total donation to the charity, I relented and announced that if we hit a total of $25,000 going to the charity I would consent to a shave. The resulting frenzy, including the suggestion that if it went high enough Linus should do the shaving, and the formation of a bidding consortium that kept raising more money and bidding against itself, was completely unexpected! Others have tried to capture details of the insanity, but the bottom line is that by the end of the evening, the total had blown way past anything we could have imagined, and by the end of the conference the total going to the charity was on the order of $40,000! Why did I agree to let Linus shave my beard? To be honest, I'm not entirely certain. I only had one beer that evening, so I can't blame intoxication. The fact that it would yield a worthy charity something over 10 times what my wife's photo alone had drawn as a maximum bid seemed significant to me. In hindsight, I also think I was at least a little bit curious to see what my face looked like after having a beard since sometime around September of 1982! In any case, I made the offer, insane amounts of money were raised, and on the last day of the conference, over the lunch hour, Linus took trimmers in hand and removed my beard in front of an audience. The reactions have been completely overwhelming. A local TV station and a local newspaper in Hobart were both there and ran stories. The ripple of mentions in the blogosphere was and is just astounding. There's even a silly Shaving Bdale game created overnight by the "Mad Scientists" at Secret Lab! And from all over the globe, people I do and don't know have been sending emails and finding me on IRC to plead with me to grow my beard again! Right after the shave, my good friend Keith Packard said "Bdale, grow it back!". Before I left Hobart, my wife emailed saying she and the kids hoped I wasn't waiting until I got home to start. Joey Hess blogged a hairy tale about how I'd scarred the minds of young Debian developers. The leader of Debian-RS sent word by email that the group all hoped I would re-grow my beard. And on and on and on... I'm really not used to being the center of so much attention! Being suddenly without beard felt weird in lots of silly little ways. I was hyper-sensitive to drafts. The feel of cold beverages hitting my upper lip was downright strange. And I kept wanting to scratch what wasn't there! After making faces at myself in the mirror for a while, I decided I really wasn't happy, and do prefer being bearded. So I haven't shaved since Saturday morning in Hobart, and am pretty scruffy looking. My wife said today that I'm "already starting to look like Bdale again". At the current growth rate, I have high hopes of having at least some facial dignity back by the time I speak at FOSDEM. And no, I won't be shaving my beard off again any time soon...

Andrew Pollock: [life] And she's discharged

Sarah was discharged today. I decided to scrap trying to go to work, as I'd just have to leave at some point to pick her up. The hospital had to ensure that the nurse from Critical Care Systems was able to come to our home before they could discharge her, so that the IV antibiotics could be continued. We left the hospital at about 11:30am, and he got to our place just after 1pm. He whizzed through the whole process, as she was due for more antibiotics at midday and he wanted to get the IV started. She's on a four hourly course. Fortunately, that doesn't mean we have to change the IV every four hours. The way it works is the bag has enough antibiotics in a (presumably saline) solution to last six infusions on a four hourly frequency, and it's hooked up to a pump (that'll cost us $5000 if we don't give it back at the end), which takes care of everything. So once a day at around noon, Sarah has to disconnect the old bag, flush the line with saline, do something with some Heparin to prevent clots in the line, and hook up a new bag. The bag and the pump fit into a carry bag that can be worn like a bum bag or slung from her shoulder and looped through a belt. It'll be her permanent companion for the next (hopefully only) two weeks. The PICC has two ports (and I don't think that's the correct term) on it, and the IV is only hooked up to one, so the other one should be flushed and "Heparinised" regularly as well. The nurse comes back in a week with more supplies and to do some maintenance on site where the PICC line enters her arm. Critical Care Systems seems pretty impressive. They provide all the gear, fill the prescription, and bring it all out to you (by a nurse). They provide a 24 hour hotline to call if there's any problems, questions or concerns, and can dispatch somebody to us if necessary. We've got syringes preloaded with saline and Heparinised saline, more alcohol swabs than you can poke a stick at, and the fridge is full of IV bags. It's awesome that medical technology has progressed to this point, where Sarah can go about her business almost as normal, instead of being stuck in a hospital for another two weeks just because she has to have a tube in her arm. To prove this, the little trooper was back at her CNA course this evening, and starts clinical training tomorrow night.

28 January 2009

Russell Coker: Links January 2009

Jennifer 8 Lee gave an interesting TED talk about the spread and evolution of what is called Chinese food [1]. In that talk she compares McDonalds to Microsoft and Chinese restaurants to Linux. Her points comparing the different local variations of Chinese food to the variations of Linux make sense. The CentOS Plus repository has a kernel with support for the XFS filesystem, Postfix with MySQL support, and some other useful things [2]. Mary Gardiner comments about the recent loss of a blog server with all content [3]. One interesting point is that when you start using a service that maintains your data you should consider how to make personal backups in case the server goes away or you decide to stop being a customer. Val Henson makes some interesting points about the reliability of Solid State Disks (SSD) [4]. Some people are planning to replace RAID arrays of disks with a single SSD with the idea that a SSD will be more reliable, this seems like a bad idea. Also with the risk of corruption it seems that we have a greater need for filesystems that store block checksums. Lior Kaplan describes how to have multiple Linux bonding devices [5], the comment provides some interesting detail too. programmableweb.com has a set of links to sites that have APIs which can be used to create mashups [6]. One of the many things I would do if I had a lot more spare time is to play with some of the web APIs that are out there. Gunnar Wolf has written some insightful comments about the situation in Israel and Palestine [7]. He used to be a Zionist and spent some time living in Israel so he knows more about the topic than most commentators. Charles Stross has written an informative post about Ubuntu on the EeePC [8]. What is noteworthy about this is not that he s summarised the issues well, but that he is a well known science-fiction writer and he was responding to a SFWA member. One of his short stories is on my free short stories page [9]. He also wrote Accelerando which is one of the best sci-fi novels I ve read (and it s also free) [10]. Don Marti has written about Rent Seeking and proprietary software [11]. It s an interesting article, nothing really new for anyone who has followed the news about the coal and nuclear industries. Erik writes about The Setting Sun and points out that Scott McNealy had tried to capitalise on the SCO lawsuit but Red Hat has ended up beating them in the market [12].

MJ Ray: World Economic Forum 2009 in Davos

The World Economic Forum opens today (28 Jan) and runs until the weekend. This year most of the high-power planning sessions and feel-good corporate social responsibility whitewash has been replaced by sessions such as What Happened to the Global Economy? (Er, it broke because you bet more money than existed in the world?) There s a report from France24 and a programme of sessions. Like WEF in previous years, selected sessions are broadcast on SFinfo in German and Original Languages (often English) on Hotbird at 13east. Additionally, this year, there are webcasts (maybe the podcast version will play on free software) but it seems that none of the computing sessions are up for broadcast. Economics rules the airwaves for 2009. My main reason for posting here is to boggle at the WEF myspace competition. Isn t Myspace about the least appropriate of the big social networks for an economics forum? I suspect some payment or benefits from the network that Rupert Murdoch s company bought. There s also @davos which seems to be talking much more than listening seems appropriate for WEF, no?

27 January 2009

Peter Van Eynde: KDE 4.2 Xserver 7.4~5 and I'm feeling good

I installed the 4.2 KDE from experimental and ... wow. Nicer. Faster. Less display corruption. All in all good.

shame about the crash when I unplug my external display

I can't wait for the 'testing' release :-)

Congratualtions to the KDE and debian-KDE people!

26 January 2009

Marco d'Itri: A Linux-based alarm clock

That is, my laptop. Since at night I keep it in the same room where I sleep, I figured that I could as well use it as an highly customizable alarm clock. My alarm script uses rtcwake(8) from util-linux-ng to set the RTC alarm clock, suspends the computer and then plays some music at a set volume when it wakes up (if it never wakes up, check your BIOS settings). Since it uses the date(2) command it can parse the alarm time in many formats.
#!/bin/sh -e
# for a random tune, list multiple space-separated files
MUSIC='/home/mp3/The_Velvet_Underground/The_Velvet_Underground_&_Nico/07_Heroin.mp3'
# some days I like different music
DOW="$(date +%u)"
if [ $DOW -eq 6 -o $DOW -eq 7 ]; then
  MUSIC='/home/mp3/The_Velvet_Underground/The_Velvet_Underground_&_Nico/01_Sunday_Morning.mp3'
fi
# choose your favourite music player
player()   mpg123 --random --quiet --control --title "$@"   true;  
#player()   mplayer -loop 0 "$*";  
# play the music at this volume
VOLUME='50%'
# ALSA mixer control used to set and restore the master volume
VOLUMECTL='iface=MIXER,name="Master Playback Volume"'
##############################################################################
# this is more elegant, but it needs rtcwake from util-linux-ng >= 2.14.2
rtcwake_set_alarm()  
  local when="$1"
  local rtc="$2"
  if [ "$rtc" ]; then rtc="--device $rtc"; fi
  local epochtime=$(date --date "$when" +%s)
  [ "$epochtime" ]   return 1
  sudo rtcwake $rtc --mode no --time $epochtime
 
# you can use this function instead if your system lacks a working rtcwake
set_alarm()  
  local when="$1"
  local rtc="$2"
  [ "$rtc" ]   rtc='rtc0'
  local epochtime=$(date --date "$when" +%s)
  [ "$epochtime" ]   return 1
  local alarmfile="/sys/class/rtc/$rtc/wakealarm"
  sudo sh -c "echo 0 > $alarmfile && echo $epochtime > $alarmfile"
 
##############################################################################
if [ "$1" ]; then
  WHEN="$1"
else
  echo "Usage: $0 WHEN"
  exit 1
fi
set_alarm "$WHEN"
# save the volume
oldvolume="$(amixer cget "$VOLUMECTL"   sed -nre '/ : /s/.*=//p')"
amixer -q cset "$VOLUMECTL" $VOLUME
# actually here I run a script which also deals with network interfaces,
# IM and IRC clients and so on
sudo pm-suspend
player $MUSIC
# restore the volume
amixer -q cset "$VOLUMECTL" "$oldvolume"
exit 0

Y Giridhar Appaji Nag: Wagah-Attari and Hussainiwala

Pakistan flag and Emblem of India Fellow countrymen, happy Republic day to you all.

Any trip to Punjab is incomplete without atleast one visit to the daily tamasha at the Wagah-Attari border. This is probably one of the few places on earth where you would see the Pakistan flag right next to the Emblem of India.

I arrived at the place a couple of hours before the vening flag down ceremony but was too late to be able to get a comfortable seat in the crowd of a few thousands; the place was already packed. Luckily, a BSF ranger (who incidentally was not allowing the crowds in any more) looked at my tripod and camera, thought I was a journalist and led me to the VIP section which is as close to the gates as one can get.

For a very long time preceding the ceremony, there is nationalist music blaring on the tannoys, crowds screaming in unison: LA ilAha ill-Allah on the Pakistani side and vandE mAtaram, bhArat mAtA ki jai on the Indian side. On either side of the border gates, kids run up and down the road with their respective national flags while young men climb onto the top-most walls and wave flags high in the air. One gentleman was commenting that while women on 'our' side are allowed to dance and sit anywhere, 'they' don't allow that, "see how the men and the women there are grouped separately".

Thousands of spectators Waving the Pakistan flag Waving the Indian flag Women dancing

The half hour of the retreat ceremony is full of action with the Indian BSF rangers in their red turbans and khakhis, and the Pakistani rangers in black salwaar-kameez marching heavily down the road, glaring into each others eyes, competing on who can kick higher into the air and possibly also on who has the best kept moustache. The rangers on either side of the gates know that they are entertaining their home crowd and spare no effort to do their best.

Indian BSF rangers marching Indian BSF rangers at-ease
Indian ranger marching towards the gate Indian BSF ranger Indian BSF ranger
Border gate, Pakistan crowd and rangers India and Pakistan flags Crowds going back home

The retreat ceremony is so popular that it is difficult to allow in all the people that come in to watch. So a clone of the ceremony has been setup at the Hussainiwala border. However, Hussainiwala is popular not because of the flag retreat, much less because the 1971 war memorial still has a lot of marks of artillery firing, but because of Bhagat Singh's memorial. The memorial moves one to tears.

Hussainiwala: Sukhdev, Bhagat Singh and Raj Guru Hussainiwala bridge: Sympathetically detonated in the 1971 war

Few more pictures from the Hussainiwala memorials:

Hussainiwala: Sukhdev, Bhagat Singh and Raj Guru Hussainiwala: Bhagat Singh memorial Hussainiwala bridge piers and war memorial Artillery fire on Hussainiwala bridge piers Artillery fire on Hussainiwala bridge piers

John Goerzen: How The Wind Got Us A New Camera

A little while back, Terah was leaving the house one morning. On that particular morning, we had an unusually intense even for Kansas wind. It caught the storm door and whipped it around with such force that it bent the metal arm that goes into the pneumatic plunger, and even bent the bracket that the arm connects to. It was not possible to un-bend either of them with household tools, even with dad s help. So I went to the hardware store and picked up a replacement. But I had been putting off actually replacing it because, well, the door almost closed automatically and there were more important things to get to. Until yesterday. I got out the tools and went to work. Jacob was around and took an interest in the activity. I was stretched out on the floor on my stomach working with the drill to try to get out some extremely tight screws without stripping them. And Jacob, at one point, got down on the floor on his stomach right beside me, and proudly announced I (am) like dad! Terah was working on something nearby, and noticed this, and went for the camera. Unfortunately, I had left its CF card in my digital audio recorder. She found the other card, and was hurrying to put it in so she could get the cute picture. Even more unfortunately, she inserted it sideways. CF slots have 50 tiny pins in the space of 1.7 inches. The slots normally force the card to align properly, but not when the card is put in sideways. It slid back and bent a pin back. The slot is thus unusable. I was going in to town anyway to pick up my bike from the bike shop, so I stopped at Moler s Camera on the way. This is my favorite camera shop it s the sort of place where you take a seat at the counter while they help you. I showed the sales guy the camera and he knew off the top of his head that the cost to fix it is $206. Which is pretty much in line with reports on the Internet. The old camera is a Canon Digital Rebel XTi (EOS 400D). It s over 2 years old, so out of warranty, but I wasn t planning to upgrade soon. On the other hand, the camera shop estimated that they could buy the XTi from me for about $150 to $200, considering its condition, and a new XSi (EOS 450D) is $570 at B&H. So about $200 to fix the old one, or about $400 cost to us to get a new one and the next model up, which uses SD instead CF, and thus will never have a bent pin again. With that kind of cost, we decided to spring for the XSi. Plus, it would take about a month to get the repair on the XTi. So there you have it. The wind can be expensive and cause camera upgrades.

25 January 2009

David Pashley: Subversion and "(502 Bad Gateway) in response to COPY request" errors

Was attempting to merge a branch in one of my projects and upon committing the merge, I kept getting this error:
mojo-jojo david% svn commit -m "merge in the maven branch"
Sending        trunk
Sending        trunk/.classpath
Sending        trunk/.project
Adding         trunk/.settings
svn: Commit failed (details follow):
svn: Server sent unexpected return value (502 Bad Gateway) in response
to COPY request for '/svn/eddie/!svn/bc/314/branches/maven/.settings'
A quick search found several other people having the same problem. Seems it only happens for https repositories using mod_dav_svn. The solution is to make sure that your virtual host in apache has explicit SSL config options, even if you are using an SSL config from a default virtual host. For example, I added the following to my subversion vhost, which was just copied from my default vhost:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/catnip.org.uk.crt
SSLCertificateKeyFile /etc/apache2/ssl/catnip.org.uk.key
Read Comments (0)

Chris Lawrence: In which I admit I am a dork

Instead of doing something productive today, I spent the day in San Antonio at an OpenStreetMap mapping party. I got to meet some interesting folks and play OpenStreetMap teacher some, and it s nice to be reminded that at least one of my dopey childhood hobbies has some practical application in the real world. And of course I got to put some more miles on the new car, which was fun too. Thanks to the folks at CloudMade, and particularly their community ambassador, for putting the meeting together as well as for the swag. I can t quite figure out how they think they re going to make money off of OSM, at least until the OSM data gets in a lot better shape, but I suppose that s their problem and not mine.
By the way, for those who ve hung on until this point (or were actually looking for some useful OpenStreetMap advice), here s my GPSBabel recipe for converting NMEA track logs from my Amod AGL3080 GPS logger into GPX track logs that can be imported into OpenStreetMap: gpsbabel -t -i nmea -f infile.log -x simplify,error=0.0005k -x discard,hdop=6 -o gpx -F outfile.gpx Basically this throws out bad GPS fixes and simplifies all of the data to throw out any points that would deviate from the current straight line by less than 0.5 meters. At least with the Amod GPS unit once it s got a good fix it seems to stay pretty accurate, even with the static navigation feature off (using the SN OFF firmware), as long as you don t leave it somewhere under partial cover.

Chris Lamb: Matching IPs with regexes conCIDRd harmful

Some rather unfriendly software (Munin, lighttpd, etc.) require that IP ranges are specified using regexes instead of the usually more convenient CIDR notation. The following code converts instances of that notation to a regular expression. The generated pattern assumes that the input is a valid IPv4 address; that is to say, matching 0.0.0.0/0. Patches for common prefix optimisation greatly appreciated.
def cidr_to_regex(cidr):
    ip, prefix = cidr.split('/')
    base = 0
    for val in map(int, ip.split('.')):
        base = (base << 8)   val
    shift = 32 - int(prefix)
    start = base >> shift << shift
    end = start   (1 << shift) - 1
    def regex(lower, upper):
        if lower == upper:
            return str(lower)
        from math import log10
        exp = int(log10(upper - lower))
        delta = 10 ** exp
        if lower == 0 and upper == 255:
            return "\d+"
        if delta == 1:
            val = ""
            for a, b in zip(str(lower), str(upper)):
                if a == b:
                    val += str(a)
                elif (a, b) == ("0", "9"):
                    val += '\d'
                elif int(b) - int(a) == 1:
                    val += '[%s%s]' % (a, b)
                else:
                    val += '[%s-%s]' % (a, b)
            return val
        def gen_classes():
            floor_ = lambda x: int(round(x / delta, 0) * delta)
            xs = range(floor_(upper) - delta, floor_(lower), -delta)
            for x in map(str, xs):
                yield '%s%s' % (x[:-exp], r'\d' * exp)
            yield regex(lower, floor_(lower) + (delta - 1))
            yield regex(floor_(upper), upper)
        return ' '.join(gen_classes())
    def get_parts():
        for x in range(24, -1, -8):
            yield regex(start >> x & 255, end >> x & 255)
    return '^%s$' % r'\.'.join(get_parts())

24 January 2009

James Morrison: SimTower

I found a reference on the 'net about a week ago about SimTower. I remembered playing it a long time ago and thought it would be fun to try again since I hadn't beaten it. so I found my old copy and started playing. I've acheieved TOWER status in the game in 9 years.

The basic plan I used to beat the game was to build as wide as possible and to use 3 normal elevator shafts per 15 floors, 8 stairs and 2 escalators. Primarily my building was all offices. For the there are two sets of stairs going up 3 floors from each lobby. There is also an escalator going down from the lobby for each set of stairs and one more set of stairs going down a floor from the escalator. For the floors that have stairs going to them, there should be no elevator for that floor.

Now there are only 9 floors left that need elevator transportation. The best strategy I figured out for these floors was 3 elevators, each hitting 5 floors. That way each floor got one elevator shaft and a 3rd elevator shaft provided a bit of extra transport.

The 14th floor in each set is a good place to put cafes, and shops. I put a couple cafes and shops in, a security office at on one end, then put some offices in to use up some of the remaining space on the outside of the building. I left a bunch of space between the cafes and offices.

The first 15 floors are special since those floors should have 3 floors of offices, 6 floors of hotel rooms, one housekeeping station per floor, and a service elevator between the hotel floors. Then topped off with offices.

The basement floors had shops, cafes, restaurants and a cinema on floors b1 and b2. Parking was on floors b3, b4, and b5. The recycling centers were on floors b6 and b7, then the metro was on floors b8, and b9 with the metro taking up b10. I also put shops and cafes on floors b8 and b9 with the metro.

For the express elevator I tried to have on each express elevator go to the basement floors and 1 above ground floor. This way floor 15 and floor 30 has separate elevators shafts. Each elevator had as many elevator cars as it could take.

Using this strategy I used 63 above ground floors to get to 15k people and had 128 million dollars. I didn't lower the rent on any offices until I was building up to floor 100 for my cathedral, where I lowered prices on many offices between floors 45 and 60 where I did lower the price to keep tenants. I did lower the price on some hotel rooms much earlier in the game.

You can browse with my wide tower.

Kees Cook: debugging hangs in MIMEDefang

I spent a while this morning hunting down the root cause of a 100% CPU MIMEDefang process. (Turned out to be one specific email triggering one of my custom SpamAssassin rules that seems to get processed really inefficiently.) I wasn t able to find any documentation on how to debug where in MIMEDefang an email was getting stuck, and even jacking up the debugging output of my mimedefang-filter script seemed to imply it was happening late in the filtering process. After digging through mimedefang.pl, I found a status reporting subsystem and tracked it back out into configuration in /etc/default/mimedefang:
# Uncomment next line to have busy slaves send status updates to the
# multiplexor. NOTE: Consumes one extra file descriptor per slave, plus
# a bit of CPU time.
# MX_STATUS_UPDATES=yes
Turning this on, and then using md-mx-ctrl busyslaves (I command I didn t know existed until today either) I got to see exactly where it was stuck:
3 B 13380 (Running SpamAssassin j951iX1t025805)
Now I m having fun running md-mx-ctl with histo, barstatus, and load. :)

Brice Goglin: Debian/X.org notes - Xserver 1.6, Intel 2.6.1, ... what's up in XSF?

It has been a while since my last post here. Not because nothing happened, but mostly because I did not have time to do much for X. Fortunately, Julien is taking good care of X in Debian so we are still close to latest upstream bits. Obviously, due to Lenny's freeze, everything is happening in experimental these days. Xserver 1.6 The release Xserver 1.6 is expected in the near future. 1.6-rc1 (1.5.99.901) entered experimental recently. Both video and input driver ABIs changed and very few drivers have been rebuilt so far. So if you're not running Intel or Radeon, you might not be able to upgrade yet. Please be patient :) You might have heard that many things are happening in X.org these days: DRI2, kernel-modesetting (KMS), RandR 1.3, ... Everything is not ready yet, but it's getting close for real. Radeon 6.10.0 and Intel 2.6.1 Radeon driver 6.10.0 was released in early 2009. As usual, it brings many fixes, and improvements for modern boards (see Alex Deucher's blog for details). However, Radeon is not ready for above DRI2 and KMS yet. Most of the development for these new features is first done in the Intel driver, which got recently bumped to 2.6.1 as well. DRI2 DRI2 is the new Direct Rendering Infrastructure. The most noticeable change from the user point of view is support for Redirect Direct Rendering, which basically means that your 3D application can be wobbly/transparent in Compiz. See Kristian H gsberg's blog for details. If you want to try DRI2 on Intel, you have to enable UXA as the acceleration architecture in xorg.conf (Option "AccelMethod" "UXA" in the Device section). DRI2 will then be enabled automatically. Then, it may or may not work, depending for instance on the hardware. I get a black screen at startup on i865 while i945 works fine until I start Compiz (the server suddenly exits for some reason then). Note that you probably want to upgrade your Mesa packages to experimental as well here (7.3 has been released recently). Of course, running git snapshot of various components (Mesa, libdrm, kernel drm, Intel driver, ...) may help since the released versions seem to not be entirely ready yet. But, things should may be ready to use for everybody in the near future. Kernel Modesetting The other nice feature that makes a lot of noise in X.org these days is Kernel modesetting (KMS). It moves the management of mode (aka resolution+rate) into the kernel. It helps support for switching between different users' sessions, enables reporting of kernel messages (oops, panics, ...) while X is running, and reduces the need to blank the screen during boot (since the kernel can setup the display early and X doesn't have to change it later independently). KMS testing requires a bleeding-edge kernel (2.6.29). Using a git snapshot of the drm stack is probably a good idea as well since I couldn't get KMS to work on 2.6.29-rc2 here. Again only Intel will support KMS soon, but other drivers will follow. Panning is back (aka RandR 1.3) Xserver 1.6 brings support for the 1.3 version of the RandR X extension. Among other improvements, it reintroduces one feature that many users miss since it was removed back in Xserver 1.3 or so. "Panning" (often referred to as "Virtual Desktop") gives the ability to move the display within a larger screen when the mouse approaches from the border. Instead of being configured with the Virtual option in xorg.conf (this option means something else nowadays), it may now be enabled/tuned with xrandr --panning. You'll need the latest libxrandr2 and xrandr utilities to do so (the latter is not uploaded yet).
(Permanent link)

Uwe Hermann: Recovering from a dead disk in a Linux software-RAID5 system using mdadm

RAID5 failure As I wrote quite a while ago, I set up a RAID5 with three
IDE disks at home, which I'm using as backup (yes, I know that
RAID != backup) and storage space. A few days ago, the RAID was put to a real-life test for the first time, as one of the disks died. Here's what that looks like in dmesg:
raid5: raid level 5 set md1 active with 3 out of 3 devices, algorithm 2
RAID5 conf printout:
 --- rd:3 wd:3
 disk 0, o:1, dev:hda2
 disk 1, o:1, dev:hdg2
 disk 2, o:1, dev:hde2
[...]
hdg: dma_timer_expiry: dma status == 0x21
hdg: DMA timeout error
hdg: 4 bytes in FIFO
hdg: dma timeout error: status=0x50   DriveReady SeekComplete  
ide: failed opcode was: unknown
hdg: dma_timer_expiry: dma status == 0x21
hdg: DMA timeout error
hdg: 252 bytes in FIFO
hdg: dma timeout error: status=0x50   DriveReady SeekComplete  
ide: failed opcode was: unknown
hdg: dma_timer_expiry: dma status == 0x21
hdg: DMA timeout error
hdg: 252 bytes in FIFO
hdg: dma timeout error: status=0x58   DriveReady SeekComplete DataRequest  
ide: failed opcode was: unknown
hdg: DMA disabled
ide3: reset: success
hdg: dma_timer_expiry: dma status == 0x21
hdg: DMA timeout error
hdg: 252 bytes in FIFO
hdg: dma timeout error: status=0x58   DriveReady SeekComplete DataRequest  
ide: failed opcode was: unknown
hdg: DMA disabled
ide3: reset: success
hdg: status timeout: status=0x80   Busy  
ide: failed opcode was: 0xea
hdg: drive not ready for command
hdg: lost interrupt
hdg: task_out_intr: status=0x50   DriveReady SeekComplete  
ide: failed opcode was: unknown
hdg: lost interrupt
hdg: task_out_intr: status=0x50   DriveReady SeekComplete  
ide: failed opcode was: unknown
That's when I realized that something was horribly wrong. Not long after that, these messages appeared in dmesg. As you can see the software-RAID automatically realized that a drive died and removed the faulty disk from the array. I did not lose any data, and the system did not freeze up; I could continue working as if nothing happened (as it should be).
 md: super_written gets error=-5, uptodate=0
 raid5: Disk failure on hdg2, disabling device.
 raid5: Operation continuing on 2 devices.
 RAID5 conf printout:
  --- rd:3 wd:2
  disk 0, o:1, dev:hda2
  disk 1, o:0, dev:hdg2
  disk 2, o:1, dev:hde2
 RAID5 conf printout:
  --- rd:3 wd:2
  disk 0, o:1, dev:hda2
  disk 2, o:1, dev:hde2
This is how you can check the current RAID status:
 $ cat /proc/mdstat
 Personalities : [raid6] [raid5] [raid4] 
 md1 : active raid5 hda2[0] hde2[2] hdg2[3](F)
       584107136 blocks level 5, 64k chunk, algorithm 2 [3/2] [U_U]
The "U_U" means two of the disks are OK, and one is faulty/removed. The desired state is "UUU", which means all three disks are OK. The next steps are to replace the dead drive with a new one, but first you should know exactly which disk you need to remove (in my case: hda, hde, or hdg). If you remove the wrong one, you're screwed. The RAID will be dead and all your data will be lost (RAID5 can survive only one dead disk at a time). The safest way (IMHO) to know which disk to remove is to write down the serial number of the disk, e.g. using smartctl, and then check the back side of each disk for the matching serial number.
 $ smartctl -i /dev/hda   grep Serial
 $ smartctl -i /dev/hde   grep Serial
 $ smartctl -i /dev/hdg   grep Serial
(ideally you should get the serial numbers before one of the disks dies) Now power down the PC and remove the correct drive. Get a new drive which is at least as big as the one you removed. As this is software-RAID you have quite a lot of flexibility; the new drive doesn't have to be from the same vendor / series, it doesn't even have to be of the same type (e.g. I got a SATA disk instead of another IDE one). Insert the drive into some other PC in order to partition it correctly (e.g. using fdisk or cfdisk). In my case I needed a 1 GB /boot partition for GRUB, and the rest of the drive is another partition of the type "Linux RAID auto", which the software-RAID will then recognize. Then, put the drive into the RAID PC and power it up. After a successful boot (remember, 2 out of 3 disks in RAID5 are sufficient for a working system) you'll have to hook-up the new drive into the RAID:
 $ mdadm --manage /dev/md1 --add /dev/sda2
 mdadm: added /dev/sda2
My new SATA drive ended up being /dev/sda2, which I added using mdadm. The RAID immediately starts restoring/resyncing all data on that drive, which may take a while (2-3 hours, depends on the RAID size and some other factors). You can check the current progress with:
 $ cat /proc/mdstat 
 Personalities : [raid6] [raid5] [raid4] 
 md1 : active raid5 sda2[3] hda2[0] hde2[2]
       584107136 blocks level 5, 64k chunk, algorithm 2 [3/2] [U_U]
       [>....................]  recovery =  0.1% (473692/292053568) finish=92.3min speed=52632K/sec
As soon as this process is finished you'll see this in dmesg:
 md: md1: recovery done.
 RAID5 conf printout:
  --- rd:3 wd:3
  disk 0, o:1, dev:hda2
  disk 1, o:1, dev:sda2
  disk 2, o:1, dev:hde2
In /proc/mdstat you'll see "UUU" again, which means your RAID is fully functional and redundant (with three disks) again. Yay.
 $ cat /proc/mdstat
 Personalities : [raid6] [raid5] [raid4] 
 md1 : active raid5 sda2[1] hda2[0] hde2[2]
       584107136 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
Btw, another nice utility you might find useful is hddtemp, which can check the temperature of the drives. You should take care that they don't get too hot, especially so if the RAID runs 24/7.
 $ hddtemp /dev/hda
 dev/hda: SAMSUNG HD300LD: 38  C
 $ hddtemp /dev/hde
 dev/hde: SAMSUNG HD300LD: 44  C
 $ hddtemp /dev/sda
 dev/sda: SAMSUNG HD322HJ: 32  C

23 January 2009

Josselin Mouette: On the good use of compiler warning flags

The gnome-power-manager developers like clean code. Actually, more than clean code: code that will not generate a single nitpicking warning. The package builds with the following C compiler flags:
-Werror -Wcast-align -Wno-uninitialized -Wall -Wformat-security
Sometimes the compiler is more clever than the coder On the SPARC architecture, -Wcast-align really starts to mean something. Unlike most other architectures, any alignment error on here will leave you gather your teeth spread on the floor after you ve been hit by a SIGBUS. It tries to catch at build time alignment errors resulting from a cast between pointers to different types. Together with -Werror, it triggered a first FTBFS bug. The error occured on the following code:
        if (XRRGetOutputProperty (brightness->priv->dpy, output, brightness->priv->backlight,
                                  0, 4, False, False, None,
                                  &actual_type, &actual_format,
                                  &nitems, &bytes_after,  ) != Success)  
                egg_debug ("failed to get property");
                return FALSE;
         
        if (actual_type == XA_INTEGER && nitems == 1 && actual_format == 32)  
                *cur = *((int *) prop);
                ret = TRUE;
         
        XFree (prop);
        return ret;
More precisely, the error occurs when casting prop (which is an array of pointers) into an int *. The compiler is clearly right. The alignment requirements are different for a pointer and an integer; therefore, casting a pointer to a pointer into a pointer to an integer will always work, but dereferencing the pointer later will possibly cause a crash. Turning this expression into a memcpy leads to code that should always work. Lesson learned: do not design APIs where an array of pointers can actually store integers. Have you ever heard of opaque structures? and sometimes it is not This was not enough and a second FTBFS bug showed up. Here, the error happens in the following code:
static inline GstBuffer *
gst_buffer_ref (GstBuffer * buf)
 
  /* not using a macro here because gcc-4.1 will complain
   * if the return value isn't used (because of the cast) */
  return (GstBuffer *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (buf));
 
GstBuffer is a structure which contains a GstMiniObject at the beginning. Therefore, you conduct operations on the GstMiniObject through a mere cast. The first cast (GstBuffer GstMiniObject) is fine, but in the second cast (GstMiniObject GstBuffer), the compiler suspects a problem, since the alignment requirements on GstBuffer are stronger than those on GstMiniObject. The compiler is wrong because it didn t read the API documentation; otherwise, it would have known that gst_mini_object_ref can only return NULL or its argument, which means there can t be any loss of alignment. Since there are no function attributes to express such complex things, we are still forced to rely on the developer having correctly read the documentation. Way to go, compiler. Lesson learned: there are good reasons why some warnings are not part of -Wall. Especially, it is dubious to use them with -Werror. Does anyone know whether it is possible to apply -Werror only to some of the warnings and not to all of them? It would sound like a useful improvement.

22 January 2009

David Welton: Github Part III

Since this seems to be fairly constructive, I'll keep going. Those not interested in Github, or the dynamics of open source code creation can safely tune out. Chris, the Github dude, has some more to say: http://ozmm.org/posts/forking_continued.html
I mentioned the Network Graph and Fork Queue but David mentioned neither. I think he doesn t know what they are, probably because I didn t explain what they are :)
I had had a look at them, and they're handy tools (I would never accuse Github of not doing good work, that's not the issue at all), but I would respectfully submit that perhaps Chris is looking at things from a very Github-centric perspective, in which it's second nature to go look at those. They aren't obvious, and certainly don't jump out at the user to say "hey, maybe this code your looking out isn't the latest and greatest!". For someone just cruising around, perhaps it should be more evident who's the 'top dog'? Chris then goes on with a very helpful and illustrative demo of how things work at Github, which is good stuff. However, at the end, he says something that I don't agree with:
It may seem strange, and perhaps even like a lot of work. Why should I have to check to see which is the most current? In the old model, there s always a canonical repository.
That's precisely the problem. It does seem like a lot of work, especially when your search space is not limited to Github, but may include other places like Sourceforge, RubyForge, Google Code, project specific sites, and so on.
In the old model, actionwebservice wouldn t have made it past 1.2.6. Welcome to distributed version control.
Plenty of 'old style' projects have survived beyond their founders' interest in the project. What happens is that you ask for permission to work on the project, and either :
  1. It's given to you, in which case you can keep working on the canonical code. For instance, someone could have asked DHH to work on the RubyForge version of actionwebservice. Did they? Did he say no? At the very least, he could have been asked to point the RubyForge actionwebservice page at some other site with a more current version of the code.
  2. You have to fork the project, and in that case, sure, you might as well have been using the Github model.
I've often found that people are happy to let you contribute to their projects, though, and part of my original point with all of this is that if people just go spitting out forks willy-nilly, it creates a "paradox of choice" type problem, and perhaps takes something away from the community aspect of open source projects. As people are fond of saying at the Apache Software Foundation, it's about the people, not necessarily about the code. I'm not saying that forks are always bad and that everything should be centrally done, but there's a balance to be struck between people just working on their own, and some sort of onerous, bureaucratic Central Project Authority. It's nice that people who want to improve the code make themselves heard on a mailing list/forum/whatever, and thus cover the "people" part of merging in new code and new ideas. More often than not, help and contributions are more than welcome. Design decisions and conversations recorded on mailing lists are available for people to peruse in the future when they have questions. Just to repeat something that bears repeating: I am not claiming that Github will lead to social disintegration of open source projects or anything drastic like that. However, I'm a bit wary of certain patterns I've seen. It's certainly possible that I'm wrong - as I mentioned, one error I might be making is that people are dumping code they simply wouldn't have shared on Github, because Github makes it so easy. I do hope my worries are unfounded, and in any case, it's a good thing that the Github guys are interested in the problem too, and will hopefully do things to alleviate it where possible.

David Welton: Github Part III

Since this seems to be fairly constructive, I'll keep going. Those not interested in Github, or the dynamics of open source code creation can safely tune out. Chris, the Github dude, has some more to say: http://ozmm.org/posts/forking_continued.html
I mentioned the Network Graph and Fork Queue but David mentioned neither. I think he doesn???t know what they are, probably because I didn???t explain what they are :)
I had had a look at them, and they're handy tools (I would never accuse Github of not doing good work, that's not the issue at all), but I would respectfully submit that perhaps Chris is looking at things from a very Github-centric perspective, in which it's second nature to go look at those. They aren't obvious, and certainly don't jump out at the user to say "hey, maybe this code your looking out isn't the latest and greatest!". For someone just cruising around, perhaps it should be more evident who's the 'top dog'? Chris then goes on with a very helpful and illustrative demo of how things work at Github, which is good stuff. However, at the end, he says something that I don't agree with:
It may seem strange, and perhaps even like a lot of work. ???Why should I have to check to see which is the most current? In the old model, there???s always a canonical repository.???
That's precisely the problem. It does seem like a lot of work, especially when your search space is not limited to Github, but may include other places like Sourceforge, RubyForge, Google Code, project specific sites, and so on.
In the old model, actionwebservice wouldn???t have made it past 1.2.6. Welcome to distributed version control.
Plenty of 'old style' projects have survived beyond their founders' interest in the project. What happens is that you ask for permission to work on the project, and either :
  1. It's given to you, in which case you can keep working on the canonical code. For instance, someone could have asked DHH to work on the RubyForge version of actionwebservice. Did they? Did he say no? At the very least, he could have been asked to point the RubyForge actionwebservice page at some other site with a more current version of the code.
  2. You have to fork the project, and in that case, sure, you might as well have been using the Github model.
I've often found that people are happy to let you contribute to their projects, though, and part of my original point with all of this is that if people just go spitting out forks willy-nilly, it creates a "paradox of choice" type problem, and perhaps takes something away from the community aspect of open source projects. As people are fond of saying at the Apache Software Foundation, it's about the people, not necessarily about the code. I'm not saying that forks are always bad and that everything should be centrally done, but there's a balance to be struck between people just working on their own, and some sort of onerous, bureaucratic Central Project Authority. It's nice that people who want to improve the code make themselves heard on a mailing list/forum/whatever, and thus cover the "people" part of merging in new code and new ideas. More often than not, help and contributions are more than welcome. Design decisions and conversations recorded on mailing lists are available for people to peruse in the future when they have questions. Just to repeat something that bears repeating: I am not claiming that Github will lead to social disintegration of open source projects or anything drastic like that. However, I'm a bit wary of certain patterns I've seen. It's certainly possible that I'm wrong - as I mentioned, one error I might be making is that people are dumping code they simply wouldn't have shared on Github, because Github makes it so easy. I do hope my worries are unfounded, and in any case, it's a good thing that the Github guys are interested in the problem too, and will hopefully do things to alleviate it where possible.

Next.

Previous.