Search Results: "noop"

7 December 2007

Gunnar Wolf: Debian Developers fail Turing tests?

Ok, so two people replied to yesterday's post about triple negations - Dato (by email) and MadCoder. Both, said basically the same thing: false and && true are silly noops. And yes, knowing this, I added them. Why? Clarity... At least having them at the end of a test shows the statement is of conditional nature (and not just another obscure attempt to do $ DEITY -knows-what). They at least look cleaner than a one-line-squashed if block in a makefile. To me, at least ;-)But... If you noticed this post's title, it goes beyond this comment - One of the most benefical effects I noticed when I installed Jaws 0.7 (over 0.6, of course) is that I no longer had the swarms of spambots flooding me - I often had hundreds of comments a day, and nowadays I hardly get any spam. Now, I fail to see what is so strange in my blog's comment forms (it does not even have any obvious Javascript, although it does obfuscate a bit the source of the captcha image). And you are not the first Debian people to complain you cannot post comments to my site. Strangely, few non-Debian people have ever complained.And yes, the spam has stopped, almost completely.So, Debian guys: Are you human?

24 September 2007

Russell Coker: Blogger is Not for Serious Blogging

When I started blogging I used Blogger [1]. After some time I decided that it did not offer me the freedom I desired. I could not easily make changes (I could have created new themes, but it would have taken an unreasonable amount of work). I currently use Wordpress, it’s still a lot of work to change themes, but at least it’s CSS and PHP coding which can be used for other things. Blogger offers no statistics on web use (I tried adding support for Google Analytics but couldn’t get it to work properly), what I want is Webalizer or something similar (which is easy to do when running your own server). Blogger is a reasonable way of starting blogging, but if you use it then you want to make it easy to change to something that you own. Blogger has a feature of using a DNS name in a domain that you own for the name of your blog (which is much less obvious than it once was), I regret not using that feature as I still have my old posts on blogger and don’t want to break the links. Blogger has in the past had problems with time-stamps on posts, when I used blogger I had some complaints that my posts were staying at the top of Planet listings for unreasonable amounts of time (I never tracked this down before switching to my own platform). Hosting your own blog is not as difficult as you might expect (initially at least). It becomes difficult when you want to install lots of plug-ins, but then any blogging solution would be difficult if you want to do that. The Wordpress [2] package in Debian works well and has good support for multiple Wordpress blogs. There is a separate product named Wordpress-MU [3] which is designed for people who want to run a service in competition with Blogger, some people recommend that you use Wordpress-MU if you want to set up blogs for several people. I disagree. If you are setting up blogs for a small number of people then you can use the standard Wordpress package and create a file named /etc/wordpress/config-whatever.example.com.php which contains the configuration for whatever.example.com and then create a new Wordpress blog by using the web-based interface to do the rest. It would not be difficult to create the configuration file in question with an M4 script if you have a moderate number of blogs to host (maybe a hundred or so). I think that it’s only if you want to host thousands of blogs that you need the features of Wordpress-MU. Note that MU is not as well packaged as the base Wordpress and has some rough edges. Last time I tried to set up MU I was not successful. This is not to say that Wordpress is inherently the best program, there are many other free software blogging platforms out there. Wordpress is the one that I use and am happy to recommend but if your requirements differ from mine then another platform may be better for you. I also suggest that Wordpress be used as the base-line for comparing blogging software. Blogger does not require significant resources. A virtual host with 256M of RAM should be more than adequate to run Wordpress plus MySQL. Such virtual hosts are getting quite cheap nowadays, and one such host could easily be shared by a number of bloggers. My blog uses about 1.2G of data transfer per month. vpsland.com offers virtual hosts starting at 150G per month data transfer with 192M of RAM being the minimum. Prices start at $US15 per month. While I can’t compare vpsland.com to other virtual hosting providers (having never used any other such service) I can say that they work reasonably well and I have a client who is happy with them. So it seems that a minimal plan with vpsland.com would host 20 blogs with the same traffic as mine (with RAM being the limiting factor) and a slightly larger plan (with more RAM and more bandwidth) that costs $US30 or $US40 per month could handle 100 or more blogs that are similar to mine. If you get together with some friends and share a virtual server then blogging would not be expensive. Incidentally I had previously read a blog comment about people being hesitant to share servers with their friends (as they apparently would rather grant some unknown people at a faceless corporation the ability to snoop on them than people that they know). The advantage of a blog server in this regard is that everything is public anyway! If you have good technical skills then I recommend using Wordpress as your first blogging platform. If you find that you don’t like it for some reason then you can convert to another platform if you own the domain. If you are setting up a blog for a less technical user then Wordpress is also a good choice. My sister uses Wordpress, not that she made much of a choice (I had set up a Blogger account for her some time ago which she never used - I guess that could be considered as a choice to not use Blogger) but that I set up a Wordpress blog for her and she seemed to like using it.

