NSLU2 based load balancer

Another day, another project …

A few days ago I put together an NSLU2-based load balancer using haproxy to do the load balancing.

If you don’t have an NSLU2, go get one. Those things are incredible, and ridiculously useful. I’m using OpenSlug/BE, but any distro is awesome on these things.

Hint: It takes some manual hacking of the haproxy.conf file and the init script to get it working from the optware packages. Of course, you have to tune it for the application you’re running…

Comments

Booting an old machine

If you’ve ever been stuck booting an old machine with a bad CD drive, or worse yet, *no* CD drive and an old enough BIOS not to properly boot a USB drive, you’ve experienced the wallbanger I have today. (and no, PXE boot wasn’t an option)

Fortunately, it appears that there is a nice boot floppy which allows booting via network or USB, which is available at http://www.plop.at/en/bootmanager.html… Direct link to the zipped floppy disk image is http://download.plop.at/plop/bootmngr/plpbt50rc11flp.zip.

Comments

Backing up a Motorola RAZR v3m with Ubuntu

I’ve had a Sprint Motorola RAZR v3m for a while, and when the time came to move to a Blackberry (for work), getting the information off of it would have been a horrendous process.

Instead, I present a pretty simple way of doing this using the Subversion version of opensync’s sync-moto script. Note that I did this under Ubuntu 7.10 (Gutsy Gibbon):

• Get the id by using lsusb:
$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 004 Device 003: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 004 Device 002: ID 0a5c:2110 Broadcom Corp.
Bus 004 Device 001: ID 0000:0000
Bus 001 Device 003: ID 22b8:2a64 Motorola PCS
Bus 001 Device 002: ID 046d:0a02 Logitech, Inc.
Bus 001 Device 001: ID 0000:0000
• Add the following definition under /etc/modprobe.d/somethingorother :
alias cdc_acm usbserial
options vendor=0×22b8 product=0×2a64

• Plug in the phone and issue a:
sudo /sbin/modprobe cdc_acm vendor=0×22b8 product=0×2a64
• Download the Subversion copy of the opensync moto-sync plugin from:
https://svn.opensync.org/plugins/moto-sync/
• Issue the following sync command:
./mototool -d /dev/ttyUSB0 –backup –file mybackupfile.csv

Comments

Surviving

I had a bit of a revelation the other day. Natasha and I had gone to pick up food to bring to a small dinner party, although it wasn’t a very formal occasion. She, on a lark, decided to grab one of those ridiculous celebrity tabloid-type magazines to read in the car on the way over.

The cashier, who looked to be somewhere between her mid forties and fifties, reacted with much excitement, and started talking to Natasha about some of the celebrities mentioned on the cover. None of this would have been very interesting, until I hear her start defending one of them. She said that it “wasn’t fair” that they were treating the celebrity “like that”, and that “she’s too good for that”. As if she knew her.

And something that has made a lot of sense to a lot of other people finally clicked in my head. A forty to fifty year old woman working a dead end cashiering job in the middle of nowhere doesn’t have anything to look forward to, and probably won’t ever attain any measure of fame and fortune. But by living vicariously through the glossy images in the impulse purchase area, she gets to feel as though she has some great connection. I used to think that welfare and Jerry Springer were our modern day bread and circus combination, but maybe that’s not it.

When you feel that you’re part of something bigger than yourself, you have some sort of purpose, and that the Universe is a sane, fair and rational place. You ignore poverty, poor health, overwork and stress, and instead focus on a place where the Universe revolves around you. Not exactly a “Total Perspective Vortex“, if you catch my drift. Maybe it’s just as much a way of getting by as betting the house on a better afterlife, or blowing all of your spare change on lottery tickets. I can’t exactly complain about it, since I think the perception of happiness trumps the reality of misery almost every time.

Pass the remote control, I’m tired of this station.

Comments

Modding that old XBox

If you’ve got an old junky XBox around, and would like to put something, well, *useful* on it, like XBMC, then I’ve got a great link for you which allows soft modding without having a copy of any of the exploitable games.

Patched xboxhdm 1.9 with exploits will allow you to boot another PC while hotswapping your XBox hard drive into that machine. It has all of the known exploits on it, I believe, so you don’t have to have your XBox connected to another machine or anything, nice and simple. After that, use a fully automated installer like Auto Installer Deluxe to do everything else for you.

So, don’t throw that XBox out, make it into something much better.

Comments

Deploying GWT Applications with Jetty

I’m not a big fan of tomcat, preferring Jetty where possible. Unfortunately there are a lot of catches involved with getting GWT applications working. I’ll try to break the changes down here. This assumes that you already have a GWT project built and made with projectCreator which you are migrating into Jetty.

1) Pull the start.jar, bin/jetty.sh script (which will be moved to the base of your distribution), lib and etc directories from your Jetty distribution, and put them in $DIST (your distribution directory)

2) Change your (appname)-shell script to be like the following:
JettyTest-shell

#!/bin/sh
GWT_HOME=/usr/lib/gwt
ENTRY_POINT=net.cognitiveconsulting.gwt.JettyTest
HOST_PAGE=JettyTest.html
APPDIR=`dirname $0`;
CPGWT=$APPDIR/src
CPGWT=$CPGWT:$GWT_HOME/gwt-user.jar
CPGWT=$CPGWT:$GWT_HOME/gwt-dev-linux.jar
java -cp $CPGWT com.google.gwt.dev.GWTShell -logLevel DEBUG -noserver -port 8080 "$@" $ENTRY_POINT/$HOST_PAGE

3) Change your (appname)-compile script to look like:
JettyTest-compile

