Search Results: "rul"

16 June 2008

Martin-Éric Racine: Rumor has it...

...that Skype might be willing to port the Linux version of their application to Pulse Audio, as long as they get all the help they need to make this a quick and painless process. Rumor also has it that yours truly will have a visit from a Skype insider tomorrow at 13:00 EET to discuss this issue and, hopefully, be in a position to point the insider to a member of the PulseAudio community willing to guide them through this process. Rumor also has it that volunteers who contact yours truly on time to announce themselves might improve this port's chances of actually happening.

15 June 2008

Russell Coker: The Cost of Owning a Car

There has been a lot of talk recently about the cost of petrol, Colin Charles is one of the few people to consider the issue of wages in this discussion [1]. Unfortunately almost no-one seems to consider the overall cost of running a vehicle. While I can’t get the figures for Malaysia (I expect Colin will do that) I can get them for Australia. First I chose a car that’s cheap to buy, reasonably fuel efficient (small) and common (cheap parts from the wreckers) - the Toyota Corolla seemed like a good option.

A search on www.drive.com.au shows adverts for Corollas made in 1990 and 1991 for prices ranging from $3000 to $5000. Assuming some optimism on behalf of the advertisers I could probably buy one for about $2500. The current term deposit rate from the major Australian banks is just over 8%, so spending $2500 on a car (instead of having the money in a term deposit) means a loss of $200 per annum interest, if instead the car was purchased with a bank loan the rate would be significantly higher (car loans have quite high interest rates). Of course the real cost is whenever you sell a car and buy a newer one that costs more - but this is harder to estimate. The next issue is insurance, for a 1990 Corolla of the smallest engine size (as a rule of thumb the smaller the engine the smaller the insurance bill) comprehensive insurance (sans optional extras such as windscreen protection) would cost me $489 per annum, and third-party fire and theft would cost me $398. Of course those rates are for someone who is more than 25 years old and has a good driving record. The majority of people who “flip burgers” appear to be younger than 25 and would therefore pay more. Car registration starts at about $550 per annum (varies by state). Car service would cost at least $200 a year (for scheduled services). So it seems that the cost of a cheap car is around $1,350 per annum before you even drive it! Now with a car that’s 18 years old you have to expect that some parts are wearing out, including parts that make it unroadworthy and must be replaced. Assuming that $300 per annum is spent on parts and labor to repair parts that wear out seems quite conservative (especially if driving a car that costs less than $3,000 - one of the cheaper cars in that age range). That brings the total cost per year to $1,650 if you are lucky (if unlucky then expensive parts could wear out at financially inconvenient times). The amount of driving that I do is around 5,000 to 7,000km per annum (according to the ABS the average passenger vehicle was driven 14,100Km in 2005 [2]). Assuming 7.5L/100Km (one of the results that has been quoted for fuel efficiency of a car of that age) and 7,000Km of driving that would be 525L of petrol per year, at $1.70 that is $892. So at current fuel prices when driving a small car for minimal distances (either for environmental or financial reasons) the cost of petrol may be about 35% of the vehicle operating cost. If driven for the average distance the fuel cost will be about 52% of the total vehicle operating cost (which is about $3,400) - which seems like a reasonable incentive to save fuel. If someone wants to advocate measures to make cars more affordable for poor people then the first thing to consider would be a reduction in the vehicle registration fees (which are a significant part of the vehicle operating costs). Another would be government incentives for car sharing schemes (see my previous post on car sharing for details on what is on offer in Melbourne at the moment [5]), $3,400 would give 340 hours (or more with the weekend deals) of driving a shared car (including fuel) at current prices. A shared car would not be suitable for driving to work but would be good for most other car use. Also it should be noted that share cars are new and have all the latest safety features - I really wouldn’t want to be involved in a crash while driving a 20yo car. Unlike the costs of registration etc for owning a car, all the costs of a shared car will be reduced if you use it less. The tax rate for someone earning $28,579.20 is $2,850 plus 30c for each $1 over $25,000 [3], which is $3,923.76, which leaves a total after tax income of $24,655.44. Someone working 40 hours a week on the minimum income who drives an average distance will spend about 14% of their after-tax income on their car if they have a small old car and were able to buy it without borrowing money. According to the ABS the median income is actually slightly lower than full-time work at the minimum wage [4]. So it seems that there are many people who are working part-time and earning less money than they would if they worked full-time at the minimum wage. So the question for Colin is, how does this compare to Malaysia? Is someone on a minimal income in Malaysia going to spend ~7% of their after-tax income on paying insurance, tax, and basic maintenance on a car without the additional expense of driving it? How does the cost of the basic car ownership compare to the cost of fuel in Malaysia?

Pierre Habouzit: Vimperator 1.1 in unstable !

With firefox3 entering unstable, it's now possible to upload firefox3 extensions. Vimperator just entered unstable tonight, just enjoy it. For those not knowing about it, it's an excellent extension that gives to your firefox the vim look and feel. People that are already hooked to git will love it. Tiled window manager users usually love it. The best feature it has is the so called quick hints feature. Type f in command mode, to have nice labels next to every link in the page. You can type some letter, and only links that contains those letters will have the hints, and you'll see something like this (I added 'mo' after having asked for quick hints like you can see in the ruler): C

12 June 2008

MJ Ray: Warning for Webmasters: Friday 13th ahoy!

