Search Results: "mpalmer"

25 May 2007

Matthew Palmer: The Real Reason Software Sucks

Although I feel that The Daily WTF has gone downhill in the last few months (since the rename and addition of different "categories" of story), today's article titled The Great Pyramid of Agile is a good, thought-provoking read. I've tried to find a good "sound bite" quote that really captures the message of the article, but the whole article meshes together a bit too tightly, so just trust me when I say "go and read the article".

17 May 2007

Matthew Palmer: The Security Theatre's Sydney Tour

In addition to whatever other stupidities and inconveniences our elected "representatives" foist upon us for the pointless APEC summit, they're now also going to take away our mobile phone reception. I'm in favour of these devices, particularly if I can get one I can carry in my pocket. However, for the purposes of protecting foreign leaders (I'm not going to use the term "dignitary", since Dubya is in no way dignified), this thing is useless. All a bad guy has to do is make a bomb with an area of effect big enough to cover a football field, and make it trigger when it can't talk to the mobile phone network. When the mobile network goes away, you know that your target is close. Not to mention the fact that mobile phones aren't exactly the only radio transmitters out there -- a remote central locking key fob is an equally useful bomb detonator. Sigh. At least Sydney apparently gets a public holiday on the day of the APEC summit. I haven't confirmed this; my wife was just depressed last night about how she didn't get the holiday because she doesn't work in Sydney.

15 May 2007

MJ Ray: AD'SL: Telco's that 'Suck

I notice that Brane Dump: Wanted: A Telco That Doesn't Suck is roughly where I was a couple of years ago, when BT were raising the line rental and including "free" minutes that I didn't use. I do wonder how you put grocer's apostrophe into Southern Cross. Southern Cros's? sdf commented:
"i guess they mean they don't use traffic shaping to restrict speed on the usual p2p-ports"
Maybe, but is that within the retail ISP's control or would it be done by the network provider?

Matthew Palmer: If You Find Those PC/Mac Ads Annoying...

Then you may enjoy this gem of a comic. Personally, they were entertaining to begin with, but some of the recent ones actually have me wanting to kick that Mac guy in the head, and I'm starting to feel a bit of pity for the PC. That's scary. Oh, and anyone who points me to the Novell Linux/PC/Mac ads gets scowled at. They really suck.

14 May 2007

Matthew Palmer: Wanted: A Telco That Doesn't Suck

I am currently with Optus, and while they were acceptable a few years ago, they have descended in the last couple of years so that they're chair-throwingly obnoxious now. So, as I really, really dislike giving retarded monkeys my money (I'd get rid of govco if I could, really), I'm looking to move. Specifically, I want a telephone communications provider: ). Do I really have a hope in hell here? At this point, I'll pay a bit more for phone service if it doesn't involve getting screwed over at the telco's whim, and dealing with incomprehensible Indian call centres. Answers on a postcard, or (if you're feeling really technical) in an e-mail to mpalmer@hezmatt.org. We're talking about Australia here, in case anyone's wondering -- moving to another country for phone service is probably a bit too drastic. Switching to pure VoIP would be an option if I didn't need to have a fixed-line service for my ADSL.

Matthew Palmer: A Lesson In Critical Reading

Yes, Microsoft have started swinging their patent bat a little harder. However, before everyone gets all screamy about the "235 patents" thing, read a little closer:
the Linux kernel [...] violates 42 Microsoft patents. The Linux graphical user interfaces - essentially, the way design elements like menus and toolbars are set up - run afoul of another 65, he claims. The Open Office suite of programs, which is analogous to Microsoft Office, infringes 45 more. E-mail programs infringe 15, while other assorted FOSS programs allegedly transgress 68.
While I can forgive a journalist the sin of not knowing the difference between Linux-the-kernel and Linux-the-entire-FOSS-ecosystem, can people who should have a clue about this please stop perpetuating the inaccuracy? Yes, 42 patents is still pretty bad, but it's not 235, and getting facts straight is what we do on this side of the debate -- the frothing and bullshit is what the other guys do. Once you start looking at the various categories of patent, it really does make it obvious that there's some straw-grasping going on here. If GUI elements really infringe on 65 Microsoft patents, it seems reasonable to assume that KDE and Gnome have a subset each, so presumably nobody gets the full brunt of that lot. Also, those 68 "assorted FOSS programs" patents probably includes such widely-used classics as this pearler of a program (chosen at random from Freshmeat for it's likely small userbase; no other ridicule is intended or implied). What galls me, though, isn't the bandying around of random inaccurate numbers, it's classy things like this:
[some Microsoft sock-puppet] refuses to identify specific patents or explain how they're being infringed, lest FOSS advocates start filing challenges to them.
Yeah, we'd hate it if the patent system were at all used in the manner in which it were intended. I don't suppose anyone else is getting SCO-style "we've got 100,000 lines of infringing code, but we're not going to tell you which ones" flashback at this point? Personally, I think that if Microsoft ever does starts with a patent smackdown, it won't be 235 patents, it'll be two or three, the strongest ones they can find, and 90 minutes after the plaintiff(s) is/are served the infringing code will be history, and we'll go back to living our lives as normal. That's even assuming that the patents are legit, which is by no means a given (even with the US' insanely broad patent provisions). As the linked article explains, the US Supreme Court has started getting a bit noisy on the subject of over-broad and pointless software patents, so perhaps Microsoft is just getting it's licks in before the Supremes take it's noisy rattle away from it. There's some side-commentary on this issue at Groklaw, and the Patent Law blog has a quick mention of it too (with all sorts of nice frothy comments, to boot).

2 May 2007

Matthew Palmer: Cool Ruby Feature: A Hash With a Dynamic Default

 h = Hash.new    h,k  k*k  
 
 h[1] = 42
 
 puts "1 => # h[1] , 2 => # h[2] , 3 => # h[3] "
Produces:
 1 => 42, 2 => 4, 3 => 9
It's weird little things like this that make me really love Ruby.

2 February 2007

Matthew Palmer: Why Security Is So Hard

Recently, I was doing a conversion of CFEngine configs to Puppet manifests. I noticed this line being set in sshd_config:
 AllowGroups foo bar baz xyzzy
And then somewhere else, the www-data user had been added to the baz group, so that the webserver could write to some files owned by the baz user (on a group-per-user system, naturally). Ordinarily, you wouldn't connect these two things (the changes most likely having been made months apart), and it was only that I was examining all of the changes made to the system in this manifest at once that I connected the two things at all. There are a couple of ramifications here: I don't know whether the problem is excessive complexity and hence the risk of unintended consequences, or if problems like this can be avoided with sufficient careful thought, but I do know one thing: making all of your system changes through a system like Puppet doesn't just make your systems more reproducible, it also makes them more auditable. Bonus!

23 December 2006

Matthew Palmer: Miss Manners' Guide to Porn at the Office

A few little style tips, provoked by a recent observation. In general, it's not a good idea to view porn at work. There's a very large ick factor there. If you must, however, please observe a few simple guidelines. Specifically, don't view porn:
  1. while the office is still populated with people who may not share your tastes;
  2. if your monitor is visible to most of the rest of the office;
  3. if your monitor is visible from the main corridor for the office;
  4. on your giant 24" widescreen Dell monitor.
The only thing I'm thankful for is that the computers at this place don't come with external speakers.

14 December 2006

Matthew Palmer: Could You Pass the 8th Grade in 1895?

In case anyone is in doubt about the degradation of educational standards over time, I present to you the 8th grade "final" exam for Saline County, Kansas, for April 1895.

11 December 2006

Matthew Palmer: We Are Living In a Computer Simulation

Or, more accurately, this is what you get when you watch The Matrix while sucking down bottles of Nitrous Oxide. (Thanks to Two Second Memory for the link)

6 December 2006

Matthew Palmer: I Have Problems With REST

Not being one to stick with what I know, over the last few days I've been trying to put a RESTful sheen on a small app I'm toying with. It's quite simple -- there's really only one type of resource I need to deal with, and I've got a solid URI structure to refer to it all. So far, so good. I've read all the theoretical stuff about how URIs should be nouns, and the HTTP action should be the verb -- and I agree with the sentiment, at least for this system I'm writing[1]. I can even (I think) model all of that stuff using my framework of choice, the ever-hyped-but-good-despite-that Ruby on Rails. There's even fairly explicit support in Rails for a lot of what I want to do, with automatic Content-Type: and Accept: handling logic built-in. But this thing is, primarily, a web app, not a web service. I want the RESTful thing so I can interact with the app programmatically, but at the end of the day, I expect most interactions will be via the good ol' HTML. How, then, do I implement my HTML interface so that my user's browser does the right thing with my resources? My REST resource http://example.com/widgets/1337 will do the right thing if an appropriately-credentialled user issues a DELETE /widgets/1337 request, but how do I tell a browser to do that? The "traditional" way I've done that sort of thing, in Rails, is to encode the verb in the URL, like so: /widgets/delete/1337, but I completely agree with the idea that a GET request shouldn't modify data[2]. So I'm completely sold on the idea of not encoding actions into the URI itself. I'm also a DRY[3] kind of guy, and one of the things that has always slightly irritated me about web services is that, when you write them alongside a HTML-oriented webapp, you often have to duplicate logic (even if it's not very much) to get both versions working. Considering that both the webapp and the REST service are using URLs in pretty much the same fashion, it seems very wasteful to have to design two subtly different schemes to handle the two nearly-identical sets of requirements. So, having written this article without managing to figure the answer for myself, I invite comment (sent to mpalmer@hezmatt.org, and I'll summarise later). How do I tell a user's browser to issue a DELETE or PUT against a URL? Am I being overly idealistic to expect the two access methods to be somewhat comparable? Should I just give up and encode the action I want in my URL, or maybe the parameters to the POST request? Am I even completely misunderstanding REST, and trying to find answers in it that just aren't there?
1. I have some slight qualms about the idea that every possible interaction with any possible system could be modelled using an unlimited noun set and four verbs, but I'm happy to leave that debate alone for the moment, as I don't have anywhere near enough experience to speak intelligently, and I have more basic problems at the moment anyway. 2. I remember the common story of the website where the 'delete' hyperlinks are regular GET requests, and the first Google spidering of the website causes everything to be deleted, resulting in a very bare database. This is a result I'm keen to avoid. 3. Don't Repeat Yourself -- a phrase that should be tattooed on the inside of every developer's eyelids.

4 December 2006

Matthew Palmer: Automatic Ordering Systems

Reading about Jamie Zawinski's problems with purchasing plumbing parts (look for 'side-outlet elbows' and read until 'Construction'), I started wondering about the automatic ordering system that shop used. To compensate for the obvious stupidity in the staff, I wondered whether their ordering computer might have a system of automatic adjustments for stock re-ordering quantities. Then I wondered what the thresholds might be to increase the per-restock quantity. Finally, I entertained myself with the idea that, just maybe, jwz's rampant purchases triggered the stock computer to put in an order for some huge number of 4-way pipe joints, which then sat in stock for years and years, because the average consumption rate for those pieces is probably a hell of a lot less than the 10-per-week that the computer saw over the month in question.

1 December 2006

Matthew Palmer: The Patron Saint of Modern Computing

Piero Manzoni should be canonised as the patron saint of modern computing. "Who the hell is Piero Manzoni?" I hear you all say. Well, he was an Italian artist whose work included the act of producing and selling cans of "Merda d'Artista". The Tate gallery bought one of the cans a few years ago, for more than the cost of the same weight of 24 carat gold. According to the above article, "At least 45 of the original 90 cans have exploded, however. This is exactly what Manzoni intended.". As Bill Harzia puts it (in a forum which will not be named), "He was the first to sell overpriced shit, of no practical value, that could fail at any moment, to unsuspecting suckers." That really sums it up, doesn't it?

28 November 2006

Matthew Palmer: You Know That Sinking Feeling You Get...

... when you suddenly realise that you've done something really dumb and there's probably no way to fix it? I just got that feeling, big time, reading today's DailyWTF. And I had nothing to do with the problem whatsoever. My commiserations to the poor sods actually involved in the story.

Matthew Palmer: VLAN adventures

Have you ever had a need for a large number of "real" network interfaces on a Linux box? For security reasons, you don't just want to hook everyone up to a single switch and use virtual interfaces (because it's too easy for one of the connected devices to play silly buggers with his neighbours). Up to a certain point, you can stuff more NICs into a box, and when it fills up you can switch to those outrageously expensive 2- and 4-port NICs. But eventually you're going to run out of space[1] or money. At that point, you need something more interesting. For me, this week, that "more interesting" has been Ethernet VLANs. Linux Journal has a good intro to the technical aspects of how to setup VLANs and Linux. VLANs are some crazy stuff. They're implemented by wrapping a little number around every Ethernet frame indicating which VLAN the packet is "on", and the switch (you need a higher-end device, appropriately configured) makes sure that packets don't roam onto ports they're not meant to be on. For a single switch, this isn't very interesting, and you don't really need an IEEE standard to make it work -- just a lot of little jumpers. However, VLANs are mostly useful on larger networks, which tend to use more than one switch. So you need a way for your VLANs to roam amongst your switches -- hence the packet tagging. You stick the tag onto the packets and fling them off to another switch, and packets coming in with the tag are corraled into their VLAN. Naturally, you don't want end-user devices whacking their own VLAN tags onto packets (untrusted data, and all that), so you define most of your ports as being "untagged". Packets that come in on these ports are treated as regular ethernet frames and tagged with the appropriate VLAN ID, and packets that go out have their VLAN IDs stripped before being sent. (This implies that you can tunnel VLANs in VLANs, and I'm pretty sure that is doable in most switches, modulo some nasty problems that can, and probably will, occur). The ports that aren't designated "untagged" spit out tagged packets -- and this is where my interest lies. Like most every other computer-related standard, Linux can decipher and work with VLAN tags (the 8021q module is what you're looking for). You just load up the module, hook your NIC into the appropriate port on your very expensive switch, define your VLAN tags with vconfig, and suddenly you've got vlanN interfaces, which map to real RJ-45 ports, and you can hang network devices off these and get lots and lots of "real" network interfaces on your Linux router. It's all so simple, right? Nothing ever is, of course. The trials and tribulations I've had over the past two days have included: Thankfully, once all those dramas were done, the whole thing just kind of fell into place, and now I've got a machine which has up to 2048(ish) network interfaces (with huge, glaring caveats on that upper bound, of course). With a bit of luck, the live installation in a couple of days will go smoothly. You can stop sniggering now.
1. In this case, there wasn't a lot of space to begin with, as it's a 1RU box I'm working on, and the 4-port NIC didn't want to place nice with me for some reason anyway.

Matthew Palmer: A Very Creepy Story

Some of the 365 Tomorrows stories are a bit lame, but when they get a good one, it's really good. "Best Friends" is definitely in this latter category.

26 November 2006

Matthew Palmer: When Open Classes Attack

(... or "Why Cut-and-paste coding is a bad idea", part $bignum) I've just spent an embarrassingly long time debugging a problem in an app that I'm converting from single-threaded to multi-threaded operation. As a nice first step, I wrote a new test suite, and put it in a new file threading_test.rb. This file was created by copying another, similar test suite from another file. I've since been having a lot of trouble with the new functionality, as it was throwing a lot of spurious errors. I've only just realised that this is because I defined a teardown method for my new test suite, which kinda depended on the corresponding setup method I defined. Except that I screwed up the file copy a bit, and didn't rename the test suite class name, so I was defining a teardown which was running alongside a completely unrelated setup method (the one from the original class). Kaboom! Of course, a large part of the reason it took me so long to track the problem down is that the reported exception was vaguely threading related, and since I'm no threading guru (or even wet-eared novice, truth be told) I'd spent a long time faffing around in my threading code wondering where the problem was. Then I read the exception information really closely and suddenly all was revealed...

15 November 2006

Matthew Palmer: Severe Discomfort's "The Joy of UDP"

(For the grammar Nazis out there: no, that apostrophe is not misplaced)
There are times when a connectionless protocol almost doesn't seem worth the hassle. Take, for instance, the troubles of a round-trip communication, using UDP, where the initial request is sent to a secondary IP address on an interface. Your code, on the server, might look like this:
 s = UDPSocket.new
 s.bind('', 12345)
 loop   data, remote = s.recvfrom(65535); s.send(data, 0, remote[3], remote[1]  
This is a pretty simple Ruby fragment which just reflects your UDP packets back at you. It really doesn't get much simpler than that. Connect to this thing from somewhere else (using nc -u remoteip 12345) and you can reflect packets back and forth to your heart's content. Or so you'd think... When talking to a regular IP address, your packets probably look something like this (when viewed using tethereal):
 192.168.0.1 -> 192.168.0.2 UDP Source port: 35716 Destination port: 12345
 192.168.0.2 -> 192.168.0.1 UDP Source port: 12345 Destination port: 35716
Fantastic -- I send a packet, and get one back. In netcat, you see whatever you typed printed back out again. But, what if I add a secondary IP address to the server's interface (ifconfig eth0:1 192.168.0.5, for instance) and try sending packets to that IP address (with nc -u 192.168.0.5 12345)? I get this insanity:
 192.168.0.1 -> 192.168.0.5 UDP Source port: 35772 Destination port: 12345
 192.168.0.2 -> 192.168.0.1 UDP Source port: 12345 Destination port: 35772
And of course, no self-respecting network stack is going to accept a packet back from a totally different IP address, even if it did manage to get the ports right. Hence, the client never sees the return packets, and thinks that the server is snubbing it. What's happening here seems insane, but it's actually just a regular artifact of a connecntionless protocol like UDP. You see, we've bound our socket to the "any" address (the empty string in the call to #bind tells UDPSocket to bind to the "any" address -- no, I don't know why either, it's not a particularly intuitive interface). When we get the packet into our app via #recvfrom, we get no information on what address the packet was actually sent to, only that the OS decided that the packet was for us (yay for encapsulation). The only information we get is where the packet was coming from -- and due to the fact that the kernel keeps no connection-related information around for the socket (the kernel figures it'll hold us to our connectionless pledge), when the time comes for us to send a packet back, we have to explicitly say where we want that packet to go -- that's the remote[3], remote[1] arguments in the #send call. The brain-leakage starts when we work out where to say the packet is coming from. When we send the packet, a source address needs to calculated -- again, the kernel keeps no information on source or destination because we're connectionless. Because our socket is bound to the "any" interface, the OS thinks it has carte blanche to set whatever source address it likes. In Linux, the behaviour appears to be to pick the IP address set on the primary alias for the interface that will be used to send the packet out on. So for the common case (one IP address per physical interface) everything is fine. But those corner cases, gee, they're awfully sharp and pointy... The solution, of course, is to send the packet out through a socket that is bound to the particular address you want to use as the source address -- then the kernel knows what source address you want, and there's no confusion. Seems pretty trivial, right? Surely every sensible network application does that already, right? So obviously Ruby's UDPSocket implementation just sucks. That's what I thought, and I don't blame you if you think so too. But before you raise pitchforks and storm the gem-covered castle, try repeating our little experiment with some other widely-used UDP-based applications, such as net-snmpd or your ntp server. (The NTP server is a little different, in that to trigger the problem you need to start it and then setup the interface alias, for reasons I'll explain later). Both net-snmpd and ntpd exhibit the same behaviour as our trivial UDP echo service -- at least, the versions present in Ubuntu Breezy do, although I can't imagine everyone's suddenly cottoned onto this problem in the last 12 months or so and come out with a rash of fixes. So, basically, everyone seems to be suffering from the same malady. For values of "everyone" that equal "some UDP servers". There's some services that don't seem to have such troubles with alias interfaces -- the Bind DNS server comes immediately to mind, and ntpd works fine if you start the NTP server after you setup the interfaces. Why the difference? These services are clever and bind to each IP address on the system separately, like so:
 $ netstat -lun  grep :53
 udp        0      0 192.168.0.1:53          0.0.0.0:*                          
 udp        0      0 192.168.0.5:53          0.0.0.0:*                          
 udp        0      0 127.0.0.1:53            0.0.0.0:*                          
