Search Results: "Matthew Palmer"

6 January 2011

Matthew Palmer: Tethering to an Android phone

Whilst my philosophy with mobile phones has always been "if it can make and receive calls and SMSes, it's good enough for me", the geek in me occasionally lusts for a smartphone. So I now have an Android phone. Once you have a smartphone, you need a plan that includes data. Once you've got that, you realise that your USB mobile internet dongle is somewhat redundant, as long as you can get your laptop talk through the phone. It turns out, with Android, it's pretty easy. First, root your phone. There are a couple of tethering apps that don't require rooting, but the tradeoff is you end up having to install proprietary drivers in your laptop, and if I'm going to have a security hole somewhere, I prefer it to be in my phone, not my laptop. Rooting an Android phone is trivially easy with Universal Androot. Despite warnings I've seen to the contrary, it didn't even wipe my phone's apps and settings, although that might be a lucky coincidence. Backups, people! Then we need the tethering app -- I use Barnacle Wifi Tether, because it's open source, easy to use, and fully featured. Trivial to install from the market, you just start it up and it's ready to go. It acts as an ad-hoc wireless router, with a DHCP server and NAT to make life easy. In theory it supports WPA and WEP, but that doesn't appear to work for me. If anyone on the train is desperate enough to leech off my wireless, they're welcome to it. The hardest part, ironically, was getting the laptop to connect. Having never played with ad-hoc mode before, it took me a little while to sort out exactly what was supposed to happen, but within 5 minutes I'd worked it out and was pinging The Internet. Win!

23 August 2010

Matthew Palmer: My Hero!

I just have to say that this bull is my hero. That is all.

15 August 2010

Matthew Palmer: Anticlimax

This sounds exciting:
We think developers who want to work on the best, most dynamic, and most interesting open-source web technology project on the planet have no better place to work than here -
Fwowr, dynamic and interesting open-source web technology project! Sign me up!
working on Drupal.
That wasn't where I thought that was going. Those words obviously have very different meanings to different people. Never mind.

24 June 2010

Matthew Palmer: On lDAP objectClasses

Does anyone else think that a naming scheme that produces an identifier called dNSDomain is utterly broken, and should be taken out and shot immediately?

10 February 2010

Matthew Palmer: Using Virgin Mobile Broadband with wvdial

File Under: Stuff I'm guaranteed to forget if I don't write it down I just went a bit wild and decided to get myself some mobile broadband love -- I'm finding that I crave a bit of light 'net when I'm out and about, and an impending change in circumstances will mean that I'm out and about a lot more than I am currently. I have: My wvdial.conf stanza looks like:
[Dialer virgin]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP" "VirginBroadband"
Stupid Mode = 1
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB0
Modem Type = USB Modem
Username = irrelevant
Dial Command = ATDT
Password = irrelevant
Baud = 460800
I also had to disable CHAP (by putting -chap in /etc/ppp/options, although I suspect the same would have worked in /etc/ppp/peers/wvdial). After that, a simple sudo wvdial virgin and I was away. Scarily enough, there was actually some useful information on the Virgin support site regarding the settings, which helped me confirm that I was on the right track. I have no doubt that the universe will find some alternate means of punishing me down the line.

25 December 2009

Matthew Palmer: Making pbuilder just that little bit faster

Give yourself a small, slightly late christmas present, and put a tmpfs on /var/cache/pbuilder/build. It makes a noticable difference, especially if you're on a laptop system (like I am) with a disk that's not going to win any speed records.

1 December 2009

Matthew Palmer: When Scientists Get Into The Kitchen...

You get a rigorous analysis of the science behind boiling eggs. I want one of those thermal circulators for Christmas.

16 September 2009

Matthew Palmer: Backwards Compatibility FTW

Over the weekend I updated a small app I wrote for my local bushfire brigade from Rails 1.2 to Rails 2.3. Given it's small size, all-encompassing test suite, and general lack of mission criticality, I decided to bite the bullet and just kick up straight to Rails 2.3.2, and fix whatever broke. I was expecting quite a bit of fun and games. Well, there was fun, and there were games, but it was all relatively painless. I had to run rake rails:unpdate, add a couple of session config lines to my environment.rb, and get rid of a bunch of testing plugins that had been superceded by functionality in core (which involved me rewriting an awful lot of XPath into CSS selectors -- a massive net win, I have to say), but the core code of the application was completely unchanged (not a single line changed in the app directory). Given the number of major releases I leapt, and the fairly haphazard way in which I did it, I am quite pleasantly surprised at the outcome. Kudos to all the Rails hackers who made it possible.