Personally, I like Friday 13th. It's usually been pretty good for me. But for this one, I won't be surprised if computer abusers are planning some big attack tomorrow. I've just spent a big chunk of my day upgrading and securing some of the websites that our free software cooperative supports for a customer. The number of attacks in the access logs is surprising - and I've been fixing other people's cracked servers for over a decade. It makes me wonder if someone is finding and recruiting exploitable systems for tomorrow. If you have a website, please check that any web applications on it are installed correctly and the latest secure versions. I've been seeing a lot of attack attempts for Joomla and WordPress in particular, even on sites which don't run them. That says something bad about either the success rate of attacks for them, or the stupidity of their attackers. In our case today, the damage seems to have been minimal (touch wood!), with the customer merely being banned from some networks for a while. It could be so much worse, like this BBC News report about Cotton Traders Card details stolen in web hack (which is part of why I suggest small online shops avoid storing credit card details on their site - leave it to the payment gateway). Finally, there are some new scams like Conmen abuse web address checks on the horizon for online shops, so make sure you've got your 3D-Secure rules set correctly by now and be cautious about sending goods before you're sure you've got the money. I think all web card payment systems are a risk, so please try to limit your risk. Update: If you do get attacked, try to help track the attackers down so we can get other results like the Jail sentence for botnet creator. I wish our governments would concentrate on toughening up blatent computer misuse law and stop tightening copyright law in secret.

11 June 2008

Obey Arthur Liu: debian.org domainsquatted ? (1)

debian.org domain squatted I was like “wtf?!”. Debian.org replaced by a link farm ? debian.org being actually domainsquatted is highly unlikely, so I started searching how this could happen. First, a little explanation of the setup : Now there are some peculiarities to the situation : Some hints : Now for the challenge : how could this happen ?

9 June 2008

Russ Allbery: Lintian and Policy updates

I'm a bit slow on the journal-writing front, but belatedly I should mention here that I did upload the new Policy (3.8.0.0) and then a quick bug-fix. If you have a trigger-enabled dpkg, you don't see that you're registering non-existent doc-base files. Lintian should catch that, but doesn't. Yet. I've been trying to find time to kick off the next round of Policy updates. There are several proposals that just need text written for them: #143941 and #241333 are obvious at this point, #416450 should be fairly simple, and I think the due diligence has been done on #470994. There are other fairly straightforward ones too. If anyone beats me to it for any of those (or even better, other bugs), I won't complain. I also closed all of the old Policy bugs that we'd tagged wontfix except for one that I forwarded to the tech-ctte. I also uploaded Lintian 1.24.0 on Saturday. This contains the first steps in a better documented and hopefully faster and cleaner way of extracting information from the lab. Rather than opening and reading files in every check that need data, there are now Lintian::Collect modules that can hold common code and cache the results across multiple different check scripts. Currently, they're not widely used, but they're now available to all checks (hence the version bump). This release also contains some truly fantastic work by Jord Polo Bard s on the web site. Look at lintian.debian.org now. It looks like a real web site! Jord is working on a Google Summer of Code project for Lintian, but it wasn't even the web pages; that was just a bonus. I'm very happy with the outcome. Lintian is still above 100 bugs and I want to start expanding the new infrastructure, so there's more work to be done, but I'm very happy with the progress lately. And it was fun to spend two days solid working on Policy and Lintian for a change, instead of lots of different work projects (or feeling low on energy and barely managing to get a handful of things done).

David Pashley: Compiled Regexes in Spamassassin 3.2

Spamassassin 3.2, which is available in Gutsy and Lenny, comes with a new feature to increase performance by compiling its regular expressions using re2c. It's very quick to enable. First, you need to install the required packages:
apt-get install re2c libc6-dev gcc make
Next, edit /etc/spamassassin/v320.pre and uncomment the line that says:
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody
Next pre-compile the regular expressions using sa-compile:
femme:/etc/logcheck# sa-compile
[18741] info: generic: base extraction starting. this can take a while...
[18741] info: generic: extracting from rules of type body_0
100% [===========================] 3293.83 rules/sec 00m00s DONE
100% [===========================] 650.12 bases/sec 00m01s DONE
[18741] info: body_0: 647 base strings extracted in 2 seconds
[snip compiler output]
make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /var/lib/spamassassin/compiled/3.002004/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
Installing /tmp/.spamassassin18741hDrlUQtmp/ignored/man/man3/Mail::SpamAssassin::CompiledRegexps::body_0.3pm
Writing /var/lib/spamassassin/compiled/3.002004/auto/Mail/SpamAssassin/CompiledRegexps/body_0/.packlist
Appending installation info to /var/lib/spamassassin/compiled/3.002004/perllocal.pod
cp /tmp/.spamassassin18741hDrlUQtmp/bases_body_0.pl /var/lib/spamassassin/compiled/3.002004/bases_body_0.pl
cd /
rm -rf /tmp/.spamassassin18741hDrlUQtmp
Finally, restart spamassassin, and you should find it runs faster. You will need to run sa-compile every time you update your rules, or they won't take effect. If you get the following warning:
Can't locate Mail/SpamAssassin/CompiledRegexps/body_0.pm in @INC
you forgot to run sa-compile; re-run it and the error should go away.
Read Comments (0)

8 June 2008

Wouter Verhelst: Whee!

 158 Ns+ Jun 04 Debian Bug Trac ( 13K) Bug#250202 closed by Russ Allbery 
