David Sterry's Blog


Monday, September 14, 2009

gNewSense Wireless That Works

Wireless on a laptop is like wheels on a car. Essential.

I've been running gNewSense for a few months and have found it to be very stable and kind to me on my HP dv6226us. Unfortunately there are no free drivers for the built in wireless card. That has meant no wireless networking on this baby. So to get by, I either stayed tethered to the nearest ethernet cable or booted into another OS. The Free Software Foundation knows that hardware support is a problem with 100% free software and maintains a list of fully supported hardware. After having seen that, however, I didn't feel confident that I could make a purchase.

That's the way things stayed until I heard a couple weeks ago in #gnewsense about the Netgear wg111v3. This usb wireless device was reported there to work with free drivers so I purchased one. I received it yesterday, booted up gNewSense, plugged it in and voila! Within a few seconds I was able to select my wireless network and get online. I've tested it with two WPA networks, one using TKIP and the other AES and it works fine. I'm not breaking any speed records (200kB/s max) but I've not done extensive testing or tweaking to see what might be holding that speed back.

Since wireless is an essential, yet tricky, feature to have working on a free-software-driven laptop I thought it was worth a blog. So, my fellow free software enthusiasts, you have at least one option when it comes to wireless on gNewSense! If you find this post helpful or know what might bring my speeds up besides the usual range/interference stuff, please post a comment.

Thursday, August 27, 2009

Logitech Harmony Remote Programming in GNU/Linux

I have a Logitech Harmony 510 smart remote that I use to control the devices that live near my TV. Programming the device was simple enough...I plugged it into my computer selected my TV, cable box, and dvd/home theater system and defined a couple activities like Watch TV and Watch DVD.

When you trigger one of these, the remote sends the appropriate commands to each device so you can watch what you want. The software made it pretty simple and I was impressed with the device support so I think the remote is a good value for the $80 or $90 price tag.

The only issue is that the software doesn't run on GNU/Linux. To be fair, I didn't try it on WINE but I like to explore what's built specifically for GNU/Linux. Then I heard a couple weeks ago about a program called Concordance that lets you update your remote from gNewSense or some other Linux-kernel-running OS.

I decided to give it a go so I started by downloading the tarball and began to build the two parts I needed: concordance and libconcord. To successfully build them, I had to do libconcord first and I believe I had to make sure libusb was installed. Once it was built and installed, I found that I needed to run concordance as root. I also had to set an environment variable since the libconcord library wasn't installed in gNewSense where the the concordance binary expected it.

Apparently, this programming process works by interacting with a website. Logitech runs a site, mentioned in the README files, that lets you download a communication file that triggers the remote to respond to the website. The communication file has some sort of session id so you have to download that each time you want to update the remote. Once that file is sent to the remote, the website gives you the menus that you use to select the options for your remote. When you're all set, a new configuration file is downloaded to your computer and you run concordance again to complete the update. I had expected that this tool was flipping bits on the remote but it turns out it just provides a way to get the remote and website talking without the Windows-only tool.

I backed up my current config, made some changes, and successfully updated my remote. The end result is that I don't have to go through 4 pages of custom commands to get to the HDMI input on my TV or to manually turn a device on or off. I should have looked for concordance a month after getting the remote rather than waiting 8 months as I did. I could have used the Windows tool too but what's the fun in that?

Anyway, it was an educational and satisfying experience that opened my eyes to the way the remote actually gets programmed. I didn't know that Logitech was storing the details of my hardware on their website but I guess that's not such a big concern. Maybe Logitech should help me sell them when that comes time?

Have you tried it? How has concordance worked for you? If it's good, go to this page and write it a good review!!

Sunday, April 26, 2009

HOWTO: Run a gNewSense Virtual Machine in seamless mode using VirtualBox OSE

In this HOWTO I'm going to take you through running gNewSense, a 100% free operating system, on top of your currently installed operating system. This HOWTO mentions how to run gNewSense on top of Ubuntu and Windows though it's possible to run it on any OS that runs VirtualBox OSE. This HOWTO will only add 100% free-as-in-speech software to your computer because I believe free software provides the best way to run your computer.

A rough overview of the process is:

1. Download and install VirtualBox OSE.

2. Download gNewSense.

3. Install gNewSense inside a VirtualBox Virtual Machine

4. Set it to run in seamless mode.

And now for the full HOWTO:

1. Ubuntu users: To download and install VirtualBox OSE, Ubuntu users can start Synaptic with System -> Administration -> Synaptic Package Manager.

2. Then search for the virtualbox-ose package, mark it for installation, and click Apply at the top.

- or -

1. Windows users: Download the VBox Open Source Edition that has been compiled for Windows at:

http://sourceforge.net/projects/vboxwin32/

2. Run the VBoxSetup-____.exe to install.

--------------------

3. Download the latest gNewSense ISO file from:

http://www.gnewsense.org/Download