Matthew Palmer: Oh Firefox...

What are you doing in that the 1.1GB of resident memory (1357m of virtual memory) you have decided to consume in order to display three web pages? All fairly basic pages -- no flash, no excessive Javascript, and I haven't even done anything particularly exciting in the browser -- just loaded the pages up and let them sit for a few days. Time to look at Conkeror on the Netbook, I suppose. I'm unlikely to be needing Firebug on there any time soon.

Matthew Palmer: Is There Something Wrong With Me...

When the first thing I thought of when I saw this baby outfit was "What sort of cretin wrote that code?", rather than anything more "paternal"?

Matthew Palmer: Vimoutliner... finally!

I am, at best, a vim dilettante, preferring joe for most of my day-to-day text-editing needs. However, I do like using vimoutliner for notes, plans, todo lists, and calendaring (more on that some other time). However, the Debian vimoutliner package (in combination with the awesomely undocumented vim-addons mess) is an absolute pain to get going, requiring far more swearing and prodding than seems necessary. Since I don't do it often enough, too, I keep forgetting how, and today things came to an absolute head when I very nearly flung my netbook across the room as it singularly refused to do my outliner bidding. Finally, however, after much swearing (and even installing vimoutliner's upstream package to see if it worked -- it did -- and what it was doing differently -- just a small, crucial addition to .vimrc), I got the magical recipe. No doubt someone with an acheing need to make sure that vim stays as user-hostile as possible will immediately spring into action to make sure this doesn't work for squeeze, but at least for the life of lenny, here's how to get vimoutliner working:
 # apt-get install vim-vimoutliner vim-addon-manager vim
 $ vim-addons install vimoutliner
 $ echo "filetype plugin indent on" >> ~/.vimrc
May it help someone avoid putting their laptop through a wall.

Matthew Palmer: "Tx unit hang" in e1000 driver

In the "blogging it so I don't forget about it" category, and also to try and give Google some hints, here's one from the vault I recently came across again... Older e1000 chips (specifically the 82573(V/L/E)) have firmware which enables the (buggy) power management functionality in the chips. Although this shouldn't occur with hardware shipped in the last several years (the updated firmware was released ages ago), I just came across it recently in a supposedly-new server, so who knows what's going on there... The problem manifests itself as flaky or unstable network performance, combined with the kernel / log messages:
	Detected Tx Unit Hang
	NETDEV WATCHDOG: ethX: transmit timed out
The fix is as described in the "82573(V/L/E) TX Unit Hang Messages" section of the Intel Linux driver documentation for the e1000 driver. The reason I'm blogging about it is that the top Google results point to either the now-dead e1000.sf.net wiki (which used to have all the necessary info, but now doesn't), or else forum posts which point to the now-dead e1000.sf.net wiki. Either way, it's not trivial to find a working location for the fix, so... linky love time!

9 September 2009

Matthew Palmer: Cool Regex Win-of-the-week

I just had a need to match a regex where there were two occurances of the same string, and it would be really, really nice to make sure that both occurances were actually the same (rather than both being different strings that just happen to match the same regex). Just to be funny, I tried this:
  /([a-z0-9\.-]+).*\1/
And knock me down with a feather, it worked! This is using Ruby's regex handling, but I'd be stunned if Perl didn't also handle this case. The world just got a little bit awesomer today.

Matthew Palmer: Quote of the Day

From a post on StorageMojo:
Lustre is not a product I would recommend since it was designed for HPC, a market where PhDs work as sysadmins.
While I've not used Lustre itself, the "market where PhDs work as sysadmins" (and the often less-than-entirely-spectacular results) are something I've dealt with more than once.

Matthew Palmer: The Rise and Fall of Wordperfect

It's been sitting in my browser for so long that I've forgotten where I got it from, but I've just finished reading The Rise and Fall of Wordperfect Corporation, written by W. E. "Pete" Peterson, one of the very early employees of the company, and one of the top people there for many years. It's a really interesting book, giving some insights into what it was like in the early days of "the microcomputer revolution", and with some solid observations of how to (and how not to) run a software company, and manage a very rapidly growing organisation. I'd recommend it to computer historians, software development managers, and business owners.

Matthew Palmer: Water Tanks, Reliability, and Redundancy