12 February 2007

Christine Spang: Armagetron Advanced and Debian

News flash: gamers and Tron fans everywhere can rejoice; Armagetron Advanced will soon be up-to-date once more in Debian! The last time a new upstream version (0.2.7.0) was uploaded was almost two years ago now, and while the Debian package has languished in neglect, upstream has chugged on, fixing bugs and adding new awesomeness to the game. Just recently, the old maintainer orphaned the package, and since I use it anyway I’ve adopted it and given it some much-needed love. The new version is 0.2.8.2.1, what an, er, long version number. The new packages have been renamed from armagetron[-foo] to armagetronad[-foo] to reflect upstream’s name change. They include upstream improvements such as the addition of maps and improved graphics code, as well as packaging improvements like a new initscript for the server and rewritten, up-to-date manpages. While the new packages have been uploaded to experimental, they’re stuck in NEW due to the binary name changes. So, grab the x86 or x86-kfreebsd packages from here and test, test, test! (Yes, I run a kfreebsd machine. I wanted something eclectic for a non-essential, moderately old dual-core x86 box. Also, I’ll probably compile amd64 packages soon, but the amd64-machine I can use to build them on is currently in a half-installed state, which I need to fix before that. You can always build from source.) I’ve cleared with the security team that it won’t get in the way of anything and will probably be uploading to unstable as soon as there’s been some more testing to look for major problems. And since the newest version contains fixes for the security bugs affecting the old version, I’m going to snoop around and judge the [in]sanity level of porting back the security fixes for etch, since the new version will at most be unofficially backported to etch. Go, er, take a break in between fixing RC bugs. And test, test, test!

27 January 2007

Adam Rosi-Kessel: Airport Snooping

I’ve always wondered why ill-intentioned hackers don’t set up fake free WiFi hotspots in public places like airports to collect passwords and other personal information. As it turns out, they do:
Authentium did an in-depth survey of the ad hoc networks found at O’Hare, visiting on three different occasions. It found more than 20 ad hoc networks each time, with 80% of them advertising free Wi-Fi access. The company also found that many of the networks were displaying fake or misleading MAC addresses, a clear sign that they were bent on mischief.
The Computerworld article focuses on the dangers of associating with ad-hoc (peer-to-peer) wireless networks and provides a number of tips for Windows users to avoid unintentionally connecting to an ad-hoc network. It seems to me just a matter of time, though, before malicious agents set up “real” (infrastructure-mode) access points in public places to collect such data. In fact, based on the airport study above, I would be shocked if it weren’t already happening. Numerous trivial variations could be very difficult to detect for the average user: for example, someone could set up a WiFi access point advertising itself as a T-Mobile HotSpot, and copy the T-Mobile web interface. If they wanted to be especially crafty, they could sit outside a Starbucks (or other known T-Mobile HotSpot) and simply use a different channel than the existing hot spot. Even a sophisticated user might have trouble telling the difference. The lesson is that you need to expect that all network traffic is insecure if not encrypted and signed at both ends. Although even in that case there are possible man-in-the-middle attacks, at least we have a cryptographic certificate/certificate authority infrastructure to mitigate the risk. (That sort of attack is also a bit more difficult to pull off, thus perhaps deterring the simplest “script-kiddie” type attackers.)

Adam Rosi-Kessel: Airport Snooping

I’ve always wondered why ill-intentioned hackers don’t set up fake free WiFi hotspots in public places like airports to collect passwords and other personal information. As it turns out, they do:
Authentium did an in-depth survey of the ad hoc networks found at O’Hare, visiting on three different occasions. It found more than 20 ad hoc networks each time, with 80% of them advertising free Wi-Fi access. The company also found that many of the networks were displaying fake or misleading MAC addresses, a clear sign that they were bent on mischief.
The Computerworld article focuses on the dangers of associating with ad-hoc (peer-to-peer) wireless networks and provides a number of tips for Windows users to avoid unintentionally connecting to an ad-hoc network. It seems to me just a matter of time, though, before malicious agents set up “real” (infrastructure-mode) access points in public places to collect such data. In fact, based on the airport study above, I would be shocked if it weren’t already happening. Numerous trivial variations could be very difficult to detect for the average user: for example, someone could set up a WiFi access point advertising itself as a T-Mobile HotSpot, and copy the T-Mobile web interface. If they wanted to be especially crafty, they could sit outside a Starbucks (or other known T-Mobile HotSpot) and simply use a different channel than the existing hot spot. Even a sophisticated user might have trouble telling the difference. The lesson is that you need to expect that all network traffic is insecure if not encrypted and signed at both ends. Although even in that case there are possible man-in-the-middle attacks, at least we have a cryptographic certificate/certificate authority infrastructure to mitigate the risk. (That sort of attack is also a bit more difficult to pull off, thus perhaps deterring the simplest “script-kiddie” type attackers.)