You can also use FUSBi( http://aligunduz.org/FUSBi/ ) to download and make a bootable USB drive so you're ready to boot or install gNewSense whenever necessary. For the rest of this HOWTO, I'm assuming you have the ISO downloaded to your desktop.

4. Create a new Virtual Machine in VirtualBox in which to install gNewSense:

a. Start VirtualBox and click New.
b. Click Next and type gNewSense in for the name.
c. For the Operating System choose Linux and for Version choose Ubuntu then click Next.
d. You can accept the recommended base memory or increase it depending how much RAM you have in your machine. Click Next.(I have 2gb of RAM in this laptop and like to give at least 512mb of RAM to the Virtual Machine. I wouldn't put much less than 256mb.)
e. Now to create a virtual hard disk, click New, then Next.
f. Leave Dynamically expanding storage selected and click Next. This makes a file that will grow in size only as needed up to the maximum you select on the next screen.
g. You can leave the default location and default size and click Next and Finish, then Next and Finish again. Now you'll have a new Virtual Machine that's almost ready to boot.

5. Set the new virtual machine to boot from the iso you downloaded:

a. With your new virtual machine selected in VirtualBox, click CD/DVD-ROM.
b. Check Mount CD/DVD drive and the ISO Image File option.
c. Click the folder in the ISO Image File option to add an iso to Virtual Box's library.
d. Click Add and navigate to your desktop to select the gNewSense .iso file you downloaded and click Open.
e. Click Select and Ok to finish getting the ISO ready. Now we're ready to boot and install gNewSense.

6. Install gNewSense by clicking Start on your virtual machine and then follow the directions here: http://wiki.gnewsense.org/Documentation/InstallingGNewSense#Installation_Walkthrough At this point you should have gNewSense running and be able to login to it.

7. Now in the Virtual Machine's window click Devices -> Install Guest Additions. This will mount a virtual cd in gNewSense which will popup.

8. Inside gNewSense, click Accessories -> Terminal and run:

sudo /media/cdrom/VBoxLinuxAdditions-x86.run

9. Restart gNewSense and login. When your desktop comes up you can press your right Ctrl key with the L key to enable seamless mode or select Seamless mode from the Machine menu.

So there we have it. In seamless mode, you will be able to use all the applications inside gNewSense on the same screen as your host operating system's programs. If you value software freedom you'll try to run as many things provided by gNewSense as possible and to replace your host operating system with gNewSense as soon as possible. Do not lose sight of the goal of running gNewSense and free software exclusively on your computer.

Tuesday, February 17, 2009

Podcast Subscriber Tracking with Perl

If you have a podcast, you probably provide an RSS or XML file for people to subscribe to. If you're interested in tracking how many people are subscribing to your feed and you're running Apache, I've just developed a simple script that counts repeat downloaders of the feed. I look for .rss in the URL but you can easily change that to .xml or whatever matches your feed.

You can download the script at http://trygnulinux.com/rsspodtrack

Thanks and leave any questions or suggestions in the comments.

Tuesday, January 27, 2009

Verizon EVDO Aircard Speed Testing

In the quest for mobility and to be a more useful computer guy, I signed up for Verizon's BroadbandAccess program. I got a USB EVDO modem that I've got running in either of two laptops. One of which runs Windows XP and the other that runs Ubuntu 8.10 Intrepid Ibex.

Before I went ahead and signed up, I went looking for data on the speeds I could expect from either Verizon or AT&T. I didn't find much for the local area but one forum post did mention >1 megabit download speeds very near me using Verizon.

Now that I have the service, I decided to start testing and map my results. The product is here in the form of a Google Map. At each test point, I ran Speakeasy's Speedtest (http://speakeasy.net/speedtest) and recorded the download and upload speed. The markers are color coded for download speed only with Green > 1 Mbit, Yellow > 0.3 Mbit and Red < .3Mbit. If you click on a marker you'll see the download speed in kbps in the title and the upload speed in kbps below that. All testing was done in Windows XP.


View Larger Map

Overall, I'm very pleased with the service but I would like to see something similar done with AT&T's 3G in the same area.

Sunday, January 11, 2009

Fixed: Remote SSH Command Failing

One great way to use SSH is to run a single command on a remote server like this:
ssh user@host command

'command' here can be anything and the text output will be piped back to your local terminal.

I was having a problem with a few servers where this wasn't working. Turns out the problem was this line in my user's .bashrc
[ -z "$PS1" ] && exit 0

In this case, the -z tests "$PS1" (the prompt string) for null. Since the prompt was null, .bashrc exited on me. After removing that line, all was fine. If you know a better way to work around this or some very important reason the -z line should stay, feel free to leave a comment.

Saturday, November 29, 2008

HOWTO: GIF Animations with The GIMP

Today, we went out to Union Square in San Francisco and armed with my camera and a distant memory of rotating Egyptian pyramids, I decided I would try to put together a GIF animation of the Christmas Tree. What I did then was to take about 15 pictures each from 2 feet apart moving around the big Christmas Tree. This is the result:



HOWTO: Creating GIF Animations with The GIMP

1. First take your set of pictures or get them all in one folder.

2. Open up The GIMP, go to File, Open as Layers...

3. Select your set of photos by clicking the first one then holding down the shift key and clicking the last one and click Open. The GIMP will start importing your files in order as seperate layers of the image.

4. Resize your image by choosing Image, Scale Image from the menu and choose a reasonable size. For the web, I max the width out at 800 and the height at 600. The GIMP will be default link the height and width of the image so it'll still look right. Click Ok to do apply the resize.

5. The last step is to export the image as a GIF. Choose Save as... from the File menu. In the Save Image dialog box, near the Save button a dropdown field says All Image. Change that to "GIF image (*.gif)" and click Save.

6. Next choose "Save as animation" and click Export.

7. You can leave the options in the next window as their defaults or you can change the speed of animation.

Voila! You now have a GIF animation combining all your images together. If some of the images are out of order, you can go back and reorder the layers of the image and redo the export.

If you create a GIF animation by following this HOWTO, please add a comment below linking to your GIF animation. If you need ideas, try a stop motion animation of a Christmas Garden Gnome or take pictures of yourself from different angles or on different days.

Finally if you have any questions, feel free to ask.

Thursday, September 04, 2008

An Improvement to OpenSSH

If you need to work on a remote *nix server, you have undoubtedly used OpenSSH. The way it helps securely control remote machines makes it one of a handful of essential sysadmin tools. But this great tool does have a flaw and no I'm not talking about a buffer overflow or memory leak. The problem arises when connecting to a server for the first time. For example, we've all seen this:

The authenticity of host 'server.example.com (192.168.429.21)' can't be established.
RSA key fingerprint is 98:2e:d7:e0:de:9f:ac:67:28:c2:a2:2d:37:16:58:4d.
Are you sure you want to continue connecting (yes/no)?



With this string of hexadecimal characters, one is expected to verify the remote host's identity. It is suggested to use some out-of-band method like carrying around the fingerprint on a card or checking the key after login, but I think there's a better way.

Simply, add a dictionary of 65,536 (2^16) English words to OpenSSH. Then when it comes time to print out that nasty hex key, OpenSSH can map each string of 4 hex characters (16-bits total) to a single English word. In this way, we'll see the hex string and a second, more-readable English string:

98:2e:d7:e0:de:9f:ac:67:28:c2:a2:2d:37:16:58:4d

election accelerate import snag wrecking unsuitable defeating conceal developing educates substitute bridge enables originator cat forecast


If the dictionary and mapping are standard, then no matter what machine you connect from you'll see the same set of English words when connecting to the remote host. I think it's a nice little trick that makes RSA key fingerprints easier to read and remember. Such a simple tweak could make us all a little more secure. What do you think?

Monday, August 25, 2008

Ubuntu Hardy Terminal Services Client Problem

Generally, I like to write about things that work on my blog but I've seen how just asking a question can sometimes bring a solution together. So here's my current problem:

I am attempting to connect to a Windows 2003 Server via the Ubuntu Hardy Heron default Terminal Services Client and when I click connect the window just goes away. I've tried again and then that window goes away again. About 2-5 minutes later an error window will popup giving some sort of error. The last error message I got complained about talking to the sound card in some way.

I tried again by disabling the sounds in the client before trying to connect but it didn't help. If you've experienced this problem please post a comment whether you've found a solution or not. I'd like to help raise the profile of bugs like this that get in the way of living in Ubuntu full time. Thanks.

Saturday, August 16, 2008

Home Audio Streaming with Rhythmbox

Ever since I ripped my music collection to MP3 format and began collecting MP3s online, I've been struggling with managing and listening to all this music. In the past I've used WinAmp and iTunes on Windows XP to manage music locally. I've used Edna(a python script) to serve the music using its built in web server. Finally, I've copied this 30GB library a few times only to delete parts of it as I need the space on various machines.

Each of those setups feels like a kludge compared to my current Rhythmbox setup. I'm running Ubuntu and Windows XP on my computers at home and have found using Rhythmbox to store and serve my music has been the best experience so far.

To share music, start Rhythmbox on the computer that's storing it all. Go to Edit -> Plugins and check the box next to DAAP Music Sharing. Then click Configure on the right and check the box next to "Share my music".

Then if you want to listen to the music on any other computer, start Rhythmbox and go to File -> Connect to DAAP share and enter the name of your music server. Right away it'll pull down a list of files and you can begin searching, playing, and queuing up songs right away.

One tweak I'd recommend is on your server to have Rhythmbox watch your music folders. This helps when you have a program like bashpodder downloading your podcasts for you on a daily basis. Go to Edit -> Preferences and the Music tab and check the box to "Watch my library for new files".

If you use iTunes, stop. If you can't stop using iTunes, you'll be pleased that it'll auto-detect these DAAP shares so you can play it all from machines upon which you don't have Rhythmbox.

In theory you could even share this music to your computer wherever you are by opening a port on your router and using dyndns but I've not tried this. I would suggest setting a password on the DAAP share if you do.

One thing I might like to do is to connect remotely via ssh for increased security. If you have any ideas on that, please leave a comment. Also if you know of other free software audio clients that connect to DAAP shares I'd like to hear about those as well so people on Windows or OS X can enjoy more freedom in their software. Above all, enjoy your audio where you want, when you want!