Wednesday, November 09, 2011

Low bandwidth vnc

I've been travelling and the bandwidth here isn't the best. When I need to vnc to work over the vpn I can still get pretty good performance even on slow mobile broadband:

vncviewer -depth 8 -encodings tight -compresslevel 9 [host]:[port]

Monday, September 05, 2011

debian iceweasel and jenkins seleniumhq plugin

I was having trouble getting selenium (under jenkins) to run iceweasel (on debian squeeze). selenium was whining that /usr/bin/firefox was a script. Symlinking the xulrunner stub to /usr/bin/firefox-bin didn't work since it would whine about not finding application.ini.

Thanks to Tero Tilus on running selenium under debian lenny, I find that the solution is to add /usr/lib/iceweasel to jenkins' path. That way it finds firefox-bin plus all the other files that firefox-bin needs to start.

Thursday, August 18, 2011

xpath css class matching

xpath class matching when the element actually has more than one class in the class="foo bar" statement.

"The solution is arcane but I promise it works:"

//div[contains(concat(' ',normalize-space(@class),' '),' foo ')]

"Note that there must be spaces on either side of the class name 'foo'."

That's pretty long and is more general than I need. If multi-class entries are normalized already (e.g., no non-space whitespace in there, just spaces), then it's simpler to use just:

//div[contains(@class, "foo")]

That's so much shorter that I generally start with that and only fallback to the longer form if I find any entries in the html that have non-space whitespace.

Wednesday, August 10, 2011

whatprovides for deb

It took me long enough.

I've often wanted to learn which package installed a given file (e.g., /bin/nc or /bin/vim). It was never important enough to actually read the manual for, however :-). And my google incantations weren't quite right.

Finally I see that it's

dpkg -S [filename]

that's a lot less typing than for rpm :-).

Sunday, July 24, 2011

guruplug and slow USB devices

I've got my guruplug connected to a seagate 1TB external expansion drive. At boot, the guruplug doesn't detect the seagate drive on first usb start (in the uboot process, before it even boots the linux kernel).

It's a timing issue, the drive just takes a while to start up and with the default bootcmd setup (just one usb start), the drive just isn't available yet when linux comes up.


edit the bootcmd so that where it does the "usb start", it should next do a "usb stop;sleep 10;usb start". I thought it might be sufficient to do "sleep 10;usb start", but it isn't. The first usb start wakes up the disk. If we skip it by just doing a sleep 10, the disk still isn't detected fast enough by the succeeding usb start.

So we startup usb (usb start), stop it (usb stop) so we can start it again later, sleep a bit, and then start it. The second time we start it, it's already spun up and is available to uboot (and later, to debian).

I still had to set the passcount in /etc/fstab to zero so it wouldn't be auto-fsck'ed. This is because processing of /etc/fstab and auto-fsck happens before the USB devices are detected by the kernel. So if passcount is not zero then linux tries to check the drives to see if they should be fsck'ed but the USB drives aren't available yet and I need to Ctrl-D and type the root password for maintenance.

I might put the root filesystem on the USB drive (still thinking about it). I like the idea of having the rootfs on USB (SDCard is not an option for me since this is not the GuruPlug Server plus, no SDCard slot) since I had to install uboot, kernel and rootfs from scratch because some random power cycling corrupted the NAND and when I did an fsck on it, it corrupted it enough so that I had to unbrick it with the JTAG :-).

I've done that twice now (once here and once on the Tonido). If this (or similar) plug is going to be deployed in places where power is unstable, then having the rootfs on an external device that can be easily fscked on some other linux machine is essential.

Wednesday, July 20, 2011

ecryptfs and changing password

Apparently we need ecryptfs-rewrap-passphrase ~/.ecryptfs/wrapped-passphrase