4 December 2006

Erich Schubert: Software mixer with ALSA

The "high definition audio" in my laptop is rather minimal. Apart from the mic not yet working, it has a line out and a single volume control. Thats it. However, I'd like to have multiple applications use the sound card, for example my music player, eventually some video player or flash, and some system events. ALSA to the rescue. It's not easy to configure, but really powerful: Mixer screenshot with MPD volume control Yes, that is a separate volume slider in my regular mixer for MPD, my music player. Here's how to do that: First we'll need to create a huge /etc/asound.conf:
# the real device
pcm.realdev  
        type hw
        card 0
        device 0
 
# software mixing
pcm.dmixer  
        type dmix
        ipc_key 3129397
        ipc_key_add_uid false
        ipc_perm 0666
        slave.pcm "realdev"
        slave  
                period_time 0
                period_size 1024
                buffer_size 8192
                # we're enforcing 44100, since thats what most apps use
                rate 44100
         
        bindings  
                0 0
                1 1
         
 
# software volume
pcm.softvol  
        type softvol
        slave.pcm "dmixer"
        control  
                name "Software"
                card 0
         
 
pcm.mpdvol  
        type softvol
        slave.pcm "dmixer"
        control  
                name "MPD"
                card 0
         
 
# input
pcm.input  
        type dsnoop
        ipc_key 3129398
        ipc_key_add_uid false
        ipc_perm 0660
        slave.pcm "realdev"
 
# duplex device
pcm.duplex  
        type asym
        playback.pcm "softvol"
        capture.pcm "input"
 
# default devices
pcm.!default  
        type plug
        slave.pcm "duplex"
 
pcm.dsp0  
        type plug
        slave.pcm "duplex"
 
I won't go into all the details (I don't know all of them either), but the basic idea is that I setup the dmixer plugin for software mixing, and attach two software volume controls to it. I'm keeping the permissions to 0666, since my MPD is running as a different user, and I didn't find a way to say I'd like to have the permission set to group "audio". The default device is the regular microphone jack (untested, since there are driver issues with my chipset and recording) and the "Software" volume control. If you have an ~/.asoundrc you might want to move it out of the way. Next I need to configure MPD to use its own volume control via /etc/mpd.conf:
audio_output  
        type            "alsa"
        name            "my ALSA device"
        # 'mpdvol' is the device name I used in asound.conf
        device          "mpdvol"
 
You'll probably need to restart all applications currently accessing your audio devices to have them pick up the new config. The new volume control will also only appear after you've started an application using it AFAICT. Sometimes you need to restart them twice for the new volume control to be effective. When alsa-utils restores the volume controls after reboot it should work right away. The "Software" volume control is optional, but that way I can tune down the default applications volumes below the MPD volume if ever needed. Oh, and I think you can safely keep one or all of the software volume controls to maximum without distortion happening (this doesn't hold for all sound cards, where it's often best to keep the sliders at ~75% max to avoid distortion)

16 November 2006

Russell Coker: biometrics and passwords

In a comment on my post more about securing an office someone suggested using biometrics. The positive aspect of biometrics is that they can't be lost, no-one is accidentally going to leave a finger or an eye in their car while they go to a party while other authentication devices are regularly lost in such a manner.

The down-side is that having your finger or eye stolen would be a lot less pleasant than having a USB device, swipe-card, key, or other security device stolen. I think that it's good to have an option of surrendering your key when under threat (for the person who might be attacked at least).

Rumor has it that some biometric sensors look for signs of life (EG temperature and pulse), but I believe that these could be faked with a suitable amount of effort. A finger attached to a mini heart/lung machine should make it possible to pass the temperature and pulse checks (although I don't think that I have access to any data that is important enough to justify such effort on the part of an attacker).

One thing that biometrics could be useful for is screen-blankers. It would be good to be able to have a screen-blanker for your computer that operates when you go to get a coffee. For a period of 10 minutes after leaving a biometric method could be used to re-enable access. After that time a different method would ave to be used. This gives the convenience of biometrics for when you need it most (the many short trips away from your computer that you make during the day) but removes the benefit for an attacker who might consider removing part of your body. Also I am not convinced in the general security of biometrics. There are claims that you can make a finger based on a fingerprint which can fool a biometric sensor. If those claims are correct then a biometric sensor would still work for a coffee break (presumably you are not far away and will be back soon, and other people are in the area). The coffee break security is usually to prevent casual snooping such as colleagues who want to see what was on your screen but not actually do anything invasive to get it. Another benefit of biometrics for a screen saver is that although I trust people in the same office as me (whichever office that may be) not to try anything when they might get caught I still don't want them shoulder-surfing my password. Replacing the trivial authentication cases with a fingerprint reader would prevent that.

In the KDE 1.x days I had a shell script launched when the lid closed on my laptop which would lock the screen (the screen-saver ran in the background and a signal could make it lock the screen). This meant that I could merely close the lid of my laptop to lock the screen, this is fast and easy and also is not immediately recognised as locking the screen. Some people get offended if you lock your laptop screen when in their presence as they think that you should trust them enough to leave your most secret data open to them (generally people who aren't serious about computers - I'm sure that the same people would happily lock their diary if I was ever in the same room as it). Being able to lock the screen in a non-obvious way is a security benefit.

Regarding the comment about using a USB device to store passwords, there are two problems with this, one is that all passwords will be available all the time, this means a program that is permitted to access password A would also be given access to password B. The other is that the passwords can be accessed easily. The ideal solution is to have an encryption device that uses public key cryptography and stores the private keys on the device with no way of removing them. It would also permit the user to authorise each transaction.

I would like to see a USB device that stores multiple GPG keys and implements the GPG algorithm (with no way for anyone with less resources than the NSA to extract the keys). The device would have a display and a couple of buttons. When it is accessed it would display messages such as "signing attempt on key 1" and allow me to press a button to authorise or reject that operation.

This means that if I insert the key to sign an email I won't have a background trojan start issuing sign and decrypt commands. The only viable attack that would be permitted is the case where I want to sign a message and my message is sent to /dev/null and a message from an attacker is signed again. The non-arrival of my original message would hopefully alert me to this problem. I am not aware of any hardware which supports these functions.

Also I have just received a couple of RSA SecurID tokens as a sample. An RSA representative phoned me to ask about my use of the tokens, I said that I am an independent consultant and I have been having trouble getting my clients to accept my recommendations to use such devices and that I want to implement them on a test network so that I can give more detailed advice to my clients and hopefully get them to improve their security. For some reason the RSA rep found that funny, but I got my sample hardware so it's fine.

4 September 2006

Dann Frazier: iLO 2 - bye-bye remcons, hello vsp

HP ProLiant servers have a device called the iLO that lets you do things like get remote console, power cycle, etc. There's a java interface for getting a graphics console, but I've always been more than happy to ssh into the device and use the "remcons" command, which lets me view the VGA console remotely. It only deals with text, but why do I need framebuffer/X on a remote server anyway? Anyway, I just received a new "G5" system, which has an updated controller called "iLO 2". So I ssh in to install it and, surprise, the remcons command is gone. So, I spent a few days playing with this machine, trying to avoid installing a Java plugin or actually walking into the machine room with a monitor/keyboard. What I did discover is that the ssh interface has a "Virtual Serial Port" option, and I can configure the BIOS to redirect its output through the serial port. Turns out, this is actually better than remcons - remcons somehow captured the text being displayed via VGA, probably by snooping the framebuffer. This resulted in a oft difficult to read display due to random artifacts. But, good ol' serial doesn't have this problem - pump it up to 115200, and its quite interactive and easy to read. So, to all of the people for whom I've suggested the remcons command in the past, try vsp instead - its a lot nicer.

30 August 2006

Joey Hess: id fraud

I found out today that someone found the small amount of information about me they needed to nearly successfully buy stuff in my name. They call this "identity theft", but since my identity still seems to be intect (pats his rampant ego) and since as an ardent SF fan, I'd like to reserve the term identity theft for the possibility of someone stealing a copy of me, I prefer not to use that term for this form of fraud. Luckily I already had a fraud alert placed on my accounts before this happened; I started placing these alerts a while ago, on the basis that the banking system's verification methods are so broken that it makes sense to just do it pre-emptively, before you have any reason to think someone is trying to defraud you. Who knows if that does any good though. Oddly, I almost ranted about this id theft nonsense last week, before I knew this happened. The thing is, while I'm calling to report credit cards as compromised and learning that someone managed to put together my name, address, phone number, and a not very well secured credit card number; at the same time I have something here with these properties:
  1. Anyone can use it to verify if a given statement (such as "transaction #128: please pay this person $500") was actually made by me and actually applies to the person I meant it to.
  2. Using it doesn't automatically give it to a supposedly trusted third party, such as the low-paid phone support guy who has my credit card number and all the rest up on his screen right now as I ask him to cancel the purchase.
  3. According to the experts is not breakable by any means except for a brute-force attack that would use the resources of a medium-sized country.
  4. Can be used to identify me with a fair degree of certainty, even if you've not met me.
  5. Is suitable for use on the internet.
  6. Even if physically stolen from me is not trivially easy to break and use.
  7. If I lose it or know that someone has stolen it from me, I can revoke its use in a way that is just as hard to forge or break.
  8. Can, incidentially, be used to make private conversations just as hard to snoop on. But that's probably a different rant.
That magic thing is a public and private key pair for GPG, and it seems really weird to me that I can use this for unimportant things like signing email, and for crucial things like authenticating changes to the software deployed on millions of coumputers, but I cannot use it to pay a bill. I wonder if the world at large will ever catch on to the uses of public key cryptography? Anyone want to start a First Bank of GPG?

1 August 2006

Jeff Bailey: Je viens de manger un hippopotame pour le d jeuner!


The stick
Originally uploaded by jbailey.
Second Doctor's appointment. Review of previous bloodwork, generally things good, a bit low on potasium.

Apparently February 20th is what we're aiming for...

(Snoopy Dance!)

18 May 2006

Daniel Burrows: Still Not Dead Yet

If it looks like I've fallen off the 'Net recently, it's because I have. In addition to the usual problem of having relatively little free time since I started working, I've been spending the last month or so moving into a new apartment. Much of my free time has been occupied by either planning what to buy and put in my apartment, shopping for stuff to buy and put in my apartment, hauling stuff home from stores into my apartment, and (in the case of IKEA) assembling the stuff I just bought in my apartment.

On top of that, I haven't hooked up an Internet connection yet. This is partly because I'm dissatisfied with all the available options -- which, in my area, seem to be Verizon and Comcast. Since I'm not interested in cable TV, the cheapest choice is Verizon, and I just finally got them to officially hook my phone line up. This was a more complicated process than you might think; they require you to fax them both sides of your driver's license before they'll activate a phone service (presumably to make the NSA's job a bit easier as they snoop on your traffic). It also looks like I probably can't get DSL service until I receive my first phone bill and get a phone number I can enter into the DSL request form on Verizon's website, so I won't be properly connected for another few weeks.