#!/bin/sh
APPDIR=`dirname $0`;
echo "Compiling GWT portion of application ... "
java -cp "$APPDIR/src:$APPDIR/bin:/usr/lib/gwt/gwt-user.jar:/usr/lib/gwt/gwt-dev-linux.jar" com.google.gwt.dev.GWTCompiler -out "$APPDIR/webapps" "$@" net.cognitiveconsulting.gwt.JettyTest;
echo "Compiling native Java part of application ... "
ant -f net.cognitiveconsulting.gwt.JettyTest.ant.xml
echo "Moving pieces into Jetty library path ... "
( cd bin ; jar cf ../lib/net.cognitiveconsulting.gwt.JettyTest.jar * )

Remember, after this, your output directory is no longer www, it’s now “webapps”.

4) Create the directory $DIST/webapps/(appname)/WEB-INF, and create a web.xml file like this, with the definitions for your remote services:
webapps/net.cognitiveconsulting.gwt.JettyTest/WEB-INF/web.xml


  [servlet]
    [servlet-name]Test[/servlet-name]
    [servlet-class]net.cognitiveconsulting.gwt.server.TestImpl[/servlet-class]
  [/servlet]

  [servlet-mapping]
    [servlet-name]Test[/servlet-name]
    [url-pattern]/rpc/net.cognitiveconsulting.gwt.client.Test[/url-pattern]
  [/servlet-mapping]

(Please note that because wordpress ate my XML, I used a different kind of brackets, please substitute as required.)

5) Create the ant build file:
/usr/lib/gwt/projectCreator -ant net.cognitiveconsulting.gwt.JettyTest

6) Make sure you have created working servlets under the internal tomcat implementation before you proceed, making sure that the servlet information is in the .gwt.xml file in your source directory like this:

7) Make sure that a copy of $GWTDIR/gwt-servlet.jar and any other libraries you are using are installed in $DIST/lib — forget this and nothing is going to work.

8) Create an empty “logs” directory under $DIST.

You should be able to start Jetty at your convenience and browse to the (appname)/(startpage).html page. If you want to pack it as a war, just zip the (appname) directory in $DIST/webapps with a .war extension. Also, running jetty.sh with the parameter “supervise” will allow you to watch the logs as they go by.

Hope this has been informative and helpful.

UPDATE: Jan, one of the webtide guys, was nice enough to send me an ant build file which does much the same type of thing I was attempting to do here. It is attached here, for anyone else who would like a copy.

Comments

Thanksgiving

There seems to be an almost delectable thread of irony heading through my life as I head into Thanksgiving Day. Strangely enough, a few days ago I could have spouted for what would have seemed hours at all of the wonderful things to be thankful for, but somehow enough things have happened to come to a head that the same time that it’s a bit more difficult to extract the wheat from the chaff.

I guess I can’t pretend to be surprised about not being appreciated at work; apparently the majority of Americans are unhappy with work, but it doesn’t help the spirit of Thanksgiving to find out you were passed over for promotion *again*. Couldn’t it wait until *after* the holiday for once?

Then a long time friends turns out to only talk to you when he needs something … There’s no surprise in that, until you find out that he’s going to great lengths to abscond with something and avoid communicating with you at all. That’s just not necessary. Couldn’t we save some of these wonderful gifts for Christmas?

Another friend is moving away, and can’t be bothered to call you before he leaves. I couldn’t make up something this ill-timed if I tried…

So what am I left with? I’m going to finish this posting the same way every other glib Thanksgiving post has ended for as long as there have been glib Thanksgiving posts; by explaining all of the things that I *am* grateful for, after disregarding all of the awful things I’ve seen fit to grouse about.

Family looks like it’s the only thing you can count on. Whether natural or adopted, human or animal, your family is just about the only thing you can count on, no matter how bad times get. (Unless you’ve got parents like the Ramseys or Yates, in which case, run like hell.)

Ugh. This is what getting older feels like — everything turns out all sweet and saccharine, no matter how bitter and corrosive it started out.

Comments

Improved Film Noir rendering

Thanks to my brother, who is much better with gimp-perl than I am, there’s a vastly improved version of the original RenderFilmNoir.pl script, available here.

If you get a chance (shameless plug), please patronize his Flickr page, as we does work very hard at being a great photographer …

Comments

Nokia 770 makes appearance in Hollywood

The Nokia 770 turned up as a prop in the summer movie “Fantastic Four: Rise of the Silver Surfer”. Having read the actual source material, I can’t say I was impressed by the movie, but I really have to give credit to anyone who would feature a gadget like the 770 in anything. I saw a few livejournal entries on the same subject, but they seemed to like it. Well, if I’m going so far as to admit that I actually not only watched this particular stinker, but actually paid enough attention to see a Nokia 770 …

Comments

Linux support for ADS DVD Xpress DX2

I take no credit for this at all, but the maintainer of the go7007 linux driver recently added support for the ADS DVD Xpress DX2 (which until recently was conveniently available at Walmart and other retail stores) after I took a picture of the board and asked him *very* nicely. If you get any kind of mileage out of it and decide that you really *have* to send someone money, please send it to him. (To avoid spam, check out the name of the package maintainer.)

I’m posting a copy of this as a kind of public service, since I haven’t seen any upstream releases in a while. Disclaimer that your mileage may very. I have had great luck with this, and have used it to preserve old VHS content … I would also recommend using the ffrecord tool, since it has better av sync than the included tools.

Original driver : http://oss.wischip.com/wis-go7007-linux-0.9.8.tar.bz2
Patch : http://jeff.ourexchange.net/wp-content/uploads/2007/07/wis-go7007-linux-20061021diff.gz
Site for device : www.adstech.com

Comments

« Previous entries