That only took, eh, four years. The report started out as a "I'm sick of all these confusing and different ways to package a package, we need a solution", suggesting a few extra targets to debian/rules, but then quickly changed into a proposal to add a README.source file to the debian/ directory. At some point, early on, I started to prefer the README.source solution way more than the extra debian/rules targets thing, but the proposal reached a stalemate as some people did prefer the extra targets thing. A solution was only reached when Russ Allbery wrote a compromise proposal that managed to satisfy everyone, which he first sent out about half a year ago. Now, finally, the update is in. Which makes me really, really happy.

6 June 2008

DebConf team: Reconfirmation deadline approaching (Posted by Margarita Manterola)

June 15th is the last day to reconfirm your attendance to DebConf8. If you are certain that you are coming, please reconfirm by setting the ‘Reconfirm Attendance’ box in your PentaBarf’s account. If you have decided not to come to DebConf8, we are truly sorry about it, but we ask you to please state this by unchecking the ‘I want to attend this conference box’. Currently, 397 people have registered for DebConf8, 340 plan to attend, but only 122 have reconfirmed (live stats).

5 June 2008

John Goerzen: Obama, RFK, and Making History

I think that for the first time, when I go to vote this November, I will probably not have to hold my nose as I make a selection for president. I don't agree with Obama on everything, of course, but the core of what he stands for -- that it is time to enter a post-racial, post-partisan time -- and that putting the interests of the people before those of the corporation -- is a powerful message.

And I'm not the only one that thinks so. One interesting read is Why This 55-Year-Old White Lifelong Republican Wants Obama To Win by Frank Schaeffer. He's a pro-life, pro-military Republican that actually campaigned for McCain in 2000, and this year he's supporting Obama. He pointed out another key point: Obama does not play on our fears.

Then there's A Transformational Moment by Jim Wallis, who grew up in a time when white people that supported civil rights were literally putting their lives on the line. He ends with:

This morning I heard several interviews on NPR with black Americans about their response to Obama's nomination. One older woman said, "A black man running for president, did you hear what just I said? A black man running for president of the United States ...." She just kept repeating the words, and succinctly captured my own personal feelings.

Yes, it is truly historic, and the U.K. newspaper headlines captured that sentiment as did papers around the world. Nothing could change the image of America around the world more than this. But it is more than historic; it is very personal for many of my generation. A new generation just sees this as natural -- he's an inspirational leader who happens to be black, which matters little to them. But for my generation -- I'm dating myself now -- this is a transformational moment, one we didn't think would come in our lifetimes. Race was the issue that changed us, shaped us, determined our path, and even defined the meaning of our faith. Now a black man is running for president of the United States. Amazing grace.


Tom Hayden reflects on the similarities between Obama and RFK, another interesting read. He concludes with:

Those who denounce Obama -- and the possibilities of all electoral politics- - should ponder the effectiveness of sitting judgmentally on the sidelines while an Unexpected Future arrives through the sheer will of a new generation. They should consider whether politics and history can be reduced to a fixed determinism that is endlessly repeated, as if there are no surprises. We can have our differences with Obama's specific policies, as I certainly do, but those should be measured against the prospect that a movement might transform him even as his very rise continues to transform the rest of us.


And now for something less inspiring. If you go look over at the latest blog entry at hillaryclinton.com and read the comments, these readers frankly sound more than a little loony. There are rampant accusations that Obama "stole the election" with the help of the DNC. That makes no sense to me; he followed the rules, and the DNC gave Clinton more delegates than she should have had with the rules as they were at the start of the game (which she supported then). The Obama campaign even rejected a plan that was less favorable to Clinton at the DNC rules committee meeting on Saturday. They also go on and on about how Obama has had so many scandals (though the Clinton real estate scandals really are far more serious than a former pastor). It all looks so very petty, and I wonder why Clinton has whipped up her supporters to such a fervent extent. Perhaps it was an accident, but you'd think things like this are rarely an accident with her.

William Pitcock: Maybe I m wrong, but Python s OO seems to be broken

So, I’ve been trying to figure out inheritance in Python. In Lisp (and even C++ and Java), derived objects will have the cons of their parent called. For example, look at the following C++ snippet:
#include <iostream>
using namespace std;
class B  
public:
	B()  
		cout << __PRETTY_FUNCTION__ << endl;
	 
 ;
class A : public B  
public:
	A()  
		cout << __PRETTY_FUNCTION__ << endl;
	 
 ;
int
main(int argc, const char **argv)
 
	A *foo = new A();
	delete foo;
	return 0;
 
This outputs the following:
B::B()
A::A()
As you can tell, the parent object’s constructor is called and then your derived object’s constructor is called. But, in this Python code, the parent object’s constructor is not:
class B:
    def __init__(self):
        print "B.__init__(self)"
class A(B):
    def __init__(self):
        print "A.__init__(self)"
A()
This outputs:
A.__init__(self)
Instead you have to do:
class B:
    def __init__(self):
        print "B.__init__(self)"
class A(B):
    def __init__(self):
	B.__init__(self)
        print "A.__init__(self)"
A()
To get the right output:
B.__init__(self)
A.__init__(self)
This seems broken to me. But maybe I’m not understanding something. The way I got bit by this was by trying to design a new replacement to debian/rules which used subclassing. (More on this later.) Oh, and I intend to try to keep my blog updated more often.

3 June 2008

Marc 'Zugschlus' Haber: Serial Console Server for the Poor I