I think that Kate wants me to get off the computer so she can use the internet, so I'll cut off here. More later, maybe.

15 March 2006

Martin F. Krafft: udev and grey hair

It won't be long before I grow grey hair if udev keeps pulling tricks on me. Yesterday, an upgrade to 0.087-1 hosed one of my systems. The system is sarge-based, but it is connected a to a cable modem needing the cdc_ether driver, which 2.6.8 does not have. Since I don't expect backports of 2.6.15 to sarge (Update: backports.org has a 2.6.15 backport, but it won't solve my problem it seems), but also don't want to migrate my system to testing, I simply decided to pin linux-image-2.6.15-1-686 and all its dependencies to unstable with APT:
Package: linux-image-2.6.15-1-686
Pin: release a=unstable
Pin-Priority: 600
Package: initramfs-tools
Pin: release a=unstable
Pin-Priority: 600
Package: udev
[...]
The install worked, and off I went to reboot... but the machine did not come back up, and booting 2.6.8 with the new udev also failed. Great. At first, I thought I knew the problem, but at closer inspection, it was something else: udev's ide.agent hung itself up and timed out. It turns out it was looking for hd141 instead of hda, and once I found that out, it didn't take long to put two and two together: 141 is ASCII 97 is 'a'. And if you echo hd\141 just like that, the shell will swallow the backslash. Marco, the udev maintainer blamed a broken shell, and I identified busybox-cvs-static to be the problem; Replacing it with busybox from unstable fixed the issue. Now all that remains is to convince Marco that the bug has nothing to do with initramfs-tools when it occurs in a script provided by udev. initramfs-tools depends on busybox-cvs-static busybox since it works with either. If udev doesn't work with busybox-cvs-static, it has to conflict, which is not really an option though, due to a libc6 upgrade loop. Fortunately, the 2.6.16 kernel will make ide.agent obsolete, so the problem shall vanish in smoke. With one problem solved, I woke up this morning to find another. I use udev's network interface renaming feature to ensure that my interfaces always have the names I expect, and that their names give me a hint as to what they're connected to. Sure, using /etc/modules to ensure a defined load order would work fine, but I have too many machines under my control to want to remember that eth2 on this machine is the wireless LAN. So I use the following udev rules:
wall:~# cat /etc/udev/rules.d/local-interfaces.rules
KERNEL="eth*", SYSFS address ="00:02:8a:80:21:31", NAME="internet"
KERNEL="eth*", SYSFS address ="08:00:46:b1:2d:ee", NAME="lan"
KERNEL="eth*", SYSFS address ="00:50:04:5b:ec:b3", NAME="wlan"
KERNEL="eth*", SYSFS address ="00:04:23:72:4e:6c", NAME="wifibackup"
Update: Bas Zoetekouw suggested to match against something else than MAC addresses, for testing. Thus, I tried PCI IDs (using the topmost SYSFS device entry in the udevinfo output):
KERNEL="eth*", SYSFS device ="0x24c4", NAME="internet"
KERNEL="eth*", SYSFS device ="0x103d", NAME="lan"
KERNEL="eth*", SYSFS device ="0x5157", NAME="wlan"
KERNEL="eth*", SYSFS device ="0x1043", NAME="wifibackup"
The problem remains the exact same. It also remains the same if I completely remove wlan and wifibackup. When I woke up this morning, I found the following mess:
wall:~# ip addr
2: internet: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 08:00:46:b1:2d:ee brd ff:ff:ff:ff:ff:ff
3: eth0_ifrename: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:02:8a:80:21:31 brd ff:ff:ff:ff:ff:ff
4: wifibackup: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:04:23:72:4e:6c brd ff:ff:ff:ff:ff:ff
5: wlan: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:50:04:5b:ec:b3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.14.129/25 brd 192.168.14.255 scope global wlan
    inet6 fe80::250:4ff:fe5b:ecb3/64 scope link
      valid_lft forever preferred_lft forever
The wlan and wifibackup interfaces are configured correctly (I use wifibackup to hook into the various open WLANs around, when my provider goes down, or I need more bandwidth). But internet was assigned to the LAN interface, and eth0_ifrename, well... that's just whacked. Looking at the udev code, this seems to be due to a patch Marco pulled from Ubuntu, which is to guard against race conditions in the renaming. For instance, if eth0 needs to become eth1 and vice versa, udev renames the first to eth0_ifrename and waits until the other has finished its identity change. The patch, however, is a hack: it tries endlessly to rename the interface to its final target name, which, in my case, obviously goes on forever.
10:18  * Md just copied it from the Ubuntu package
10:18 < madduck> why???
10:19 < Md> because it worked in my artificial setup
Unfortunately, this isn't the first time that Ubuntu's "giving back to Debian" (which requires Debian to go out and fetch) is two steps back rather than one forward. I would hope that maintainers of criticial packages (such as udev) would exercise more care when pulling from Ubuntu. And that Ubuntu would please stop adding hacks to packages and instead concentrate on fixing issues at the root the Debian way. So my problem still persists, and even given Ubuntu's ifrename patch problems, I can't figure out what is actually going on. It does not help that udev also suddenly stopped logging interface name changes. Yes, just like that.
KERNEL="eth*", SYSFS address ="00:02:8a:80:21:31", NAME="internet"
KERNEL="eth*", SYSFS address ="08:00:46:b1:2d:ee", NAME="lan"
How can these two rules actually trigger the rename conflict? The only way I could imagine is that udev gets confused and falsely renames 08:00:46:b1:2d:ee to internet. Then, when it gets to the other card, a name collision occurs, udev chooses eth0_ifrename as temporary workaround, and then tries forever to rename eth0_ifrename to internet, which will never succeed. So why does udev get confused in the first place? Why would it ever name the interface 08:00:46:b1:2d:ee internet? Beats me. But I better end here because the world surely doesn't need just anoAther udev rant. Update: I forgot to mention that the renaming works just fine when I unload/load modules from the command line. It's only during the boot process that things go wild. Update 2: I should not that it does not work fine some of the time if the modules are loaded in quick succession.

21 February 2006

Jonathan McDowell: Power corrupts

I bought a Belkin F6H500ukUNV from eBuyer (quickfind code 77131). At under £25 including P&P it seemed like a good deal and I've been meaning to get round to having a UPS to allow clean shutdown of my local machine during power problems. Belkin ship Linux and FreeBSD programs to talk to the UPS (though only over the serial interface - it has USB too). It doesn't like xterm it seems; prints Error opening terminal: xterm.. Seems fine with a terminal type of linux. It also puts all its files (config, help, binaries) in /etc/belkin. And it's binary only so I can't fix any of this brokenness. However, the lovely Network UPS Tools exists. Except Belkin have a number of UPS types, all incompatible with each other. After figuring out that I really, really needed to use the Belkin provided cable and not just a generic serial extender cable (grrrr. Why? If it's got a 9 pin D labelled RS232 why not make it a sensible port?) I got the Belkin software working and straced it to see what it did. A bit of looking at the nut source found several drivers that appeared to use the commands Belkin were sending (Q1, I & F). I tried powermust first, with the following /etc/nut/ups.conf:
[belkin]
	driver = powermust
	port = /dev/ttyM2
(I have a 4 port serial card, so /dev/ttyM2 is just a normal serial port, really.) And tada. It works. I can now get output like:
[noodles@pot ~]$ upsc belkin@localhost
battery.charge: 100.0
battery.voltage: 13.8
battery.voltage.nominal: 12.0
driver.name: powermust
driver.parameter.port: /dev/ttyM2
driver.version: 2.0.3
driver.version.internal: 1.1
input.voltage: 227.0
input.voltage.fault: 227.0
input.voltage.maximum: 234.0
input.voltage.minimum: 221.0
output.frequency: 50.0
output.voltage: 227.0
output.voltage.target.battery: 230.0
ups.delay.shutdown: 2
ups.delay.start: 3
ups.load: 0.0
ups.mfr: Mustek
ups.model: PowerMust
ups.serial: unknown
ups.status: OL
I don't know about doing shutdown yet, but ups.status correctly goes to OB (on battery) if I pull the power, which is probably the most important thing. :) At some point I'd like to move over to the USB interface; I have better things to do with my serial ports. Belkin don't appear to have done the sane USB HID power thing; instead it's some odd hid device that doesn't even have a Belkin manufacturer ID:
Bus 003 Device 015: ID 0001:0000 Fry's Electronics 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0001 Fry's Electronics
  idProduct          0x0000 
  bcdDevice            1.00
  iManufacturer           1 MEC
  iProduct                2 MEC0002
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     624
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)
The NUT energizerups driver appears to talk USB and use the Q1/F commands, so I think I'll try that later. Or it's back to usbsnoop and a Windows box I guess.

14 January 2006

John Goerzen: You remind me of a story...

It seems that lately my presence seems to remind people of stories of me as a child. I heard a new one tonight from the person that was my Bible School teacher in 2nd or 3rd grade. Apparently, each day of Bible School, one child would bring in something for show and tell. There were toys, dolls, maybe a pet. When it was my turn, I brought in something I was very proud of: my adding machine. She asked me if I remembered this. "Nope, but it sounds like something I would have done." I told Terah this story. She said, "You probably just brought the adding machine because your parents didn't want to have to carry the whole computer to church." I remind people of other stories too. My mom likes to mention that, when I was maybe 2 years old, I wanted to sleep with a real light bulb instead of some stuffed animal. She was a bit concerned about the safety of that, and apparently was only able to convince me to stop when she found an eraser in the shape of a light bulb that I accepted as a substitute. Mom also likes to talk about my birthday or Christmas requests at that age: a "good-quality vacuum cleaner" and 12 ceiling fans. My uncle tells me of the time I had a conversation with a math professor, when I was maybe preschool or kindergarten age. I had no idea who he was, but apparently was quite proud that my new calculator had a square root key, and told him how important it was to have that on a calculator. It's not really fair, though -- Terah doesn't call up lots of stories in people's memory. So I have to help out a bit. I mention her underwear rotation system, or this story: Terah has always been a big fan of deserts, and especially ice cream. Apparently her parents had a lot of trouble when the ice cream truck came around -- Terah always really, really wanted lots of ice cream. They thought that if they started calling it the "yuck truck" that Terah might think it only had nasty food. Nope, didn't work. She just started getting excited about the yuck truck. I also have no problem hiding gifts from Terah. She knows exactly where I keep them, but she's concerned that maybe that particular room can't keep out mice very well. So, to her, I keep gifts in the "rodent closet". Although she'd really like to snoop, she just can't bring herself to do it. Very handy as far as I'm concerned.

28 December 2005

Jonathan McDowell: Linux WMDs

So, the delightful Kathy bought me a Marks & Spencer USB Missile Launcher (unfortunately out of stock at present or I'd have linked directly to it. Try searching on eBay / Google to see what I mean.) Problem. WinXP/2k only drivers. That's no fun. Plugged it in to my laptop (as you do). dmesg reports:
input: Tenx Nonstandard Devic as /class/input/input6
input: USB HID v1.10 Device [Tenx Nonstandard Devic] on usb-0000:00:1d.1-2
input: Tenx Nonstandard Devic as /class/input/input7
input: USB HID v1.10 Device [Tenx Nonstandard Devic] on usb-0000:00:1d.1-2
lsusb says:
Bus 002 Device 004: ID 1130:0202 Tenx Technology, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x1130 Tenx Technology, Inc.
  idProduct          0x0202 
  bcdDevice            1.00
  iManufacturer           0 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           59
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      43
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      23
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
The Windows software appears to consist of TenxHID.dll (24k) and Missile_Launcher.exe (908k). TenxHID only exports DeviceIni, ReadBuffer and WriteBuffer AFAICT. Which implies the higher level stuff is done in the exe to me. I think it's a job for USBSnoop and a Windows box, but that'll have to wait for a few days until I get back to a WinXP box I can use to fiddle. Unless someone else manages to write a driver in the meantime. :)

5 December 2005

Aigars Mahinovs: Another bug has pissed me enough to start debuggin...

Another bug has pissed me enough to start debugging. This time it is Totem-xine crashing on startup in Ubuntu dapper.

The first thing is that you cann't rebuild totem from sources multiple time after ubuntu patches - ubuntu uses dpatch to patch something in automake files and after the build has been run, the unpatch fails thus preventing a rebuild, doh! Worked around that by removing that patch. (Bug not reported yet)

After installing totem-gstreamer, my main suspect is the change to the statusbar, that look very recent. Could it be that Totem developers forgot a critical fix to the xine backend? Could it be that the treat xine backend as a ... second class citizen? To what? To that GStreamer? I tried to use GStreamer, I really did, but there are a few tiny issues: 1) it doesn't open even half the files that xine does, 2) within 5 minutes of a movie audio-video can easily get out of sync by 5 seconds. I have never seen A-V sync in xine. Ever. I love telling our Windows using frends that my movies "just work" with totem-xine, please do not take that away!