or (if it's not mounted), then ecryptfs-rewrap-passphrase /home/ecrypts/[username]/.ecryptfs/wrapped-passphrase.

Thursday, July 14, 2011

dos2unix in vim

the gist of which is:


and to compose the ^M character you need to press 

Wednesday, July 13, 2011

Tuesday, May 24, 2011

Globe Telecom Service -- A Quality Vacuum

I was in the Philippines for two weeks and had first hand experience of various bogosities in Globe Telecom's mobile broadband service.  I decided to test supersurf50 (avoiding supersurf220 initially in case the service was so bad that the other 4 days would be wasted if I abandoned the service).  supersurf50  provides 1 day of unlimited mobile broadband.

  1. supersurf** is supposed to text you when your 24 hour subscription subscribes.  This is because, when your subscription subscribes, you switch to their default/casual mobile broadband rate of PHP 5 for 15 minutes (therefore, PHP 20/hour).  I didn't get a text the first day and the casual rate ate all but PHP 1.00 of my credit (because it only takes PHP 5.00 at a time).  I tested supersurf60 again the next day, to confirm that I still didn't receive the text.  I didn't.  This time it ate less (since I was ready for it and explicitly testing).
  2. I called Globe support about this problem.  They asked for my number.  When I asked if they had caller ID and couldn't they just look it up, the support person said they didn't have caller ID.  I called Globe support several more times until I gave up on their phone support.  I got a different support person each time.  I asked every single support person if they had caller ID.  All of them said they didn't.  It must be true.  It's also amazing in a ridiculous and incompetent sort of way.
  3. After they ask for your number, they ask for your name.  The second time this happened (and I think one more later support call) I asked if they had a field in their trouble ticket system for the name, so that they wouldn't have to ask it every time.  Every support person said they don't.  Must be true, no one would invent such a stupid detail, after all.  So to Globe, prepaid subscribers are just numbers that they can't even identify unless you tell them.  I could, therefore, start filing bogus problem reports using the globe mobile numbers of anyone whose number I knew (or just random numbers).
  4. I was keeping track of when my supersurf50 would expire (so I could test, at expiration, whether it was eating my prepaid credit).  I had an alarm that would fire at expiry time.  When the alarm fired, I'd check my balance, ensure that it had been reduced by PHP 5.00 (and that, therefore, I was on the casual rate).  I'd send "supersurf status" and it would stay that I was not subcribed.  This is good since clearly I wasn't anymore.  I'd then send "supersurf50" to resubscribe, and it would say I was still subscribed.  Even an hour or two after expiry, I still couldn't resubscribe.
  5. When I called support about this, they couldn't help.  They couldn't LOOK at my status to see if I was still subscribed or not.  It seems, they can't actually look at anything about your account or phone number.  Their only purpose is to find something in their script that's close to your problem and then read that to you.  And apologize for their inability to do anything.

    Twice I was referred to technical support (apparently different from "account" support.  They couldn't help me either.  They knew more technical sounding words and APN settings and such, but they couldn't look at my subscriptions either, and they couldn't even see what account support had written about my problems.  They had two completely separate (but similarly useless, because couldn't look at my true status) trouble ticket systems that didn't interoperate, so every time I was referred to technical support (only twice, to be honest), they had to ask me for my number again, my name again, and what the problem was.  again.

    To be fair, I only talked to technical support twice or so and I only asked one of them if she could see my "account support" tickets.  She said she couldn't and said the systems were separate.  So that's a sample of one.  It's likely true though, given the thoroughgoing incompetence of this whole system.
  6. I had still not been told how to resubscribe to supersurf when status said I wasn't subscribed but resubscribing kept telling me I couldn't do that since I was still subscribed.  Finally, I tried "supersurf stop", and after it said I needed to send "supersurf yes" and I did that, I was finally able to resubscribe.

    Apparently, however, that's not in the scripts.  I talked to two or three support people about this problem and none of them suggested "supersurf stop".  Either they didn't know about the option at all, or no one had considered it as a solution, or someone had but the solution hadn't moved up to the support people yet (perhaps because Globe's response to bug reports is to apologize and then do nothing since, they can't do anything anyway.  they can't even look up status, let alone change anything).

    Heh, Similar bug report here from LAST YEAR.  And he couldn't resubscribe for 5 DAYS.  If the 5 days is consistent (haven't looked for more cases), it might be that there's a bug confusing "50" with "220" (perhaps "220" is assumed even if the actual subscription is "50").
  7. I was a bit forceful in my last two account support calls.  I asked to be pushed up to the next support tier.  Apparently there is no next support tier (two support people actually said that they couldn't because there was no next level that could help me).  The best they could do was refer the issue to an issue resolution team.  I never got a call back from any such team, even after I'd made clear in my report that Globe had STOLEN several hundred pesos of prepaid credit because their text notification of subscriptions did not work as advertised.  To be fair, this was my fault too, I'd stayed up all night twice in a row for my stepfather's wake, so slept through the expiry the next morning :-(.  And I'd trusted Globe when they said they'd text me before expiry.  That's the real fault, right there.

    I asked to speak to a manager.  They couldn't let me do that.  I asked to have my complaint (on two occasions) referred to management with the explicit request that they listen to the recording so they could hear EXACTLY what I said (rather than just read the filtered account that the support persons were typing into their ticket system).  I never got a call or any other acknowledgement from anyone about that either (or, really, about any of my complaints about their service).  Either management listened to the recording and did nothing, or they didn't listen.  I'll attempt charity and guess the  second.
  8. I had had enough of losing money every day to the casual rate, so I switched to supersurf220.  That would give me 5 days of unlimited broadband, reducing my casual rate losses to, perhaps 1/5th of the daily rate :-).  Unfortunately, the confirmation SMS said that the unlimited rate would expire 8 hours early (I subscribed at 23:45 or so, and it said it would expire at 15:45 or so 5 days forward).  Support couldn't help.  They could only assure me that it would actually expire at the right time.  They didn't explicitly say but left implied (presumably it's painful or against Globe policy to actually acknowledge a bug) that the notification had gotten the time wrong.

    As it happens, in fact the subscription did expire at the right time (23:45 that Saturday).  So either the notification was just wrong (likely, just a consistency bug similar to the "supersurf status" bug) or the complaint was pushed up to someone who could actually look at the status and they fixed the expiry time (unlikely, IMO).
  9. At around 8:30PM one night I continuously tried to send "supersurf50".  It kept replying that it couldn't perform the subscription yet and to try again later.  There are capacity problems there, it seems.  That should be fixed.

    Heh, That bug has also been around for at least a year.
I had more problems with Globe service (apart from slowness and it seems they have QOS or similar rules that discriminate against UDP) but eventually I gave up calling support.  I used the broadband for 5 days since I'd already paid for it.  Quality was very unpredictable.  Most of the time it was very slow (about as slow as a dial-up modem), sometimes I'd get 128kbps, and for a whole afternoon I could stream youtube videos very fast (1.5Mbps or so).

For light surfing, facebook and chat it's sometimes worthwhile.  Next trip to the Philippines though I'm avoiding Globe.  To be fair, the support persons do seem to be very willing to help.  They just can't since they don't have the tools to help.

I tried Smart and Sun mobile broadband too.  Neither of them would let openvpn connect (I tried various combinations of reducing MTU, using TCP instead of UDP, removing TLS auth).  I'm going to have to work remotely from wired DSL connections (openvpn may be slow, but it will at least connect so I can get to the wiki and run jmeter tasks remotely via commandline).

Saturday, May 14, 2011

Aaahh, tethering finally working on Globe telecom

Name: MyGlobe Inet
MCC: 515
MNC: 02

Leave all other settings alone.

Globe firewalls DNS.  Only DNS requests to Globe's own servers will work.  If tethering, the default DNS server (the android handset) doesn't work.  Need to edit /etc/resolv.conf and set nameservers there.

The SetDNS app helps with that (tells you what your DHCP DNS settings are).  Google gives some other Globe DNS servers too, but they don't work.  In case the DNS server IP addresses change (they're not meant to be hardcoded anyway, being provided by DHCP instead), then setDNS is the first thing to look (there are also a bunch of other IP settings viewers on the app market, I chose SetDNS since I was testing and wanted to be able to set the DNS servers *in* android (not just the tethering laptop).

I think 2degrees must also have the same DNS firewalling behavior (I had the same issue when testing at the airport in Wellington, tethering worked, I could ping remote hosts by IP address, but I couldn't resolve DNS).


Weird situation in the morning.   I'm down to PHP 1.00 of load.  Packets go out, and even ping (tethered) works with replies arriving.  However, reply packets don't come back.  So DNS works, ping [] works (including replies) but http and google talk don't work.  I *think* yahoo messenger works though.  Possibly it's TCP that's blocked but UDP is allowed through?

Ah, I just reloaded and now have unlimited broadband for the day.  I was surprised when I lost all my load leaving me with PHP 1.00.  Apparently, when the broadband plan expires, I start to get charged at PHP 5 for every 15 minutes (no auto-reload).  The lack of auto-reload is fine, but I got no notification of the expiry and so the trickle deduction of load is very surprising (and pauperizing).   Also, there's some indication that internet only works while there is at least PHP 5.00 of load.  That's just bogus.  If there's no more load, just stop providing service.  Don't set an artificial level of required load below which, for no good reason, you suddenly stop providing service.

Tuesday, May 03, 2011

ubuntu lxc howto [Edit: 2013-05-29] Using LXC in Ubuntu is now *much* easier. Don't follow the instructions in the link above anymore, they're out of date.

Saturday, April 23, 2011

Setting the guruplug to be a wifi WPA2 client

I'm going to need this link when I finally get around to setting up the guruplug :-).

Setting GuruPlug to be a Wifi client

Saturday, April 09, 2011

nload finally working on tonido (sheevaplug) with debian squeeze

I've tried to get nload working on the tonido plug for a while. My tonido runs debian (I didn't want to stick with the old version of Ubuntu that comes standard, to begin with, security updates weren't being provided anymore years ago).

One thing I missed was nload. Whenever I'd try to run it I'd get a segfault.

Finally though (possibly due to a recent apt-get update;apt-get upgrade;) nload is now working without crashing. This is debian squeeze.

Monday, March 28, 2011

apache derby constraints

Apache derby's log messages on constraint violation aren't very useful. E.g.,

The check constraint 'SQL123456789012' was violated while performing an INSERT or UPDATE on table ...

To find which constraint that is:

sys.syschecks s1,
sys.sysconstraints s2,
s1.constraintid=s2.constraintid AND

Saturday, February 12, 2011

Xpath for Drupal form_build_id in jmeter

I often load test Drupal webapps with jmeter. One thing that I need to do very often is grab the form_build_id (unique for every form invocation) and use it for the form submit.

For a very simple form (only one form_build_id on the page), this works:


in the Xpath extractor, set the reference name to whatever you want. I often set a default value of, e.g., form_build_id_no so I can easily tell (in a Debug Sampler) that no value was found and therefore the xpath isn't quite right.

The @id extracts just the id attribute from the input element.

Monday, January 24, 2011

Bloom facebook photo uploader problem -- screenshot

java web start console output is at: