Wednesday, June 13, 2012
mDesktop is a winner!
As I mentioned in the preceding post on disabling windows screen flipping, I'm working on a Windows 7 machine at a client site for a few months. I've half heartedly looked for multi-workspace software for Windows. Must be free as in beer (since this isn't *my* computer and it's not important enough to get the company to pay for the software).
mDesktop does a great job.
I'd love to have some customization features, but it works great as-is.
Disable Windows screen flip
I'm working at a client site for a few months and they use Windows computers there. For a while I'd get confused because when I'd type Ctrl-Alt-Left or Ctrl-Alt-Right, the display would flip to portrait (with the "top" at the left or the right depending on which key combination I'd typed).
It turns out this is easy to fix (well, on *this* machine, exactly where it needs to be fixed may depend on video card/driver). And the path to fix it varies too depending on version of Windows. For Windows 7 and for this Intel Q45/Q43 Express chipset:
Control Panel > All ControlPanelItems > Display > Change display settings > Advanced Settings
Intel(R) Graphics Media Accelerator Driver > Graphics Properties > Display Settings
uncheck "Enable Rotation" > Apply and accept the change.
Saturday, April 28, 2012
Auto stop torrents at 100%
#!/bin/bash P=100 id=`transmission-remote -l | cut -c 1-11 | sed "s/\*//" | cut -c 3- | sed "s/^ //" | grep "$P\%" | cut -f 1 -d " " ` if [ -z $id ] then echo "no match : $id" else sleep 60 echo "stopping $id" transmission-remote -t $id -S fi
Tuesday, March 27, 2012
No supported regular expression matcher error under ant
Solution is at:
http://tatwright.wordpress.com/2008/03/23/ant-troubleshooting/
sudo apt-get install ant-optional
http://tatwright.wordpress.com/2008/03/23/ant-troubleshooting/
sudo apt-get install ant-optional
Tuesday, February 21, 2012
selenium under jenkins after a firefox update
A client ran into a problem recently. After an upgrade of firefox, they suddenly had many selenium test failures. I was confused and couldn't figure it out for a *long* time.
When we'd connect to the running test (vnc), there were two tabs in the controlling firefox window. It turns out that the second tab was a "Thank you for upgrading firefox". That would have been innocuous if it just sat there in the background. Unfortunately, selenium took it over and then started to run the test in *both* tabs.
Since some tests changed session state (e.g., login, do some logged in work, logout) tests would fail when one tab would log the user in and the other tab would log the user out while the first tab wasn't finished yet.
Running firefox manually while forcing it to use the base profile used by selenium fixed the issue. We could also just have edited prefs.js and modified the lastAppVersion entry, but the first fix is easier (it does the lastAppVersion modification) and anyway I only learned about modifying lastAppVersion directly after I'd already done the first fix :-).
When we'd connect to the running test (vnc), there were two tabs in the controlling firefox window. It turns out that the second tab was a "Thank you for upgrading firefox". That would have been innocuous if it just sat there in the background. Unfortunately, selenium took it over and then started to run the test in *both* tabs.
Since some tests changed session state (e.g., login, do some logged in work, logout) tests would fail when one tab would log the user in and the other tab would log the user out while the first tab wasn't finished yet.
Running firefox manually while forcing it to use the base profile used by selenium fixed the issue. We could also just have edited prefs.js and modified the lastAppVersion entry, but the first fix is easier (it does the lastAppVersion modification) and anyway I only learned about modifying lastAppVersion directly after I'd already done the first fix :-).
Thursday, February 02, 2012
Binding host directories to container directories in lxc with lxc.mount.entry
I'm very happy about lxc.mount.entry in lxc containers (working in Ubuntu 11.10 Oneiric host, not tested on older hosts since I don't have any around).
e.g.,
That lets me mount a directory on the host (/var/lib/lxc/**/[some_directory]) inside the container somewhere (in this example,
I'd tried something like that with samba but had instability problems so gave up. Most of the time it would work fine, but sometimes (I never had the time or inclination to figure out why) something in samba would get out of sync and I'd not be able to write new files from the LXC container, delete files, etc.
Samba does have an advantage in that the UIDs don't have to be the same since you specify which user the files will be mounted by locally. But it's easy enough to synchronize UIDs between host and container.
e.g.,
lxc.mount.entry=/home/[user]/[some_directory] /var/lib/lxc/[container_name]/rootfs/home/[user]/[some_directory] none defaults,bind 0 0
That lets me mount a directory on the host (/var/lib/lxc/**/[some_directory]) inside the container somewhere (in this example,
/home/[user]/some_directory).
I'd tried something like that with samba but had instability problems so gave up. Most of the time it would work fine, but sometimes (I never had the time or inclination to figure out why) something in samba would get out of sync and I'd not be able to write new files from the LXC container, delete files, etc.
Samba does have an advantage in that the UIDs don't have to be the same since you specify which user the files will be mounted by locally. But it's easy enough to synchronize UIDs between host and container.
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.
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:"
"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:
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.
"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
that's a lot less typing than for rpm :-).
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.
Solution:
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.
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.
Solution:
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.
or (if it's not mounted), then ecryptfs-rewrap-passphrase /home/ecrypts/[username]/.ecryptfs/wrapped-passphrase.
Thursday, July 14, 2011
dos2unix in vim
http://www.xappsoftware.com/wordpress/2009/03/31/dos2unix-using-vi-or-vim/
the gist of which is:
the gist of which is:
:%s/^M//g and to compose the ^M character you need to press CTRL-V -> CTRL-M
Wednesday, July 13, 2011
Removing Ubuntu Natty overlay scrollbars
Ahhh, I'm glad there's an easy way to disable Ubuntu Natty overlay scrollbars.
http://mikebeach.org/2011/05/disable-the-overlay-scrollbars-in-ubuntu-natty/
http://mikebeach.org/2011/05/disable-the-overlay-scrollbars-in-ubuntu-natty/
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.
- 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).
- 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.
- 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).
- 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.
- 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.
- 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").
- 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.
- 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).
- 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
APN: http.globe.com.ph
MCC: 515
MNC: 02
AUTH: PAP or CHAP
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).
Update:
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 [8.8.8.8] 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.
APN: http.globe.com.ph
MCC: 515
MNC: 02
AUTH: PAP or CHAP
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).
Update:
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 [8.8.8.8] 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
http://blog.bodhizazen.net/linux/lxc-configure-ubuntu-lucid-containers/
[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
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.
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.,
To find which constraint that is:
SELECT
s1.checkdefinition
FROM
sys.syschecks s1,
sys.sysconstraints s2,
WHERE
s1.constraintid=s2.constraintid AND
s2.constraintname='SQL123456789012';
The check constraint 'SQL123456789012' was violated while performing an INSERT or UPDATE on table ...
To find which constraint that is:
SELECT
s1.checkdefinition
FROM
sys.syschecks s1,
sys.sysconstraints s2,
WHERE
s1.constraintid=s2.constraintid AND
s2.constraintname='SQL123456789012';
Subscribe to:
Posts (Atom)