Anyway - back to the bug we go.

As we have a clean crash, I recompiled totem with debugging symbols ("DEB_BUILD_OPTS=nostrip,noopt debuild -us -uc") and run with gdb. When totem crashed, I got the code line, where it happened:
(totem:4608): GLib-GObject-WARNING **: invalid cast from   ' to  TotemTimeLabel'

Program received signal SIGSEGV, Segmentation fault.
0x08068659 in totem_time_label_set_time (label=0x8199a60, time=0, length=0) at totem-time-label.c:69
69 if (time / 1000 == label->priv->time / 1000

Now, that is interesting, lets see, what we have here - time is an int, so no segfaults from there, but label is a TotemTimeLabel. Hmm, that error now makes sense. And when we take a look at label->priv, it appears to be a pointer to TotemTimeLabelPrivate with an address of 0xffffffff. That's the problem, now we only need to backtrace trough the program and find the bug that is causing that.

Well all looks pretty nice - there is a "tick" event in the player that calls the time update. Not really clear, why there is such a discrepance between GtkLabel and TotemTimeLabel or why this structure is not inicialized in time. More strange is that gstreamer backend never calls this function. Wierd. Let's see what happens if I just return from it without doing anything. Does not help - now statusbar is crashing.

Let's try it from another angle - it worked before. Nothing much in totem changed since release of breezy. Installing the version from breezy, it works fine. Recompiling the version from breezy on dapper - crashes. Ouch! It looks like xine backend of totem has not been ported to that new crazy Gnome 2.12 thingie, like gstreamer backend was. Strange - that is a backend, it should not be dependent on the frontend, no? Anyway, it is not something I can do - I will have to install the breezy version, hack some dependencies to make it no conflict with one optional library and then file a critical bug on totem for breaking the xine backend.

But even that will have to wait 'till tomorrow, sleep is of the essence, anywere.

4 December 2005

Enrico Zini: Shell gotcha

Today I was puzzled as I found out that the bash one-liner A=foo echo $A does not print 'foo'. The answer came thanks to Vorlon and Wiggy: A=foo echo sets A in the environment of the echo command, and echo $A passes the value of $A in the shell as an argument to echo. $A is expanded before the line is run and at that time A=foo hasn't been processed yet. One quick fix is doing A=foo; echo $A, but this leaves A set to foo after the execution of the command. To make it so that A is foo only when executing echo, one can use parenthesis: (A=foo ; echo $A):
$ (A=foo; echo $A); echo $A
foo
$
(note: the boring presence of "foo" in these examples should be taken as a reminder of my call for no-op words)

Next.

Previous.