Water supply, in the developed world, is one of those things you just pretty much take for granted. You turn on the tap, and clean, cool, refreshing water comes out. Similarly, when I go to a fire in my shiny fire truck, no matter what time of the day or night, I expect to able to hook up to a hydrant and have a strong, steady supply of water available. This level of reliability is something that we in the IT industry can typically only dream of. Practically 100% reliability over a period of decades, without constant maintenance and tweaking? Not a hope. To even get close to that, we need clusters of fully-redundant servers, fancy database replication techniques, and probably something totally out of left-field like Erlang's ability to reload code on the fly. But how do the water utilities do it? Clusters of fully-redundant high-capacity pumps, fancy pipe re-routing techniques? Or something totally out of left-field like a big water tank and gravity? Where I live, we've got the latter. Thinking about how it probably operates and is managed, I'm blown away by the sheer simplicity and robustness of the whole design, and how it can handle all manner of failures. First off, consider how few components have to be working in order for the water supply to continue for a while after some sort of catastrophic failure. We need: Note that this list of elements doesn't include any moving parts, or even guaranteed continuous water supply from a dam or other huge supply store. You can lose your feed pump(s), supply lines, or anything else that's on the supply side of the water tank for some period of time and nobody on the consumption side will know or care. Need more resilience to supply-side failure? Just build a bigger tank. This blows my mind, it really does. Need to do pump maintenance? No problem, just make sure that the tank is large enough to service demand over the period of the "outage", and go for it. Can't find a pump supplier to give you a restoration SLA of less than a week? Just make sure you've got a water tank that'll provide for a week's consumption. Basically, any supply-side reliability problem can be solved with "build a bigger tank", and while there's a limit to how big we can make tanks, I'll bet we know a lot more about building huge water tanks to withstand some freaky failure conditions than we do about building pumps that won't fail for 100 years. If you do need more capacity than a single tank can provide, just parallelise -- horizontal scaling of the water supply. Woohoo! Your big water tank also provides cost savings in your other equipment. If you had to pressurise a water supply using pumps, not only would you need your redundant array of very expensive pumps (Hmm, RAVEP-5 sounds like a Doctor Who villain), but those pumps would need to be able to provide your peak consumption flow (toilet breaks during the Super Bowl, probably). I'd imagine that could get mighty expensive, and without providing much benefit for 99% of the time. I see this capacity problem at work all the time. Customers who have the occasional massive traffic spikes need to massively over-provision their average utilisation to successfully service that 1% of the time that they're doing heavy traffic. Yes, I know, cloud computing, horizontal scaling, capacity on demand, yadda yadda yadda. It's not a panacea, and the number of apps that are designed to properly scale horizontally over a large range of traffic volumes is miniscule. My general point, though, is that it when you've got a variable load, it costs a whole lot more to provision systems to supply peak demand than to provision systems that can deal with average demand. A suitably large water tank means you can easily deploy a much smaller capacity feed pump. All you have to do is make sure that when demand exceeds supply, you've got enough water in your tank to cover the difference between the demand and supply over that period. When your peak capacity increases, and is starting to strain your infrastructure, you've got a choice, too: you can upgrade the pump or increase your storage capacity, whichever is cheaper / easier / quicker / provides better kickbacks / whatever. This is all well and good, you say, but computer systems aren't water supplies. There's a lot more moving parts, inputs, and outputs, and those all have to be handled. This is quite true. Water-powered computers are not in high demand. However, I think we could produce some much more reliable systems if we looked for ways we could simplify capacity and redundancy issues, water supply style, instead of layering more and more cruft into our solutions.
Ironically, just after I started writing this post (and this gives you an idea of how long it's been sitting in my drafts folder), I saw an article in the RISKS digest about a water supply problem in Santa Cruz, caused by a power outage killing the refill pump for an extended period and resulting in the storage tank running dry. Hey, I never said that it was a foolproof system -- especially when you've got failures of imagination that result in the system that tells people that there's no power relying on the power source it's monitoring being up in order to be able to tell people that there's no power...

4 September 2009

Matthew Palmer: I want those two day of my life back, Puppet

Pop Quiz time, everyone (well, the Puppet-using subset of "everyone", anyway). Where is the dependency loop in the following manifest:
class klass  
   file   ['/tmp/a']: ensure => present  
 
define def_file()  
   include klass
   file   $name:
      ensure => present,
      require => File['/tmp/a']
    
 
def_file   '/tmp/b':  
def_file   '/tmp/c': require => File['/tmp/b']  
This seems pretty straightforward: /tmp/c can't be created until /tmp/b (via the direct require) and /tmp/a (via the define) have been created, while /tmp/b can't be created until /tmp/a is created. You can draw some pretty graphs and see that everything looks fine. However, if you run this manifest, you will find that roughly half the time, you will get a failure saying that there's a dependency loop (and the other half of the time it'll work fine), like this: "err: Could not apply complete catalog: Found dependency cycles in the following relationships". So, where is the loop? It's because the require on the /tmp/c resource also applies to the /tmp/a resource -- iff the include klass directive is applied to the /tmp/c resource. So /tmp/a then requires /tmp/b , and /tmp/b requires /tmp/a , and it's LOOP TIME! Whether or not this loop occurs on a particular Puppet run is controlled by fickle Lady Fate (because Ruby hashes, which are used at some point internally in this process, don't have a well-defined or stable order). As to why the include only applies to one of the defines rather than all of them, well, that's related to the fact that a class only gets evaluated once, and I think someone was having a lazy day when they wrote that part of the system (I can't imagine it would be the end of the world if each instance of the class was linked to the defined resource in the scope tree). Now, when you've only got the above manifest, it's relatively straightforward to isolate the problem and fix it -- I had it sorted in about an hour. The two days prior to that were isolating the bug from the live manifest, because there are about 20 instances of def_file in our live manifest, and so I'd have to run Puppet (on average) 20 times to make the problem appear every time I had a new hypothesis (and since I didn't know whether the bug was client-side or server-side, I had to run it in the real, full-blown environment, which slows things down further). If the class-handling stuff had been written properly, then the error would have been constant, rather than intermittent, and I would have been asking for a couple of hours credit, not a couple of days. The fix? Use virtual resources instead of the class, which does $DEITY-only-knows-what to the scope tree. These have their own giant buckets of ugliness, but our options, at this point, are unpleasantly limited. I really do wonder why I'm not a raging alcoholic sometimes. The reasons not to are strangely hard to recall right at this moment...

2 June 2009

Matthew Palmer: Local HTML docs for Prototype

Having (temporarily) flung myself back into a bit of professional Rails app development, I'm doing a JS-heavy site (just to maximise the WTF factor). Since I'm Old Skool, I'm going with Prototype, as it's the javascript library I'm least unfamiliar with. The problem, though, is that I do about a fifth of my work on the train, where I don't have access to the Internet, and the Prototype people haven't seen fit to provide a downloadable version of the docs in HTML. There's a PDF[1], (which lacks any sort of hyperlinking (how very 1990s) and whose page numbering in the TOC doesn't match up to the PDF page numbers), and a CHM which has hyperlinks that don't work half the time. Apart from that, all the docs are online-only, and not very scraping-friendly (wget --mirror doesn't rewrite links correctly when you're also mangling the filenames for local-friendly access -- patch in the making if I can be arsed). So, long story short, I need a non-traditional way to get myself some local docs. Turns out it isn't as hard as it sounds, as evidenced by the below command list:
	git clone git clone git://github.com/sstephenson/prototype.git
	cd prototype
	git submodule init
	git submodule update
	sudo gem install treetop
	rake doc:build
This will peg your CPU for an inordinate amount of time (a smidge over 10 minutes for me; -j 3 would have made things a lot quicker), but you'll end up with a doc/index.html which has some useful stuff in it. It'll look nothing like what's on the website, but it's something, and should be enough to keep me going on those long, lonely train journeys.
1. which looks like someone should be expecting a C&D from O'Reilly for look and feel, unless it's a semi-sooper-sekrit O'Reilly production that they don't want to put their name to directly.

1 May 2009

Matthew Palmer: The Accounting Equation

Not a usual topic of blogging, but most of us need to keep track of our money somehow (which I do with the help of the most excellent Ledger command-line accountingbook-keeping tool). I've just been pointed to a really great description of The Accounting Equation, which is the basis of double-entry book-keeping. Helped to straighten a few things out in my head.

26 April 2009

Matthew Palmer: ~/porn

It seems there are plenty of people who do take careful note of my scribblings, even down to noticing the apparent directory I'm in when I SSH to not-yet-existent SheevaPlug-based serial console concentrators. For the record: Thanks, however, to those people who noticed and let me know; if I ever do make an embarrassing cut-n-paste gaff, at least I'll know about it quickly.

Next.

Previous.