Search Results: "tach"

26 January 2009

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

23 January 2009

Daniel Kahn Gillmor: target disk mode (sbp-2 mass storage host mode?)

One very convenient feature of Apple's hardware is the ability for their workstations to enter target disk mode. This effectively transforms the machine into a glorified ieee1394 (firewire) block device, which can then be manipulated from outside the machine using the standard SBP-2 protocol. Is there a way to provide this same functionality from a running GNU/Linux machine? For example, i have a GNU/Linux system with a block device attached to it. I would prefer if the block device was available to a neighboring machine, but (for whatever reason) i'm unable to physically move it. However, i'm able to link the two machines via a simple ieee1394 connection. A "virtual target disk mode" server (or would it be better to say "an SBP-2 mass storage target service over an ieee1394 link"?) would be really useful. One thing that occurs to me is that i could do some sort of networking abstraction over the link (using eth1394?), and then use something like vblade (an ATA-over-Ethernet target service) to provide a virtual block device to the remote host. However, this requires the remote host to run an operating system capable of dealing with these (more obscure) protocols, and i'd like this to work for any remote machine that knows how to deal with generic SBP-2 ieee1394 mass storage. I know that in general GNU/Linux is at least as powerful and capable as the firmware that Apple ships ;) But it's possible that our community just hasn't gotten around to implementing something like this. Is this the case? My attempts to search for it haven't turned up anything, but it's entirely possible that i'm reading the wrong docs (or reading the docs wrong). Any pointers?Tags: firewire, ieee1394, sbp2, vblade

Joey Hess: a hairy tale

When I was a kid, I had a daddy with this moustache. One day, he shaved it off. I looked at the pale, exposed strip of lip, and demanded he grow it back. There are no images of this event, besides those burned into my brain. It was in simpler times. Dad did grow it back, and a beard too, and and now he's (great)-Grandpa Hess. Who, come to think, looks similar to my tie-died friend Bdale. Bdale is one of the Debian grandfathers, those old guys who the young ones in the project look up to. And today, he scarred all their minds. The collective shout of "grow it back!" is gonna be huge. Did I mention that it all involves Tasmanian devils, charity, and the mean razor of Linus Torvalds? These are not simple times.

15 January 2009

Ross Burton: 3G Woes

Has anyone out there used a recent Nokia phone (E65 to be precise) as a modem with Network Manager 0.7? I can't seem to get the magic right, and get one of two failures:
NetworkManager: <info>  (ttyACM0): powering up... 
NetworkManager: <info>  Registered on Home network 
an 15 10:50:04 blackadder NetworkManager: <info>  Associated with network: +COPS: 0,2,"23415" 
  NetworkManager: <WARN>  dial_done(): Dialing timed out </WARN>
Or:
NetworkManager: <info>  Activation (ttyACM0) Stage 1 of 5 (Device Prepare) complete. 
NetworkManager: <info>  (ttyACM0): powering up... 
NetworkManager: <info>  Registered on Home network 
NetworkManager: <info>  Associated with network: +COPS: 0,2,"23415" 
NetworkManager: <info>  Connected, Woo! 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) scheduled..
. 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) starting...
 
NetworkManager: <info>  (ttyACM0): device state change: 4 -> 5 
NetworkManager: <info>  Starting pppd connection 
NetworkManager: <debug> [1232015456.962700] nm_ppp_manager_start(): Command line: /usr/s
bin/pppd nodetach lock nodefaultroute user web ttyACM0 noipdefault usepeerdns lcp-echo-failure 0 lcp-echo-interval 
0 ipparam /org/freedesktop/NetworkManager/PPP/4 plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so 
NetworkManager: <debug> [1232015456.964964] nm_ppp_manager_start(): ppp started with pid
 29590 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) complete. 
pppd[29590]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.
pppd[29590]: pppd 2.4.4 started by root, uid 0
NetworkManager: <WARN>  pppd_timed_out(): Looks like pppd didn't initialize our dbus mod
ule
Anyone know what the problem could be?

Julien Blache: Antec PSU suck

How not to start your day, from the all-hardware-sucks department. For years, I ve been struggling to keep my machines quiet. I ve miserably failed for years, and pretty much gave up once I realised that the quiet parts I was looking for just did not exist. Last year, I finally found what I was looking for: I ve been very happy with this hardware for both my workstation and my filer. Well, until today. No need to mention that this hardware is not exactly cheap, but the price is right for the quality. So, wake up today, do random things, grab my TomTom, unplug it from the workstation it s sucking its power from, do things, plug it back in the USB port so it won t draw its battery. This is how it went: Check machine temp, PSU temp, attempt to restart PSU, check UPS, check cables, replace power cable and bypass UPS. Admit defeat for this round and accept the PSU as dead. Pull out the machine, rip out the fscking damn PSU. Grab the tools, crack the PSU open. Notice bulging and leaking capacitors. Yes, this PSU is anything but cheap, yet it uses el-cheapo chinese capacitors. Antec, you suck, big time. For the past decade everybody in the industry has known that el-cheapo chinese capacitors manufactured after 1999 are total crap, using an electrolyte that isn t actually one because its formula was stolen by industrial spies who got totally PWNED and ended up stealing a bad formula. (If you need a reference, google for singing capacitors . Note that singing capacitors can also happen with good parts used in a crappy electronic design. Like that 100 Mbps D-Link switch over there, or that Sony-Ericsson mobile phone charger. Hmm. Not everybody can hear it, I do.) A healthy, young capacitor should not bulge nor leak. A capacitor that leaks, bulges or sings is a crappy capacitor and needs to be replaced with a quality part ASAP. I ve been routinely replacing such capacitors on my older motherboards (manufactured between 1999 and 2001) in the past years. I ve not had the problem in ANY of my el-cheapo PSU, and did not replace any capacitor in any of them to date. Fortunately, the machine did not suffer any further damage, nor did the TomTom. Everything is up and running again with a spare PSU. I m now going to replace the fscking capacitors on this PSU, replace the fuse, probably R&R a couple of high-voltage transistors too (they have a tendency to fry before the fuse blows out) and get it back up and running. Then I ll do the same with the other PSU in the filer, because that machine has 8 disks attached, so draws more power and hence is much more vulnerable. Fuck you Antec.

12 January 2009

Steve Kemp: Death is... whimsical... today.

I'm not sure how you can pre-announce something in a way that cannot be later faked. The best I can imagine is you write it in a text file and post the size / hash of the file.
steve@skx:~$ ls -l 10-march-2009
-rw-r--r-- 1 steve users 234 Jan 12 21:40 10-march-2009
steve@skx:~$ sha1sum 10-march-2009
99d1b6d625ed4c15a3be2be5fec63c17941c370d  10-march-2009
steve@skx:~$ md5sum 10-march-2009
1a0e68b8fbb3b0fe30e5b4a9413ceeec  10-march-2009
I don't need anybody to keep me honest, but I welcome interesting suggestions on more neat ways to pre-confirm you have content that hasn't been changed between being written and being released...? I guess you could use GPG and a disposible key-pair, and then post the secret key afterward, but that feels kinda wrong too. Update of course you could post the detached signature. D'oh. Shamir's Secret Sharing could be another option - posting just enough pieces of the secret to make recovery possible with the addition of one piece that was witheld until the later date. Jake wrote a nice introduction to secret sharing a couple of years ago. ObFilm: L on

10 January 2009

David Welton: Developer > Project, or Project > Developer(s)?

I've been fooling around with "git" lately - it's useful for local projects where I don't want to have to set up a remote server, and it also seems to be "the way the wind is blowing" - lots of open source projects are starting to use it, so I might as well familiarize myself with how it works. The github service seems to be very popular at the moment, and it's not hard to see why. They've created a very useful service, and give it away completely free for open source use. That's a pretty good deal! It's also an easy to use site that's well integrated with git, so you can see lots of stuff graphically instead of fooling around with command line tools. However, I have a nagging doubt. Github apparently bases everything around the developer. In other words, projects hosted there are mostly attached to a developer who 'owns' the project, rather than existing on their own. There are a few exceptions - there seems to be a 'rails' role account to manage Rails, rather than having it belong to, say, DHH, so it's not impossible to do something in a project-centric fashion, but it doesn't seem to be very common either. What I'm wondering is what sort of effects this might have in the long term. Github, and git itself, make it very easy to 'fork' projects. Could, or will this lead to a situation where people don't try so hard to get their code in the 'official' branch? What happens when someone loses interest in their project? Sure, someone else can fork their repository, but if all the links were pointing to the first guy, because he was the main hacker on a project for X years, they're not going to switch overnight even if guy B takes over maintanance. And in the meantime, casual searchers might turn up the 'dead' branch, or simply be confused as to who's doing what. This could make things confusing for someone who just wants to check out some code and start using it.... trying to sort out various revisions and ancestry of a project could be quite discouraging. At the Apache Software Foundation, on the other hand, people are obviously very important, but projects are the organizational unit that people get involved with, and a lot of emphasis is placed on not having one big benevolent dictator, but on having a group of people who make decisions and act as arbiters of what goes into the project. People can come and go as they please, but the project, and, importantly, the links to it, remain the same over time (barring any big, unforeseen blowups). As far as I can tell, this is not a git problem, but something related to how github organizes their site. And, of course, it's possible that I have simply missed something due to my lack of knowledge of git, and not being more than superficially familiar with github. Even if I'm right, it shouldn't take that much effort for github to create a system where it's possible for multiple people to 'own' a project.

David Welton: Developer > Project, or Project > Developer(s)?

I've been fooling around with "git" lately - it's useful for local projects where I don't want to have to set up a remote server, and it also seems to be "the way the wind is blowing" - lots of open source projects are starting to use it, so I might as well familiarize myself with how it works. The github service seems to be very popular at the moment, and it's not hard to see why. They've created a very useful service, and give it away completely free for open source use. That's a pretty good deal! It's also an easy to use site that's well integrated with git, so you can see lots of stuff graphically instead of fooling around with command line tools. However, I have a nagging doubt. Github apparently bases everything around the developer. In other words, projects hosted there are mostly attached to a developer who 'owns' the project, rather than existing on their own. There are a few exceptions - there seems to be a 'rails' role account to manage Rails, rather than having it belong to, say, DHH, so it's not impossible to do something in a project-centric fashion, but it doesn't seem to be very common either. What I'm wondering is what sort of effects this might have in the long term. Github, and git itself, make it very easy to 'fork' projects. Could, or will this lead to a situation where people don't try so hard to get their code in the 'official' branch? What happens when someone loses interest in their project? Sure, someone else can fork their repository, but if all the links were pointing to the first guy, because he was the main hacker on a project for X years, they're not going to switch overnight even if guy B takes over maintanance. And in the meantime, casual searchers might turn up the 'dead' branch, or simply be confused as to who's doing what. This could make things confusing for someone who just wants to check out some code and start using it.... trying to sort out various revisions and ancestry of a project could be quite discouraging. At the Apache Software Foundation, on the other hand, people are obviously very important, but projects are the organizational unit that people get involved with, and a lot of emphasis is placed on not having one big benevolent dictator, but on having a group of people who make decisions and act as arbiters of what goes into the project. People can come and go as they please, but the project, and, importantly, the links to it, remain the same over time (barring any big, unforeseen blowups). As far as I can tell, this is not a git problem, but something related to how github organizes their site. And, of course, it's possible that I have simply missed something due to my lack of knowledge of git, and not being more than superficially familiar with github. Even if I'm right, it shouldn't take that much effort for github to create a system where it's possible for multiple people to 'own' a project.

6 January 2009

Ren&#233; Mayorga: Yearly statistics for one Debian mirror

I got this afternoon the logs from the only one Debian mirror on El Salvador(debian.ues.edu.sv), the mirror is hosted on Universidad de El Salvador .
so I decide to get some statistics from there. First, lets get the hits per month, I count unique IPs per day over the months to take this stats
Unique IP hits per month on 2008

Unique IP hits per month on 2008

The mirror is hosted on the main campus of the public university from El Salvador. I actually have no access to this server but there are some good friends taking care of it. There are some months that the mirror was actually shut down and that is the reason why the graph shows no hits, those outages was caused by political issues, yes political issues. As a sign of protest some students took the control of the campus that cause that all the communications, including data center and the mirror was cut. The mirror only serve two architectures, i386 and amd64. I was intrigued about the most used arch, no surprises there:
architectures hits per year

architectures hits per year

Over 2008 the most used arch was i386

Andrew Pollock: [tech] On trying to use a Sansa e260 on Linux

I received a SanDisk Sansa e260 (v2) for my birthday. It was one of those presents that acquired for myself on behalf of someone else because it worked out easier that way. I bought it for cheap from Woot! I thought I'd use it to play podcasts while I'm at the gym. We've been listening to NPR for a while now, and there's lots of excellent programming, and it's all available in download for as well. Since I don't spend all that much time in the car, I'm not listening to much of it. The first mission was to upgrade the firmware. Getting the player into MSC (instead of MTP) mode with the original firmware was a little tricky, but I got there in the end. Then I had to locate the firmware in a Linux-installable format. I think I ended up resorted to using Windows, but I later found the raw firmware image without needing an installer. I'm using Rhythmbox at the moment to download the podcasts. I thought I'd try out its MTP support, just because it actually had it, but either Linux 2.6.26 has a problem with MTP, or the player is particularly flaky doing it with Linux, because I just seemed to get a pile of USB errors when connecting the device in this mode, so I'm sticking with MSC for now. Oh, and I had to put a .is_audio_player file in the root of the device to make it show up in Rhythmbox. I later discovered that it worked most optimally if I put
audio_folders=MUSIC/
folder_depth=2
in the file. I'm still trying to come up with an optimal way of managing the audio I want to listen to. It seems somewhat tedious to drag and drop all of the podcasts from Rhythmbox to the device. I kind of want some sort of plug and play auto-sync method. It seems I can't use a connection-triggered rsync, because some of the podcasts seem to get downloaded with non-FAT-filesystem-friendly filenames. Rhythmbox seems to take care of this by doing some sort of automagical renaming at transfer time. That said, not everything is showing up in the music list with sane names. There's a few things that have an unknown artist I think. That may be a deficiency in the ID3 tags of the MP3s themselves though... What I really want some way of getting home, hooking up the player and just getting what's new, without expending too much effort (at the time of hooking up the player, anyway. I'm happy to expend some effort getting to that point) The next weird thing is that the device wants to talk USB 1.1. I'm not sure what is at fault here, but I can, allegedly at least, make the device reconnect at USB 2.0 by removing and reloading the ehci-hcd module after connecting it. Here we have the device initially attached:
apollock@icarus:~$ lsusb -t
Bus#  5
 -Dev#   1 Vendor 0x1d6b Product 0x0002
Bus#  4
 -Dev#   1 Vendor 0x1d6b Product 0x0001
Bus#  3
 -Dev#   1 Vendor 0x1d6b Product 0x0001
   -Dev#   9 Vendor 0x0781 Product 0x7423
Bus#  2
 -Dev#   1 Vendor 0x1d6b Product 0x0001
   -Dev#   6 Vendor 0x413c Product 0x8103
Bus#  1
 -Dev#   1 Vendor 0x1d6b Product 0x0001
lsusb says that bus #3 is ID 1d6b:0001 Linux Foundation 1.1 root hub Then if I do a spot of presto-changeo...
apollock@icarus:~$ sudo modprobe -r ehci-hcd
apollock@icarus:~$ sudo modprobe ehci-hcd
apollock@icarus:~$ lsusb -t
Bus#  5
 -Dev#   1 Vendor 0x1d6b Product 0x0002
   -Dev#   3 Vendor 0x0781 Product 0x7423
Bus#  4
 -Dev#   1 Vendor 0x1d6b Product 0x0001
Bus#  3
 -Dev#   1 Vendor 0x1d6b Product 0x0001
Bus#  2
 -Dev#   1 Vendor 0x1d6b Product 0x0001
   -Dev#   7 Vendor 0x413c Product 0x8103
Bus#  1
 -Dev#   1 Vendor 0x1d6b Product 0x0001
Bam! It's moved over to bus #5, which lsusb says is 1d6b:0002 Linux Foundation 2.0 root hub Weird. I wonder if I should try running Rockbox on it? Seems not, it's only for v1 players. Oh well.

Gunnar Wolf: Historias de la Historia del c mputo en m xico


Some months ago, I got a phone call from Rafael Fern ndez Flores. He wanted to interview me for a book he was working on regarding the history of computers in Mexico. The first computer in Latin America was installed in 1958 at my University (UNAM), and last year there were several activities conmemorating it. One of said activities is the publication of the book Historias de la Historia del c mputo en m xico, by Rafael Fern ndez and Margarita Ontiveros.
The book was printed in November, and Rafael gave me my copy in early December. It is quite an entertaining read - I mostly enjoyed the archaeological parts of it, referring to the 1950s and 1960s, and with many people that I know first hand (as my father is one of the founding researchers of the Centro de Investigaci n en Matem ticas Aplicadas, Sistemas y Servicios, CIMASS, now IIMAS).
I do believe, anyway, the book is focused too heavily on what happened in the large-scale computer world during a fundamental point in time for me (late 1970s, early 1980s) - It shows that the authors were very involved in the important projects the University set foot on, but they overlook fundamental pieces of the history. Very important developments were made in smaller venues (it was shocking for me to find only one mention, and just as a reference, to Fundaci n Arturo Rosenblueth and its great Centros Galileo, where many hundreds of kids (me included) learned to love computers, to program, and had a thriving socialization place. I also missed mentions of the BBS scene in Mexico, for which there are various exponents. And, just to single out one person, I found it absurd to have me interviewed and not to include La Mancha de la Calabaza que Ladra.
One of the last chapters -there are over 40 chapters, stemming from over 30 individual interviews- publishes the talk I had with Rafael. I must say there are small errata in its transcription (the first example that comes to my mind: I told him that one of the fruits of the OLPC project was the appearance of the now-popular netbooks, partly due to the appearance of lower cost parts, but I must reiterate I didn't say the Asus EEE is a part of said project). You can I am attaching my interview (as scanned, low-res images) to this post, in case you are interested.
Anyway - If the topic interests you, you will find many interesting passages, many passages you will surely laugh with and probably remember. The book is very well laid out. And it is a great joy to be part of it!

4 January 2009

Andrew Pollock: [tech] Mixing electricity and water: monitoring the cat water bowl with Nagios

(this is something I've had "in production" for many months now, I just haven't had the time or energy to do a proper write up about what I did) We have a cat water bowl, it looks like this: The cat water bowl Under "normal" circumstances, it usually lasts about seven days. So when our weekly routine is happening, we'll refill it on a Saturday whilst doing house chores, and it'll last until the following Saturday when it gets refilled. Unfortunately, sometimes our routine gets disrupted, and we forget. Sometimes, we travel and have a house-sitter, who may not pay as close attention to such things as ourselves. Once, one of our cats was licking the condensation off a chilled bottle of soft drink that was on the kitchen counter one evening, before we realised the water bowl needed refilling. Naturally, we felt like terrible pet owners. So I think it was some time around the 2008 Maker Faire, that I hatched the idea of having some sort of water sensor on the cat bowl, which would communicate to one of the various computers in house. At the Maker Faire, I bought a copy of Making things talk, and an Arduino starter kit, which consisted of a Diecimila board and a make-it-yourself proto shield. I also bought a little electronics starter kit, which consisted of a breadboard and various components, and a USB-TTL cable. I decided to use Bluetooth to communicate with the board, as I already had my MythTV setup using a Bluetooth keyboard and mouse, and it was within range of the water bowl. I decided against using Zigbee, because I didn't know anything about it, and I didn't want to add (or learn about) yet another wireless infrastructure just for this project. I should point out that I know very little about electronics. I'd never owned (or really used) a soldering iron until I embarked on this project. I took a basic soldering class at the Tech Shop, but I'd already assembled the proto shield by the time I took the class, so I'd pretty much figured it out. I had a very naive vision that I could just basically shove two wires in some water and it'd close a circuit and that would be my water sensor. Of course this didn't work, so I started hunting around on the Internet for a circuit that would do this. I happened upon a circuit (I don't seem to have retained the URL, so I can't link to it), which just consisted of a couple of transistors and some resistors. So I headed off to Fry's to try and buy the transistors I needed. I quickly discovered that I didn't have sufficient information to identify the transistors that I wanted, but I did happen to stumble upon a cheap assemble-it-yourself water alarm. It consisted of a PCB, and a transistor and some resistors and a buzzer. I bought a couple of these instead. Between studying the PCB and the circuit diagram that came with the alarm, I was able to reproduce it on my breadboard instead of on the PCB. Sure enough, placing the two probes in water closed the circuit. I replaced the buzzer with an LED so I could see what was going on. I attached the circuit to the Arduino proto shield, and had it feed into one of the digital I/O ports. I wrote some quick and dirty Wiring code so that when water not present (i.e. the circuit was open and no current was detected on that I/O port) the LED was switched on. Really at this point, I didn't need a microcontroller, I could have presumably achieved the same thing with a NOT gate. At this point, I wanted to make the sensor remotely queryable. I bought a BlueSMiRF Silver Bluetooth modem, which I attached to the TX and RX lines of the board (I first configured it by attaching the USB-TTL cable to it and using Minicom on my laptop). I extended the Wiring code to provide a rudimentary prompt, and accept a command to check if water was present. I think around this time it also dawned on me that I could use the digital I/O pins as a switch. When they're "high" they provide power. So rather than constantly running a current through the water, I only needed to briefly power up the water detection circuit, see if the circuit closed or not, and then report if water was present if it did. I much preferred this, as at the time, I was endeavouring to power the whole sensor off a 9 volt battery. I figured I'd get much better battery life if I wasn't running a current through the water the entire time. I should point out that I did some "tongue tests" in a glass of water while the circuit was powered up, and couldn't detect a difference between when the circuit was on or off. The last thing I wanted to be doing was zapping the cats! At this point, the Wiring and Arduino work was pretty much complete. I setup ser2net on the MythTV server, so that I could just connect to port 4000, and be connected to the water sensor.
apollock@icarus:~$ telnet teevee 4000
Trying 172.16.0.9...
Connected to teevee.andrew.net.au.
Escape character is '^]'.
ser2net port 4000 device /dev/rfcomm0 [9600 N81] (Debian GNU/Linux)
waterbowl> s
Water is present
waterbowl>
telnet> q
Connection closed.
apollock@icarus:~$
The Wiring code running on the Arduino board is checked in here. Next, I wanted to monitor this with Nagios. One thing I found with the Bluetooth connection was that it wasn't all that reliable. Not every connection to port 4000 resulted in a connection with the water sensor. I elected to write some standalone code that submitted results to Nagios by way of a passive check, rather than having Nagios try to actively monitor it. Again, trying to conserve energy, I decided to only check the sensor once every 8 hours. So I wrote a Python daemon, which tried to be as robust as possible. If at first it doesn't make a connection on its 8 hourly schedule, it keeps trying until it does. Nagios itself has some freshness detection for this monitor, so if no passive result is submitted within 8 hours and one minute, Nagios alerts that something is possibly wrong with the sensor itself. (The original intent was to deal with the situation where the battery went flat) This is the Nagios service definition I've got. Some of it may be unnecessary or redundant:
define service  
        host_name                       teevee
        service_description             Cat water bowl
        check_command                   check_stale!2!"Check water bowl monitor is on and reachable"
        normal_check_interval           480
        notification_interval           240
        active_checks_enabled           0
        check_freshness                 1
        freshness_threshold             28860
        max_check_attempts              1
        check_period                    24x7
        use                             generic-service
        stalking_options                o,w,c
        contact_groups                  everyone
 
The code for the Python daemon is checked in here. So everything was going swimmingly, apart from I couldn't get even 24 hours of monitoring on my conservative 3 times a day schedule, and the Bluetooth modem configured for all of its power saving options, and the water sensor itself only being powered on when it was performing a check. There wasn't much more I could do to try and reduce power consumption, at least with my limited electronics knowledge. Perhaps using Zigbee instead of Bluetooth would have helped, but I still think I'd have been going through 9 volt batteries more quickly than I'd have liked. I also had a brief foray into solar powering the board. I thought maybe the lighting in the house would be sufficient to power the board. Of course this didn't work out. I'd also have needed to make the code running on the board more self-sufficient, and have it just provide a water status indication whenever it had enough power to do so, instead of being a fairly dumb device like it currently is. This all felt a whole level more complicated, and out of my league, and I wasn't interested in attempting this sort of remote-sensing exercise at this time. The Arduino board can also be powered by USB, so as I already had some long USB type A to type B cables (that had funky lights in them to boot), I decided to just get a wall wart that had a USB type A receptacle, and powered the Arduino board that way. So much for being completely "wireless". (I could have also gotten a general purpose DC power supply that was capable of spitting out 9 volts, but I doubted I'd get one with a sufficiently long cable, which is why I went for the USB-powered option, as I already had a cable long enough) Speaking of wires, the most challenging part was the probes for the water sensor. As they were going to be permanently in the cats' drinking water, I didn't want to contaminate the water with them. I figured plain untinned copper wire would be okay, since water pipes are copper. Finding untinned, unstranded copper wire was a real challenge. I started out using some FM antenna cable, but that was stranded, and the shielding was a nightmare to strip. It was also reasonably difficult to make go where I wanted it. What I really wanted was something more solid, that would flex and stay where I put it. I cannibalised a spare IEC power cable, but it was also stranded copper wire. I finally managed to obtain some solid-core CAT-5 cable from a hardware store, and this has worked exactly as I wanted. I haven't done any further work on the setup since getting the CAT-5 cable for the probe. Further improvements that I'd like to do at some point: The finished product I had a lot of fun with this project. I had a real sense of achievement, being able to go from concept to completion, and learn a few things about electronics along the way. I'm normally not a fan of messing around with hardware. Some photos of the project are here.

1 January 2009

Biella Coleman: 2008

When I return to PR, my blog tends to lie fallow. Between taking care of the house, outdoor distractions (like the very overgrown garden and the very enticing beach), and most especially visiting my mother, I turn away from the computer, from my analytical mind, from writing. But since we have edged into a new year, I thought I would spend a little bit of time ruminating on 2008, which was one of the most unforgettable for me. With each passing year, it seems that 12 months bleed right into the next 12 months. But within this swirl, there are a handful of years that retain their sharp edges (1992, 1996, 2005, 2005-2006 are the most memorable). 2008 now sits among those as it is the the year that a tube was placed into my mother s stomach and soon after she was taken from the hospital into a nursing home without even the chance to say goodbye to the dog who was her steadfast companion and the house, which was her home for over 20 years. Over the last 6 years while I have not written much about my mother and her Alzheimer s, I did so fairly consistently with at least 3 entries per year, that is until March 2008 when she was put in the nursing home. Soon after being admitted, I wrote one entry and since then have not had the heart to commit much to words, something of which I am ashamed of and have sworn I would write about at least once before another years passes us by. I don t have the desire to constantly write about my experiences with her but it seems to be that Alzheimer s is erased far too often from public view and I would rather not contribute to that type of very pervasive silencing either. The recipe for my silence has been made up of various ingredients. One was I was just really really busy. Last semester was frenetic so I often did not have an ounce of room/time to think, much less blog about such a difficult situation (and I spent a lot of time going back and forth to PR as well). Another is that I was trying to avoid the heartache that arises when you focus in, with some detail, care and attention, on something that is unavoidably painful. Each time I tried, I ultimately failed and told myself, I would do so later. Finally I was blogging less and less about these types of subjects so it just seemed a little out of place every time I tried to commit something to words. For me, one of the hardest things to accept and this probably fed into my silence is that I played a part in prolonging her life when I know she wanted out (with a capital O U and T). But at the time the feeding tube was placed in her, she was walking and talking and it did not seem right to refuse her food (and I hoped that with some food, she would then start to eat on her own as she can swallow just fine) not to mention that her caretaker (a devout Catholic) and my sister would have never at the time been ready to refuse the feeding tube and I was not exactly quite ready either. Well, what we did not foresee was that 5 days in the hospital did her in and when she left, she could no longer walk, she could barely talk, and yet due to the feeding tube, she gained back the dramatic weight that she had shed over a year so that her body at least looked far more alive than it had been for years thanks to the steady stream of nutrition being slowly pumped into her body. I just know she would not want to be alive under these conditions and yet at this point, there is not much I can do legally except refuse certain classes of treatments if she gets sick (such as respirator) or wait until she becomes completely vegetative and then go through the legal hoops, that ultimately may not be successful, to remove the feeding tube. It has been so hard for so many months that as I late I have been trying to approach the whole thing with at least one dash of Zen-like detachment (by which I mean an embrace/acceptance of suffering in this world) and just spend as much time as I can with my mother, which I did a lot over the summer and I am now doing this winter. I am most probably moving back over the summer as well as my sister is not faring all that well after being with her for so many years. Even though she no longer knows my name, or who I am, I can tell she notices my presence and there are days she even seems to be happy. In fact, over the summer, she had some pretty lively days when we could manage to joke about almost nothing. Those days were rare and precious and today they don t seem to happen at all (she did seem a bit excited that it was a New Year though I could not tell if she really knew what I was saying). Over the summer, generally I would climb into her bed and we would co-nap for a couple of hours. And then the worst were the days she was hysterical and crying, and the absolutely worst was when she was crying, pleading for her parents. Those were days that did not break my heart but my soul. Thankfully those days of hysterics seem to be happen less and less and my mother just seems to sleep a lot. I sometimes like to think she is like those really old cats or dogs who seem to spend interminable hours sleeping and resting and don t seem to be suffering all that much though I can still tell she is still in a bad mood from time to time. She also has a wonderful roommate, Ana, who also pretty advanced Alzheimer s though certainly not as bad as my mom. Unlike my mother, she is happy as a clam, so much so she is always saying things like Isn t this a great day? How wonderful the day is, etc. etc, which is a nice counterbalance to my mom! I sort of like that my mom s roommate is, personality wise, the polar opposite of my mother, who is not a fundamentally unhappy soul, but she was emotionally erratic one with quite a few peaks and valleys and this is still very much the case. Having Ana around (and her family) has transformed the way I have seen this illness and my mother s condition. I am certainly not thrilled that she is alive and in fact think how we end (or don t end) life is something we as a society should be ashamed of. I clearly want to see her released, freed like a bird from the cage of this world (my mother loved loved birds I think because they symbolized freedom), but spending time with Ana, who again seems quite content, made me realize how part of the Alzheimer s experience is rooted in one s personality. My mom has always been difficult and when she was sick but still quite functional, her personality made the illness difficult for her and those around her. She never really had much luck changing her karmic personality and it sure is not going to change now. But as I said she does seem to rest a lot. I just hope her last few months, possibly years, are if nothing else peaceful and tranquil.

Biella Coleman: 2008

When I return to PR, my blog tends to lie fallow. Between taking care of the house, outdoor distractions (like the very overgrown garden and the very enticing beach), and most especially visiting my mother, I turn away from the computer, from my analytical mind, from writing. But since we have edged into a new year, I thought I would spend a little bit of time ruminating on 2008, which was one of the most unforgettable for me. With each passing year, it seems that 12 months bleed right into the next 12 months. But within this swirl, there are a handful of years that retain their sharp edges (1992, 1996, 2005, 2005-2006 are the most memorable). 2008 now sits among those as it is the the year that a tube was placed into my mother s stomach and soon after she was taken from the hospital into a nursing home without even the chance to say goodbye to the dog who was her steadfast companion and the house, which was her home for over 20 years. Over the last 6 years while I have not written much about my mother and her Alzheimer s, I did so fairly consistently with at least 3 entries per year, that is until March 2008 when she was put in the nursing home. Soon after being admitted, I wrote one entry and since then have not had the heart to commit much to words, something of which I am ashamed of and have sworn I would write about at least once before another years passes us by. I don t have the desire to constantly write about my experiences with her but it seems to be that Alzheimer s is erased far too often from public view and I would rather not contribute to that type of very pervasive silencing either. The recipe for my silence has been made up of various ingredients. One was I was just really really busy. Last semester was frenetic so I often did not have an ounce of room/time to think, much less blog about such a difficult situation (and I spent a lot of time going back and forth to PR as well). Another is that I was trying to avoid the heartache that arises when you focus in, with some detail, care and attention, on something that is unavoidably painful. Each time I tried, I ultimately failed and told myself, I would do so later. Finally I was blogging less and less about these types of subjects so it just seemed a little out of place every time I tried to commit something to words. For me, one of the hardest things to accept???and this probably fed into my silence is that I played a part in prolonging her life when I know she wanted out (with a capital O U and T). But at the time the feeding tube was placed in her, she was walking and talking and it did not seem right to refuse her food (and I hoped that with some food, she would then start to eat on her own as she can swallow just fine) not to mention that her caretaker (a devout Catholic) and my sister would have never at the time been ready to refuse the feeding tube and I was not exactly quite ready either. Well, what we did not foresee was that 5 days in the hospital did her in and when she left, she could no longer walk, she could barely talk, and yet due to the feeding tube, she gained back the dramatic weight that she had shed over a year so that her body at least looked far more alive than it had been for years thanks to the steady stream of nutrition being slowly pumped into her body. I just know she would not want to be alive under these conditions and yet at this point, there is not much I can do legally except refuse certain classes of treatments if she gets sick (such as respirator) or wait until she becomes completely vegetative and then go through the legal hoops, that ultimately may not be successful, to remove the feeding tube. It has been so hard for so many months that as I late I have been trying to approach the whole thing with at least one dash of Zen-like detachment (by which I mean an embrace/acceptance of suffering in this world) and just spend as much time as I can with my mother, which I did a lot over the summer and I am now doing this winter. I am most probably moving back over the summer as well as my sister is not faring all that well after being with her for so many years. Even though she no longer knows my name, or who I am, I can tell she notices my presence and there are days she even seems to be happy. In fact, over the summer, she had some pretty lively days when we could manage to joke about almost nothing. Those days were rare and precious and today they don t seem to happen at all (she did seem a bit excited that it was a New Year though I could not tell if she really knew what I was saying). Over the summer, generally I would climb into her bed and we would co-nap for a couple of hours. And then the worst were the days she was hysterical and crying, and the absolutely worst was when she was crying, pleading for her parents. Those were days that did not break my heart but my soul. Thankfully those days of hysterics seem to be happen less and less and my mother just seems to sleep a lot. I sometimes like to think she is like those really old cats or dogs who seem to spend interminable hours sleeping and resting and don t seem to be suffering all that much though I can still tell she is still in a bad mood from time to time. She also has a wonderful roommate, Ana, who also pretty advanced Alzheimer s though certainly not as bad as my mom. Unlike my mother, she is happy as a clam, so much so she is always saying things like ???Isn t this a great day???? ???How wonderful the day is,??? etc. etc, which is a nice counterbalance to my mom! I sort of like that my mom s roommate is, personality wise, the polar opposite of my mother, who is not a fundamentally unhappy soul, but she was emotionally erratic one with quite a few peaks and valleys and this is still very much the case. Having Ana around (and her family) has transformed the way I have seen this illness and my mother s condition. I am certainly not thrilled that she is alive and in fact think how we end (or don t end) life is something we as a society should be ashamed of. I clearly want to see her released, freed like a bird from the cage of this world (my mother loved loved birds I think because they symbolized freedom), but spending time with Ana, who again seems quite content, made me realize how part of the Alzheimer s experience is rooted in one s personality. My mom has always been difficult and when she was sick but still quite functional, her personality made the illness difficult for her and those around her. She never really had much luck changing her karmic personality and it sure is not going to change now. But as I said she does seem to rest a lot. I just hope her last few months, possibly years, are if nothing else peaceful and tranquil.

31 December 2008

Andrew Pollock: [tech] Goodbye Vonage, hello T-Mobile@Home

When we first moved to the US, I wanted to try and do the telecoms and Internet stuff as cheaply as possible, while still trying to be technologically "fun" as well. I elected to get the cheapest home phone line (local calls only) I could get with AT&T (then SBC) (which is still remarkably expensive) so that I could get DSL (which, while three times faster than what I'd had previously in Australia, was still not that fast). (I went for DSL over cable because I'd heard horror stories about Comcast's reliability, and also they weren't cool with running servers or inbound services, Sonic is, and is a great ISP). I chose Vonage for US long-distance, I think because I'd heard of them previously, and was interested in trying out VoIP. We initially used Vonage for calling Australia as well, until I played around with Engin, and then deployed Asterisk. Anyway, I've been a loyal Vonage customer for exactly three years. The truth is, we hardly make any US long distance calls. We've got friends in Phoenix (hi Craig and Sarah!) that we call infrequently. I guess there might be the odd cell phone that isn't considered a local call, but we tend to use our cell phones more than the home phone anyway... So we were a very cheap $14.99 a month for Vonage. So when I called T-Mobile to purchase a SIM card for the Android Dev Phone 1 I'd been recently given, the opportunity to have their T-Mobile @Home in place of Vonage, for an extra $9.99 on top of what I was paying for the cell phone line seemed like worthwhile cost saving. I have no attachment to the incoming number for the Vonage line, we give out the AT&T land line number to people as our "primary" home number. Later that day, Vonage announced they were increasing their monthly fee from $14.99 to $17.99, which made the decision seem all the more prodigious. I did a spot of research while I was waiting for the @Home box to ship to me, and it turns out that they have a wireless router and non-wireless router option. They hadn't specified what I was getting at order time, and I was hoping I'd get the non-wireless router, since I already had an access point I was perfectly happy with it. As luck would have it, I received the wireless router model (a Linksys WRTU54G-TM). I'd mentally prepared myself to be receiving just another Linksys RTP300, like what Vonage used, and so I was quite surprised by the differences in technology used. It's been a while since I tried to do any reverse-engineering of the Vonage ATA, but I think from memory, it was essentially that: an ATA. It talked SIP back to Vonage. My DSL provider gave me a few static IP addresses, so when I got it, I just allocated one for Vonage, and did a static NAT through my firewall to for it, and everything just worked. It was fairly apparent that the WRTU54G-TM was nothing at all like this (given it was also an access point). It takes a GSM SIM card (up to two in fact), which I presume has all of the provisioning information on it. I was initially worried that I was going to need to completely rejig my network to accommodate it. I guess the SIM card approach means there's no customer specific provisioning that presumably otherwise needs to be done to the device itself, and they can just ship vanilla devices. I presume the Vonage RTP300 had some sort of customer-specific configuration, because I never had to do anything. I briefly toyed with the idea of running two access points, and having a "guest" wireless network, but I am interested in reducing heat and power consumption in my linen cupboard, so I decided to try and just swap over to using the WRTU54G-TM as my access point, retiring my Linksys WAP54G. So that's exactly what I sat down to do last night. Sometimes in their efforts to make these things "simple", they end up making things more complicated. What I wanted to do was just plug the "Internet" side of the device into my internal network, have it get an IP address with DHCP, and then let me get on with configuring it. The "advanced" setup instructions talked about the box having a default IP address of 192.168.0.1 ("or try 192.168.24.1 if that doesn't work"). I figured the DHCP IP address would override that, so I was trying to hit the IP address I could see the unit had picked up from my DHCP server. No response from the HTTP server. I could see it replying to ARP requests, and I could see what appeared to be an IPsec NAT-T connection. After some fiddling around, I twigged that I was trying to manage it over the Internet port, and any device worth its salt was going to be very hardened out of the box on what it expected to be the raw Internet-facing side, so I plugged my laptop directly into one of the four Ethernet ports that it also had, and then I could hit the 192.168.0.1 IP address and access the management interface. It never occurred to me prior to fighting with getting the WRTU54G-TM configured, that the RTP300 might have been more than a black box, as I'd never tried plugging anything into the "inside" ports on it, mainly because I'd never intended to use it as a router or a switch. Out of the box, the WRTU54G-TM was configured to be a router, which I didn't need, and it was configured to be a DHCP server for 192.168.0.0/24, which I definitely didn't want. An interesting side-effect of putting it into bridging mode was the MAC address changed (to the one that was printed on the unit, which was not how out of the box it presented itself). I have no need or intention of plugging anything into the "inside" Ethernet ports on the WRTU54G-TM, as I have a separate switch for that, and indeed I run my wireless network on a different interface of my firewall to my wired network. Fortunately I was able to enable the management interface via the "Internet" interface. The added benefit of the device doing NAT-T is I don't need to allocate an IP address to it for the VoIP stuff it work, it all just works fine without it, so I've freed up an IP address, removed two devices from my linen cupboard, added one new one, and saved some money. Woot! Next, just because I can, I'm going to try and break into the RTP300 and see if I can reconfigure it as a general purpose ATA to talk to Asterisk. There's evidence it's possible. It's otherwise of no further use to me. Even if I get it working with Asterisk, it's not of a lot of use to me. Maybe I can send it to a family member, and they can call us over the Internet for free instead of for the cost of a call to Brisbane...

22 December 2008

Steve Kemp: What can you do? Sparta will need sons.

Since I've ranted a little recently lets do another public bugfix. The last few times people seemed to like them, and writing things down helps me keep track of where I am, what I'm doing, and how soon it will be "beer o'clock". So I looked over the release critical bug list, looking for things that might be easy to fix. One bug jumped out at me: I installed the package:
skx@gold:~$ apt-get install gnomad2
..
The following NEW packages will be installed
  gnomad2 libmtp7 libnjb5 libtagc0
..
Once I copied an .mp3 file to my home directory, with the .ogg suffix I got a segfault on startup:
skx@gold:~$ cp /home/music/Audio/RedDwarf-back-to-reality.mp3 ~/foo.ogg
skx@gold:~$ gnomad2
..
LIBMTP_Get_First_Device: No Devices Attached
PDE device NULL.
TagLib: Ogg::File::packet() -- Could not find the requested packet.
TagLib: Vorbis::File::read() - Could not find the Vorbis comment header.
[segfault]
skx@gold:~$
So I downloaded the source ("apt-get source gnomad2"), and the dependencies for rebuilding ("apt-get build-dep gnomad2"). This allowed me to rebuild it locally:
skx@gold:/tmp/gnomad2-2.9.1$ ./configure --enable-debug && make
skx@gold:/tmp/gnomad2-2.9.1$ cd src/
And now it can be run under GDB.
skx@gold:/tmp/gnomad2-2.9.1/src$ gdb ./gnomad2
GNU gdb 6.8-debian
...
(gdb) run
Starting program: /tmp/gnomad2-2.9.1/src/gnomad2
...
LIBMTP_Get_First_Device: No Devices Attached
PDE device NULL.
[New Thread 0x41dcd950 (LWP 23593)]
TagLib: Ogg::File::packet() -- Could not find the requested packet.
TagLib: Vorbis::File::read() - Could not find the Vorbis comment header.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x41dcd950 (LWP 23593)]
0x00007fc89e0340b0 in taglib_tag_artist () from /usr/lib/libtag_c.so.0
(gdb)
Interestingly the crash comes from a library, libtag_c.so.0. So either: Time to guess which that is. Charitably we'll assume any library that segfaults will be quickly fixed, because it will have more users than a single program.. Moving on we can look at the gnomad2 source for mentions of taglib. Several mentions are found, but src/tagfile.c is clearly the correct place to look. That file contains the following code:
void
get_tag_for_file (metadata_t *meta)
 
  gchar *tmppath = filename_fromutf8(meta->path);
  TagLib_Tag *tag;
  const TagLib_AudioProperties *properties;
  TagLib_File *file = taglib_file_new(tmppath);
  if(file == NULL)  
    g_printf("could not open file %s", tmppath);
    g_free(tmppath);
    return;
   
  g_free(tmppath);
  tag = taglib_file_tag(file);
  properties = taglib_file_audioproperties(file);
  gchar* artist = taglib_tag_artist(tag);
  ..
This looks like a great place to explore because opening a file to read the tags is most likely where the crash is going to be coming from. Interestingly we see the code: Let us guess that the file opening is succeeding but that the tag structure fetched via taglib_file_tag is NULL - and this causes the crash. A quick edit:
  g_free(tmppath);
  tag = taglib_file_tag(file);
  if(tag == NULL)  
    g_printf("tag was null");
    return;
   
  properties = taglib_file_audioproperties(file);
  gchar* artist = taglib_tag_artist(tag);
Rebuild, and the segfault is gone. We have a winner. Now we just need to file a patch... ObFilm: 300

20 December 2008

Jeff Bailey: "I'm Linux"

Just saw the LF announcement:

http://video.linuxfoundation.org/category/video-category/-linux-foundation-video-contest

I love the effort, and I'm sure people will do great work, but there's a problem here. There needs to be *two* contests. The first, with the award that they propose, should be the serious one - The one that might get rolled out to suits and businesses everywhere, that we'd be proud to show off on our corporate web sites.

Then there's the second category. The "too honest" ones that get made for the equivalent "I'm a Mac" / "I'm a PC" ads and wind up on YouTube and email attachments. Not so much fan fiction as fan honesty. =)

I'm thinking start with a focus on a keyboard, crusted with Doritos and possibly an ashtray beside it, zoom out to a couple people playing Quake or Tetrinet or something that clearly haven't washed in days, zoom out, show that this is a dorm room. The room next to it (with cutaway walls and what not) has someone composing an email saying that either Gnome or KDE sux0rs. Further out, two floors, more rooms: Some people lit just by the glow of a CRT, decorated by Debian and Gentoo logos, maybe a vague outline of some porn on a monitor. The zoom out picks up to show ESR writing another book, maybe another ELER comic being written, someone "upgrading" their home wiring, various people arguing, one shower in the building total, and finish the zoom out and fade in the facade to the building: All shiny, glass and steel with a front door with a business person leading a tour past it saying "These are the Linux Development Labs, where all the magic happens. It's closed to visitors right now (points to goth in the back with a laptop who's probably running kismet), except you - you're welcome in." And then fade in the letters "We are Linux"

The soundtrack to this should be a background hum, just at the edge of what a TV speaker will play for volume. Queue in fifths and octaves during the zoom out, fade in some drum and base, some Simcity type of background talking and open up the chord as the words fade onto the screen.

(This is fiction, people. Noone expects another ELER)

17 December 2008

John Goerzen: More Wiki Annoyances

So today, I discovered that MoinMoin has an all or nothing attachment setting: either everyone with write permission to a page can upload attachments, or uploading attachments is disabled for the entire site. No exceptions. Period. Not only that, but there is no maximum attachment size setting unless the attachment was uploaded embedded in a ZIP file. How s that for irony? Not wanting to have my railroad site turn into a file trading site, I don t really want to let everyone upload attachments. Oh, also MoinMoin doesn t maintain a history of attachments. So if somebody drives by and vandalizes an attachment, you get to . restore the original version from tape. Yay? So I decided I d look back at MediaWiki, which has better attachment controls. I still had my test installation, so I went to use it. I edited the main page. I wanted to read about the markup, so I clicked the Editing help link. Whoops, broken link. It links to Help:Editing on the local wiki. Which MediaWiki does not install for you. I asked about it on #mediawiki. The answer was: copy from mediawiki.org. OK, fine. How? Cut and paste. Yes, that s right. Every time a new version of MediaWiki comes out, you get to cut and paste dozens of pages from mediawiki.org to your wiki, or else you ll have outdated help. Yay? The MediaWiki folks on IRC seem to like it this way. Not everyone wants the same help. Fine, but provide a sane default for those that don t care. Who thought running a wiki would be so hard? Update: since yesterday, I went to moinmo.in and fixed the ThemeMarket page to reflect what versions a MoinMoin theme works with. I m happy to help out with fixing Free Software though I don t really have time to add fundamental features like working syntax help links on this particular project.

14 December 2008

Jose Carlos Garcia Sogo: NAS adapter

I have been always desiring to have a NAS adapter and printer server so I can easily share and use both my USB printer and a USB hard disk from every corner in the house. I was doing that when I had a home server, but when it died I losed that functionality. Once of the main reasons to buy a new one was to have this option again, but today I have discovered in Xataka a little device: Addonics NAS Adapter. This is just what I wanted: NAS adapter, little size, can power 2.5 inch. HDD directly, and USB print server. Files are shared by Samba or FTP client, and can act also as DHCP server. As a bonus it has a little bittorrent client which can track 4 torrents at a time, and download them to attached USB device. The only thing I would like to know if is using an USB hub both a printer and a HDD can be attached at the same time. If that can be done, then for only $55 we have a winner. The only last wish that it uses Linux in their core (probably).

13 December 2008

Mike Hommey: Shared subtrees

As reply to my previous post about per-process namespaces, Russell wrote about pam-namespace and shared subtrees. As he reports, pam-namespace (that I discovered by the occasion) can do what I was suggesting would be nice for pam-tmpdir. Anyways, I was actually already planning to write about shared subtrees and how they can be useful with namespaces. In this first post, I will introduce shared subtrees, while in a follow-up post I will introduce how they can usefully be used with namespaces. As a preliminary note, you should know that while etch’s kernel supports shared subtrees, etch’s mount doesn’t support the necessary options. Lenny’s mount is unfortunately uninstallable on etch due to its dependency on a newer libc. But you can find a smount utility’s source code in Documentation/filesystems/sharedsubtree.txt in the kernel source, where other explanations about the feature are available. So, you can either backport lenny’s util-linux to etch, or build smount to replicate what I will be doing below. If you are using smount, just replace
mount --make-type path
with
smount path type
As seen in my previous post, bind-mounting allows to attach a file hierarchy at some other place in the virtual file system.
mount --bind / /mnt
will make all the contents of / (/bin, /etc, …) available through /mnt (/mnt/bin, /mnt/etc, …). On the other hand, sub-mounts will be ignored in such a case. For instance, /usr is usually a different mount point from /. It means /mnt/usr will be empty (provided it is empty in the underlying physical filesystem), instead of containing the same as /usr:
$ mount --bind / /mnt
$ ls /mnt/usr
$ ls /usr
bin games include lib lib32 lib64 local sbin share src X11R6
$ umount /mnt
If you also want /usr to be bind-mounted, you must use --rbind instead of --bind:
$ mount --rbind / /mnt
$ ls /mnt/usr
bin games include lib lib32 lib64 local sbin share src X11R6
$ ls /usr
bin games include lib lib32 lib64 local sbin share src X11R6
Obviously, sub-sub-mounts will also be propagated. Since recursively bind-mounting will create a bunch of mount points, unmounting can become a hassle. You can use the following command to unmount everything:
$ awk '$2 ~ /^\/mnt/ print $2 ' /proc/mounts sort -r xargs umount
Now, this is where shared subtrees come in. After the bind mount has been done, if you mount something on either side of the bind mount, the new mount is not propagated. This is called private subtrees, and is the default. But before doing anything else, let’s setup our testing environment:
$ mkdir -p /a/a /b
$ touch /a/b /a/c
$ ls /a
a b c
$ ls /b
After, bind-mounting /a onto /b, let’s see what happens when mounting something under /a, then under /b:
$ mount --bind /a /b
$ ls /b
a b c
$ mount --bind /usr /a/a
$ ls /a/a
bin games include lib lib32 lib64 local sbin share src X11R6
$ ls /b/a
$ umount /a/a
$ mount --bind /usr /b/a
$ ls /a/a
$ ls /b/a
bin games include lib lib32 lib64 local sbin share src X11R6
$ umount /b/a
As I said earlier, these new mounts are not propagated. Note that I used bind-mounts as sub mounts, but it would work all the same with other kind of mounts (device, fuse, etc.). There are 2 other modes that allow to have some propagation: shared and slave. shared allows mounts on both ends to be shared. Note you need to set the mode before bind-mounting:
$ umount /b
$ mount --bind /a /a
# This is needed because /a is not initially a mount point and you can only apply subtree modes to mount points.
$ mount --make-shared /a
$ mount --bind /a /b
$ mount /dev/sda1 /a/a
$ ls /a/a
config-2.6.26-1-amd64 grub initrd.img-2.6.26-1-amd64 System.map-2.6.26-1-amd64 vmlinuz-2.6.26-1-amd64
$ ls /b/a
config-2.6.26-1-amd64 grub initrd.img-2.6.26-1-amd64 System.map-2.6.26-1-amd64 vmlinuz-2.6.26-1-amd64
$ umount /a/a
$ mount /dev/sda1 /b/a
$ ls /a/a
config-2.6.26-1-amd64 grub initrd.img-2.6.26-1-amd64 System.map-2.6.26-1-amd64 vmlinuz-2.6.26-1-amd64
$ ls /b/a
config-2.6.26-1-amd64 grub initrd.img-2.6.26-1-amd64 System.map-2.6.26-1-amd64 vmlinuz-2.6.26-1-amd64
$ umount /b/a
You can even mount on one end and unmount from the other:
$ mount /dev/sda1 /a/a
$ umount /b/a
$ ls /a/a
slave allows mounts on the “master” end (/a in our case) to propagate to the “slave” end (/b), but not the other way around. The “master” end need to be shared :
$ umount /b
$ mount --make-shared /a
# Only for completeness, we already set /a as shared earlier.
$ mount --bind /a /b
$ mount --make-slave /b
$ mount /dev/sda1 /a/a
$ ls /a/a
config-2.6.26-1-amd64 grub initrd.img-2.6.26-1-amd64 System.map-2.6.26-1-amd64 vmlinuz-2.6.26-1-amd64
$ ls /b/a
config-2.6.26-1-amd64 grub initrd.img-2.6.26-1-amd64 System.map-2.6.26-1-amd64 vmlinuz-2.6.26-1-amd64
$ umount /a/a
$ mount /dev/sda1 /b/a
$ ls /a/a
$ ls /b/a
config-2.6.26-1-amd64 grub initrd.img-2.6.26-1-amd64 System.map-2.6.26-1-amd64 vmlinuz-2.6.26-1-amd64
$ umount /b/a
There is a third mode, unbindable, that does something different:
$ umount /b
$ mount --make-unbindable /a
$ mount --bind /a /b
mount: wrong fs type, bad option, bad superblock on /a,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg tail or so
$ mount --bind /a/a /b
mount: wrong fs type, bad option, bad superblock on /a,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg tail or so
As you can see, it disallows bind mounting of /a and its subdirectories to some other place. Finally, to put back the default mode, you can use:
$ mount --make-private /a
Similarly to --bind, there is also a recursive version of each: rshared, rslave, runbindable and rprivate, to apply these to sub-mounts.

Next.

Previous.