This is very cool, and solves the problem, except that if you add another interface after you start Bind, it doesn't pick up the new address, and you're boned until you restart the daemon. It also increases code complexity a bit, since you need add a select into your request handling loop (instead of just blocking on the #recvfrom call, like I've been doing thus far). Whilst I'm never happy about unnecessary complexity, I'll deal with it where I have to, but the real killer for this application is the "you can't change your interfaces after starting the daemon" rule -- my particular need is to make requests to a virtual service IP address, and restarting my service after each IP address change is going to suck hard. I mentioned ntpd earlier because it has some extra trickery at work. It's list of bound interfaces looks like this:
udp        0      0 10.6.66.6:123           0.0.0.0:*                          
udp        0      0 192.168.250.6:123       0.0.0.0:*                          
udp        0      0 172.14.16.6:123         0.0.0.0:*                          
udp        0      0 172.31.62.1:123         0.0.0.0:*                          
udp        0      0 192.168.37.179:123      0.0.0.0:*                          
udp        0      0 10.64.64.64:123         0.0.0.0:*                          
udp        0      0 127.0.0.1:123           0.0.0.0:*                          
udp        0      0 0.0.0.0:123             0.0.0.0:*                          
It listens to every IP address explicitly plus the "any" interface. I'm not quite sure why, either -- just listening to the specific addresses works for Bind, and if you add an interface alias after starting ntpd, it exhibits exactly the same problem as the trivial UDP echo service, so I don't think that listening on "any" is really gaining it anything. Listening on "any" does make ntpd behave differently to Bind: with Bind, if you send packets to an interface that wasn't available when Bind was started, it just completely ignores you (because it lacks a socket listening for packets to that address), while with ntpd the packets hit the "any" socket and suffer from the wrong-source-address bug. At the moment, my best chance of a solution appears to be to follow Bind and ntpd's lead and hook onto every address, but with the extra twist inspired by ntpd -- listen on the "any" address as well as all of the specific addresses. If I use any packets that arrive on the "any" socket as a trigger to rescan the available addresses (to add any new addresses that have been created since the last scan), that should solve all my problems. Now I only need to make it work (and deal with the insanities that will no doubt result). Wish me luck. The screams of pain and frustration you hear (no matter where you are in the world) are probably mine.

7 September 2006

Matthew Palmer: Bruce Schneier, You're my hero

The article of interest, Microsoft and FairUse4WM, starts with this:
If you really want to see Microsoft scramble to patch a hole in its software, don't look to vulnerabilities that impact countless Internet Explorer users or give intruders control of thousands of Windows machines. Just crack Redmond's DRM.
And just gets better from there, covering the economic realities of software patches for vendors and the user community, and makes (yet another) call for taking some of those externalities that dodgy software vendors love to exploit and internalising them again. Possibly the best sentence in the whole article, and a fantastic soundbite, is this one:
[Microsoft] is not a public charity, and if the internet suffers, or if computers are compromised en masse, the economic impact on Microsoft is still minimal.
The unasked question is, of course, how we can make the economic impact of enabling abuse of the Internet through shoddy security practices a little larger? Making Linux a more compelling option for all consumers is a nice long term one, but lawsuits and legislation would make them take notice a bit quicker. The funniest (or saddest, depending on your perspective) part of the DRM patch is that Microsoft released the patch out of it's normal "Patch Tuesday" cycle (which is guaranteed to garner more-than-usual interest), and then an updated version of the DRM-smasher is released a few days later getting around the "fix". I highly recommend everyone to read this article. It's a nice piece, full of talking points and thoughts to ponder.

Next.

Previous.