I finally got around to getting a 12VDC power supply for the car (15 USD, cheap!), so my WRT54G3G-ST is mobile, and I got to enjoy trying out Skype while doing 65mph on the Mass Pike.
There’s some sort of gee-whiz factor in all this, but I guess it’s just another way to become more and more endlessly connected.
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…
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.
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=0x22b8 product=0x2a64
• Plug in the phone and issue a:
sudo /sbin/modprobe cdc_acm vendor=0x22b8 product=0x2a64
• 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
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.
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.
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 …
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
UPDATE: As of March 2010, I have posted an updated patch against a newer kernel, available here.
I worked out a simple patch to get the Cisco VPN client working with Ubuntu Feisty, which I’m attaching here.
For those who use Apache 2.x, this is a nice trick to keep people from hotlinking your images. I’ve seen a few variants of it, but this one I picked up most recently from a slashdot comment, of all places.
Make sure you have enabled mod_rewrite, then add this in your .htaccess file for any directory with images in it:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain\.com [NC]
RewriteRule .* /files/goatse.jpg [NC,L]
to redirect to an awful image, or use my own personal variant:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sitename.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ - [F]
which doesn’t return *anything* if someone else hotlinks your images. If they like your images enough, they can like them enough to save a copy on their own webserver.