The serial port is still the way to access network components out of band. It is slow, but reliable, and remarkably well standardized. It does not have technical whiz-bangs that can fail when one needs things to just work. That makes it the natural way to access critical infrastructure and still being sure that this access vector still works when most other things are down. Every communication link has two sides, so there is a market for devices with a network link and a bigger number of serial ports to connect the actual devices to. Commercial vendors have a broad choice of serial console servers. Most of them, especially the small products with five to ten ports, are quite expensive, so I have been investigating how do build a serial console server with el cheapo hardware. USB comes to mind here, of course.
Picture of the fully equipped USB hub
The hardware side is actually quite easy: A seven-port USB hub, and seven USB-to-serial adaptors (using the widely-deployed Prolific PL2303) are easily purchased for well below a hundred Euros, and naively connected. In my test setup, connected to the hp compaq nc8000 that my blog readers should know only too well by now, the hub does not even need to have its power supply connected. The notebook can power the hub and the seven adaptors just fine. When the UMTS card is plugged in, the ttyUSBx device nodes appear in the order of plugging in the devices. When the system is booted, the order is not very predictable, so one needs - again - udev to give predictable device node names. udevinfo is an important tool to obtain the data set of an USB device which is available to match a device and to act appropriately when it is connected. udevinfo sorts the devices into a tree and shows the relationship of the devices, which device is “behind” which other device from the system’s point of view. udevinfo’s output starts at the leaf of the device tree and shows the information for each node up the tree until its root is reached. One pitfall is that one can only match against the leaf and _one_ other node more up the tree. So you cannot do matches like “the pl2303-based device connected to port 3 on hub 2-3 will be designated USBserial3”. If you try this, your rule will silently be ignored. This is a major turn-off in udev’s implementation. I didn’t try it on sid, but etch definetely shows this behavior. So one can only match like “the tty on the USB subsystem connected to port 3 on hub 2-3 will be designated USBserial3”, but that’s probably as good as it’ll get. The cause for my hub having only seven ports clearly shows itself when one looks at the udevinfo outputs of the fully equipped USB hub: The adapters are connected to ports 1, 2, 3, 4.1, 4.2, 4.3 and 4.4. The seven-port hub is actually two four-port hubs in a single case, with the second one connected to the first one’s port 4. This reflects itself, of course, in the udev rules necessary to address the adapters by the hub port they’re plugged in:
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“usb”, \
   KERNELS==“*-*.1”, \
   SYMLINK=“USBserial1”
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“usb”, \
   KERNELS==“*-*.2”, \
   SYMLINK=“USBserial2”
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“usb”, \
   KERNELS==“*-*.3”, \
   SYMLINK=“USBserial3”
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“usb”, \
   KERNELS==“*-*.4.1”, \
   SYMLINK=“USBserial4”
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“usb”, \
   KERNELS==“*-*.4.2”, \
   SYMLINK=“USBserial5”
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“usb”, \
   KERNELS==“*-*.4.3”, \
   SYMLINK=“USBserial6”
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“usb”, \
   KERNELS==“*-*.4.4”, \
   SYMLINK=“USBserial7”
These rules will only work for a similary structured hub that is directly connected to the notebook. If there are more hubs in between the “final” hub and the host, the address matched against in the KERNELS matches are going to have a different structure. In the test setup, the first two parts of the address needed to be wildcarded since these addresses keep changing when the host is booted or the hub plugged out and in. So I guess that these udev rules are probably going to fail miserably when more hubs and/or USB-to-serial adaptors are connected. But if one does not do too many changes, things are just fine, and it is possible to put numbers on the USB hub ports and be sure that the USB-to-serial adaptor connected to port 4 is going to be /dev/USBserial4 in the host system. I tried plugging in and out the adaptors in random order, unplugged and plugged the hub itself, booted the host, and the relationship between the port and the device node was stable. In the test environment, I only tested one adapter at a time, but all these tests were successful as well. I guess that many more of these adaptors will eventually need a powered USB hub, but with seven adaptors on a single hub, the power from the USB host is sufficient to live without extra power on the hub. And, I guess, there is some hard limit for the number of USB adapters being used, and some soft limit when managing the ports and adapters is going to get harder. But, I think that a site in need of more than, say, sixteen serial ports on the console server can afford a “real” console server from one of the major vendors, which can be accessed via ethernet, UMTS, ISDN and whatever you can think of. This concludes the hardware part of my serial console server for the poor. Tomorrow, I’ll blog about the software side needed on the host to allow the serial ports to be accessed from the network while still being reasonably secure. The next article will involve ssh, /etc/passwd shells, /etc/shells, a small perl script, ser2net and telnet. And, shell escape is the cue word for grey hairs sprouting on my head.

Marc 'Zugschlus' Haber: Works with a more recent card as well

Today, I had the opportunity to try my UMTS initialization mechanism that I built this weekend with more recent hardware, a newer Option Globetrotter 3G Express Card with Vodafone branding (reporting itself to be a “Globetrotter HSDPA Modem” with Vendor ID 0xaf0 and Product ID 0x6701). To get the card connected to my test Notebook, a hp compaq nc8000, I had a “Expresscard in a PC card slot” adapter and a passive “Expresscard at a normal USB port” adapter. The USB adapter had cost about ten Euros, and I don’t imagine the PC card adapter to be much more expensive. The later Option card is recognized as three USB-connected serial ports by the Option kernel driver (CONFIG_USB_SERIAL_OPTION) as the older one is, and it works just fine. The only difference is that the udev rule needs a different value for the ATTRS modalias setting. My umts-pin script complains about an “illegal seek” after entering the PIN, but the card registers itself with the network nevertheless. Both gammu to send SMS and pppd for IP connectivity worked out of the box. Especially the “Expresscard-to-USB” adapter setup is very sexy for setups where neither an Expresscard nor a PC Card slot is available, and USB cables can be nice and long. So one could even mount the UMTS interface near the window and pull a longer USB cable to the actual system. I decided on putting the UMTS interface into a notebook, though, and mount the notebook near the window to be able to monitor the monitoring systems and send out SMS even when the whole datacenter is without power (by virtue of the notebook having a built-in UPS).

1 June 2008

Marc 'Zugschlus' Haber: Automatic initialization of a Option 3G Datacard

For mobile UMTS/GSM, I have been using an Option 3G Data Card for two and a half years now. I blogged about getting the card to work (in German, sorry) on Linux in July 2005. I never found the time - until now - to automate the card initialization so that I had been using a horrible chat script for card initialization when the PPP connection was built. I recently took the time to automate this, so that the PIN is transmitted to the card automatically when the card is plugged in. This article documents what I did. On a side note: Unfortunately, the vendors’ attitude towards Linux hasn’t changed since 2005. Their Hotlines still deny that their products can be used with Linux at all, and they surely do not publish any documentation that can be of help. Otoh, Vodafone has published a software that supposedly aids usage of their products under Linux. I haven’t tried it yet since it is not packaged yet for Debian. Additionally, Vodafone support media and sales do not seem to know about this effort, they still deny that their products work with Linux. Windows users happily install proprietary software products that do little more than sending a handful of AT commands to the emulated USB modem and hand over the connection to Windows’ PPP Stack. A very unsatisfying situation. Just for the record: Dear Vodafone DE, a week ago you missed the sale of a new USB UMTS interface because you don’t even document it on Linux. This motivated me to look into the drawer that holds the old, non-HSDPA PC cards that have been decommissioned at the customers’ site and use an old, used device. Your fault. But now back on topic: For a data center monitoring system, I want to send out alerts as text message (for German speakers: SMS - we have a rather strange vocabulary for mobile communications), and am reluctant to do so via IP: IP is one of the things that can fail, so it is preferred to directly inject the text messages into the network of the operator that provides service to the recipients of the text messages. Fortunately, most of the recipients are in the same network. After evaluating current hardware solutions that could be plugged directly into the “real” server doing the monitoring and running into the wall of non-support provided by the network operators and hardware vendors, I decided on taking things a little further and to build an Ethernet-Connected text message device. An old hp compaq nc8000 (no, not mine, mine still works fine and is in daily use) and an old, first generation Option Datacard 3G will be mounted near the datacenter’s windows and equipped with Debian and Nagios. That way, the text message device can itself monitor the monitoring system and even send out a warning message when the data center goes out of power: It has a built-in UPS. But now back on topic: For the text messages to go out reliably, it is necessary that the UMTS card is initialized automatically when the system comes up. A great opportunity to finally address this issue for Linux, on customers’ expense **grins**. UMTS card initialization is done in two steps: First, when the card is plugged in, the virtual OHCI host port appears. Initialization of the virtual OHCI happens automatically. Most documentation on the web says that you now need to load an appropriately parametrized usbserial module, and I did it this way for years, but that’s not necessary any more. CONFIG_USB_SERIAL_OPTION is a dedicated kernel module for the Option 3G data card, which gets automatically loaded if it is available. If you don’t have the Option module for some reason, you still need the following udev rule to automatically load the generic USB serial module. I figured that out yesterday before I learned about the Option module in a comment made to the original version of this article.
SUBSYSTEM==“usb”, \
   SYSFS idProduct ==“5000”, SYSFS idVendor ==“0af0”, \
   ACTION==“add”, \
   RUN+=“/sbin/modprobe usbserial vendor=0x$attr idVendor  product=0x$attr idProduct ”
SUBSYSTEM==“usb”, \
   SYSFS idProduct ==“5000”, SYSFS idVendor ==“0af0”, \
   ACTION==“remove”, \
   RUN+=“/sbin/modprobe -r usbserial”
Unfortunately, the usbserial and option modules stay around after the card is pulled. This doesn’t hurt though. Next, we see three virtual serial interfaces, which we can detect via udev, and assign “speaking” device names and transmit the PIN. This goes into /etc/udev/rules.d/50-option3g.rules:
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“option”, \
   ATTRS bInterfaceNumber ==“00”, \
   ATTRS modalias ==“usb:v0AF0p5000d0000dc00dsc00dp00icFFiscFFipFF”, \
   SYMLINK=“UMTS-DATA”
SUBSYSTEM==“tty”, SUBSYSTEMS==“usb”, DRIVERS==“option”, \
   ATTRS bInterfaceNumber ==“02”, \
   ATTRS modalias ==“usb:v0AF0p5000d0000dc00dsc00dp00icFFiscFFipFF”, \
   SYMLINK=“UMTS-CONTROL”, RUN+=“/usr/local/sbin/umts-pin --device %k”
I am not sure what the modalias attribute identifies, but it looks like it identifies the hardware model: An identical Option Datacard 3G, plugged into the other PC Card Slot gets properly initialized as well. These two udev stanzas do two different things: First, they make sure that the new devices are symlinked to /dev/UMTS-DATA and /dev/UMTS-CONTROL, suggesting the intended use of the interface. The second virtual interface of the 3G Data Card does not seem to be useable at all, and you cannot build an actual data connection over the third. So, we baptize the first interface /dev/UMTS-DATA and ignore the second. The third gets called /dev/UMTS-CONTROL. Now to the real magic: /usr/local/sbin/umts-pin is a perl script that sends the PIN to the Card. %k gets expanded to the device name of the device that has just been detected, so umts-pin gets called with “--device ttyUSB2”. It makes use of Cosimo Streppone’s Device::Modem module (Device::Gsm is not yet packaged for Debian and might be of better use here) to talk to the UMTS device. Unfortunately, I have not yet fully understood the logging and answer processing features of Device::Modem, so the implementation might look a little clumsy. I hope that it can be clearly understood anyway. The actual PIN is read from a configuration file in an apache-like format, which is by default looked for in /etc/umts/pin.conf:
<pin>
        <default>
                pin xyzw
        </default>
</pin>
The reason I settled for this rather complex configuration file format is that the ultimate goal is to automatically detect which of my SIMs is currently inserted in the UMTS card and to automatically send the correct PIN. I haven’t been successful in doing so since I didn’t find an AT command yet to get the UMTS card to divulge the SIM serial number or the IMSI before the PIN is transmitted to the SIM. So currently, the only things that are supported are the “default” stanza and an identically formatted “override” stanza which takes precedence over the default stanza if present. If the first attempt to send the PIN fails, the script tries again ten seconds later. On my test system, this happens about once in twenty times. That must be some weird timing issue. So, if you have the wrong PIN configured, you’ll need the PUK after plugging in the card for the second time, since the first try will eat two of your three attempts. Beware. If you feel uncomfortable with all this scripting and the “quality” of my code, you can also use gammu’s entersecuritycode function. I discovered this after my PIN script was already written, and gammu currently forces you to expose the PIN on the command line (see #484102), and of course my script’s PIN handling is vastly superior **grins**. And one end note: More current hardware, most notably the Huawei series of cards, are reported to show themselves as virtual USB storage first to allow identification and installation of Windows drivers, and need an explicit command to show their virtual USB serial side. I have read web pages where people have managed to do this in Linux, but since I use an older card and do not have a current card available (again, Vodafone, your fault!) I cannot comment about this. But there are reports that this can be done, so don’t panic if you have more recent hardware.

31 May 2008

Kyle McMartin: it s like a party in my compiler, and i wasn t invited

I’ve spent more or less the last few days of spare time trying to figure out why gcc-4.3 built kernels were so unhappy on parisc. Basically the symptom was that any IPv4 networking operation would only complete once and a while, for example, ping would drop 90% of packets. This turned out to be a really troublesome bug to track down, and the fix was only 7 characters long. gcc-4.2 wasn’t problematic, so that provided an interesting base. A bit of thinking ruled out some obvious parts of the kernel that would likely not be an issue. For instance, ARP appeared to be fine, so it likely wasn’t an issue at the network driver level. So rebuilding net/built-in.o on gcc-4.2, copying it to the gcc-4.3 tree, and rebuilding the tree using it resulted in a working kernel. Ok, excellent, we know it’s likely an issue in net/, what else can we rule out, and what do we know? ICMP is affected, so it’s probably not a TCP problem… Rebuilding the kernel with IPv6 enabled, and testing ping6? Ok, works. So it looks like an IPv4 issue. Test that assertion… yup, net/ipv4/built-in.o compiled with gcc-4.2 works. Ok, peachy. What now? Bisecting the contents of the directory results in ip_output.c being the problematic file… Not all that helpfully, the differences between the code generated by 4.2 and 4.3 are extensive. Well, ok, let’s try turning off a variety of the added compiler options… nope, no luck, but the file works when compiled at -O0. Next, I bisected the file until I found the problematic function (unfortunately for me starting in the middle, it ended up being the first function in the file.) Which was in a chain of inline functions, eventually calling some architecture specific inline assembly for ip_fast_csum. Ok, that looks like our canary in the coal mine… Look it up… SIGH. The routine touches memory, but didn’t have “memory” in the list of clobbers. Adding the clobber and everything magically works again. Wasn’t that a party? [ Of course, this makes things sound almost easy, except that at around 10 minutes to boot a test kernel, reboot, and boot a working kernel, this gets extremely tedious. I also didn't bother to talk about how many hours I probably wasted twiddling compiler flags trying to figure out which optimization pass might be broken... ]

Matthew Garrett: Personality modification through perl

One of the downsides of writing my thesis last year was that focusing on a technical subject for approximately 16 hours a day left me almost entirely unable to relate to people. The irony in this is that losing the ability to socially relate tends to result in you assuming that you're fine and everyone else is just behaving bizarrely, which makes rectifying the situation rather difficult. In an attempt to avoid this I have written some software, because dealing with the symptoms of a problem is always better than dealing with the root cause and technology is always the appropriate solution to social issues.

The aim was to send myself an email once a week that I'd actually have to read. This is achieved by running the script with the generate argument. This sends an email with an appropriate reminder message (something along the lines of "Are you sucking? Really? Are you sure? Is everyone around you suddenly getting annoyed at you for no obvious reason?", and so on) and a bunch of embedded characters randomly spread throughout it. Running the script with the check argument will send the email again if a valid response hasn't been received. Those can be stuck in cron. The final part is to add a procmail or whatever rule that passes replies back to the script with the validate argument. These replies should include a line containing all the embedded characters (order doesn't matter, but if there are multiple occurances of a character than the reply must include that number of occurances). If a valid reply is received then no further emails will be sent until the script is run with the generate argument again.

Also: My perl sucks.

30 May 2008

Cyril Brulebois: Blender 2.46 in experimental

Just a quick word: Blender 2.46 has been uploaded to experimental a week ago, and is available on the following architectures:
$ rmadison -s experimental blender
blender   2.46+dfsg-1    experimental   source, alpha, amd64, i386, ia64, mipsel, powerpc, s390
The move to unstable is planned once ftgl 2.1.3 has been released and uploaded to unstable. This release s highlight: Big Buck Bunny, as seen on the splash screen: Blender 2.46 - splash screen

28 May 2008

Russell Coker: Xen Hosting

I’m currently deciding where to get a Xen DomU hosted. It will be used for a new project that I’m about to start which will take more bandwidth than my current ISP is prepared to offer (or at least they would want me to start paying and serious bandwidth is expensive in Australia). Below is a table of the options I’ve seriously considered so far (I rejected Dreamhost based on their reputation and some other virtual hosts were obviously not able to compare with the prices of the ones in the table). For each ISP I listed the two cheapest options, as I want to save money I’ll probably go for the cheapest option at the ISP I choose but want the option of upgrading if I need more. I’m not sure how much storage I need, I think that 4.5G is probably not enough and even 6G might get tight. Also of course it depends on how many friends I share the server with. Quantact has a reasonable cheap option for $15, but the $25 option is expensive and has little RAM. Probably 192M of RAM would be the minimum if I’m going to share the machine with two or more friends (to share the costs). VPSland would have rated well if it wasn’t for the fact that they once unexpectedly deleted a DomU belonging to a client (they claimed that the bill wasn’t paid) and had no backups. Disabling a service when a bill is not paid is fair, charging extra for the “service” of reenabling it is acceptable, but just deleting it with no backups is unacceptable. But as I’m planning on serving mostly static data this won’t necessarily rule them out of consideration. It seems that linode and slicehost are the best options (Slicehost seems the most clueful and Linode might be the second most). Does anyone have suggestions about other Xen servers that I haven’t considered? XenEurope seems interesting. One benefit that they have is being based in the Netherlands which has a strong rule of law (unlike the increasingly corrupt US). A disadvantage is that the Euro is a strong currency and is expected to get even stronger. Services paid in Euros should be expected to cost more in future when paid in Australian dollars, while services paid in US dollars should be expected to cost less. Gandi.net has an interesting approach, they divide a server into 64 “shares” and then you can buy as many as you want (up to 16 shares for 1/4 of a server) for your server. If at any time you run out of bandwidth then you just buy more shares. They also limit bandwidth by guaranteed transfer rate (in multiples of 3Mb/s) instead of limiting the overall data transferred on a per-monthly basis (as most providers do). They don’t mention whether you can burst above that 3Mb/s limit - while 3Mb/s for 24*7 is a significant amount of data transfer it isn’t that much if you have a 200MB file that will be downloaded a few times a day while interactive tasks are also in progress (something that may be typical usage for my server). Of course other providers generally don’t provide any information on how fast data can be transferred and will often be smaller than 3Mb/s. Also if anyone who I know wants to share access to a server then please contact me via private mail.
ISPRAMDiskBandwidth (per month)Price $US
Linode360M10G200GB$20
Linode540M15G300GB$30
Slicehost256M10G100GB$20
Slicehost512M20G200GB$38
VPSLand192M6G150GB$16
VPSLand288M8G200GB$22
Quantact96M4.5G96GB$15
Quantact128M6G128GB$25
rimuhosting96M4G30G$20
XenEurope128M10G100G$16 (E10)
XenEurope256M20G150G$28 (E17.50)
Gandi.net256M5G3Mb/s$7.50 or E6

27 May 2008

MJ Ray: Bristol and Bath Perl Mongers

The first meeting of the new Bristol and Bath Perl M[ou]ngers is tonight (Tue 27th) at 7pm, according to this mailing list post. Despite their rules, I've already been well-flamed by one member, so it will be interesting to see what sort of group it becomes. Hopefully the flamers are nicer in real life.

24 May 2008

John Goerzen: How to Start Bicycling to Work

Yesterday, I wrote about bicycling to work, pointing out that it's a safe, inexpensive, way for many people (including office workers without access to showers) to get to work. There were a lot of thoughtful comments there too.

Today I'd like to provide some tips for getting started commuting on a bicycle. As I'm just getting started on this, these are mainly things I've learned from poking around online, so I'll be including lots of links.

The Bicycle

This varies from person to person, but as a general rule: if you have a very short ride -- say a mile or less -- you can probably just use any old bike and a bicycling helmet. Don't try to use a motorcycle helmet. It won't vent your head, so you could overheat. Also, it won't be comfortable.

Most people will have a longer ride and will want to get a bike that works specifically for them. Each model of bicycle comes in different frame sizes. It's important to get a bicycle that is the right size for you. Also, you'll want to get a quality bicycle that will let you be fast and won't break down along the way.

For all these reasons, I -- and every single other person I've ever seen talk about this -- highly recommend that you buy your bicycle from a bicycle shop. Don't buy a bicycle from a "big box" store like Walmart or Target. They may be cheaper up front, but you'll pay for it in the long run because they won't last as long, won't fit you as well, and may even be unsafe. Bike shop staff will help you find a bike that fits you, which is important for avoiding aches and pains and even injury. They'll be able to help you find appropriate accessories for your bike, as well as repair it. Here is a helpful article on this topic, written by a bike shop.

Generally speaking, bike shops can repair bikes bought at any other bike shops. However, they can instantly recognize bikes bought at big box stores. Many will repair those too, but some refuse to work on some of those bikes on the grounds that it is impossible to bring them to the level of service they expect their mechanics to do.

Aches and Pains

With any sport, when you start it, you can expect a little bit of aches and pains at first, as you start using muscles that you may not have really used at first. Bicycling is no exception, but it's easy to deal with.

Your first stop if you have aches and pains might be the where does it hurt page. It provides detailed, helpful advice. There are also some common things that go wrong for people.

First on the list is wrong size of bike or improper adjustment of your bike. You want a bike frame that is the right size for you, and you want the seat and handlebars adjusted properly for you. A bike shop can help you get this done easily. If your feet can reach the ground while you're on the seat, you almost certainly have the seat too low, which is a common mistake.

Sometimes the way you position yourself on the bike, or your technique, could be to blame.

Also, clothing can be a problem. A good place to start here is with some cycling shorts. Another common complaint from new cyclists appears to be blisters on the feet. This can be caused by improper positioning on the pedals, or by using the wrong type of sock. Typical socks absorb moisture and trap it next to the skin; bicycling socks will wick it away and let it evaporate. In fact, cycling clothes: socks, shorts, and jerseys (shirts) are all designed to wick moisture away from you and let it evaporate, which keeps you cooler and more comfortable. Bicycling gloves are cheap and can help your hands stay comfortable.

Expense

You can easily save thousands of dollars by riding a bicycle instead of driving a car. Bicycles do need periodic maintenance, just like a car. Usually you can do a lot of that yourself. It probably will pay off to take your bike in to the shop for an annual tuneup. If you have no bicycling equipment at all, and buy your equipment at a bike shop new, you can probably get started for around $500. Even that will probably pay for itself in less than a year if you average riding your bike at least a few times a week.

Safety

Safety on a bicycle can usually be summed up with three rules: be visible, be predictable, and ride with traffic.

Unless there are dedicated bicycle-only lanes or paths, the safest way (in the United States) to ride your bike is on the road, riding with traffic (acting like a car). Don't ride on a sidewalk, and never ride against traffic. This may sound counter-intuitive, but it is backed up by solid research. It all has to do with being predictable. Nobody is looking for something the speed of a bicycle to emerge from a sidewalk to cross a road or driveway. Sidewalks often aren't that visible and frequently don't provide enough room to pass. Sidewalk-riding cyclists get into accidents all the time with cars backing pulling out of driveways, making turns, or even just driving down a road where the cyclist cuts in front of them to cross a street.

A great book for learning how to ride in traffic can be viewed free online: the Bicycling Street Smarts book. There are also some safety videos online that are helpful.

Staying visible is certainly important. In some places, like cities where cyclists are common, drivers are going to be on the lookout for you already. In my case, I'm riding on rural roads that have some hills, where cyclists are rare, so I'm putting extra effort into this.

Staying visible in the day or at night starts with high-visibility clothing. A "screaming yellow" jersey or an ANSI safety reflective vest (less than $10) are good ways to do that. Several people recommend a Cateye TL-LD1100 flashing tail light for use at night, or even for daytime use when visibility is critical (such as my situation). If you will ever ride at night, laws require you to have the proper reflectors on your bike. And, you must also have a white headlight that does not cover up your front reflector (in some locations, you may also be required to have a red tail light that doesn't cover up your reflector). Companies like Cateye carry those products as well.

Other tips: avoid drainage covers; they sometimes have slats that a bicycle tire could fall into.

Accessories

Here are some suggestions you might consider as a commuter.

Start with pannier bags. They mount over your rear tire and are cooler for you than a backpack because your back can still breathe. They're more aerodynamic than a front basket. You can get bags suitable for carrying papers, laptops, a change of clothes, etc.

Next on your list might be a bicycle lock, to help keep it from being stolen. Your local bike shop can make suggestions here.

You might want to consider a spare inner tube (about $5) and tire-changing tools (also about $5) to carry with you in your bag. You wouldn't want to have to walk 5 miles if you get a flat.

Along with that goes an air pump. I suggest a frame pump -- it's a small pump that can clip on to your bicycle's frame, so you always have it handy. Obviously you will need this if you have to change a tube, but it could be handy even if you don't.

You can find some more suggestions from bicycling.about.com and from Mike or your local bike shop.

Where to buy

Besides your local bike shop, you can buy a lot of accessories online. I wouldn't suggest buying a bicycle online, because you really want to get a good fit at a bike shop.

When I asked at bikeforums.net, readers suggested three online stores:

www.pricepoint.com
www.bikenashbar.com
www.performancebike.com

You can also find some bicycling accessories at general-purpose stores like Amazon or sporting goods stores like REI. I personally wouldn't recommend local "big box" sporting goods stores any more than I would Walmart or Target for this stuff, though.

More info

For more information, check out my bicycling links at del.icio.us.

Next.

Previous.