SSH tunneling for dummies

June 3, 2007 at 6:54 pm

If you ever find yourself behind a corporate firewall, as I have found myself at the PIKtipi sprint in Potsdam, and need to access a remote IRC server, here is a command to tunnel the traffic over SSH:

ssh -L 6667:irc.freenode.net:6667 yourserver.com

yourserver.com is a remote server (not firewalled) that you have access to. Of course, this assumes that the local firewall is not blocking SSH on port 22, otherwise you won’t be able to access the remote server.

Then you can connect to the remote IRC server by using localhost:6667.

Or if you don’t have time to type these commands in on the terminal, you can just use IRCatwork.com.

Technorati Tags:

Auto-login to a remote machine

September 26, 2006 at 8:51 am

I often need to login to a customer’s box and get tired of typing my password all the time. Thankfully using private and public keys, I can SSH into the machine securely without needing to type in my password.

First I create a user and add him to the wheel group, so that he has sudo privileges.

useradd nate
passwd nate
usermod -G wheel nate

Then I login as this user and add my public key to the authorized keys. This public key can be found on my local machine in ~/.ssh/id_rsa.pub

cd ~
mkdir .ssh
vi .ssh/authorized_keys
chmod 700 .ssh
chmod 600 .ssh/authorized_keys

Those last two lines to change the permissions are very important.

Now I can ssh into the machine, and it won’t prompt me for a password:

ssh nate@someremotebox.com

Technorati Tags: ,

Windows XP running inside Ubuntu Linux and MacOSX

June 13, 2006 at 12:44 pm

VMWare screenshotI was googling around for a solution to why the fonts on Ubuntu Linux are stretched on my Dell 20″ monitor, and the search words “widescreen fonts stretched ubuntu” brought up this page as the first hit.

Well, J Wynia’s blog post didn’t really solve my problem with the fonts, but it did remind me that VMWare recently made their VMWare Server software available free-of-charge, presumably in response to attention received by the open source Xen virtualization software.Thanks to the free VMWare Player, I had been running Windows XP on my Ubuntu Linux box, but after I recently upgraded to the latest Ubuntu Linux 6.0.6 (codename “Dapper Drake”), the VMWare player stopped working. I decided to try updating to the VMWare Server to see if that would solve the problem.I downloaded the VMWare Server software and installed it using ./vmware-install.pl.

This brought up a series of questions to which I replied the default. When I got to the question:

It wouldn’t accept the default response and said:

I googled for that exact text, and this post to the Ubuntu forums came up which described how one must install the headers for the release of the kernel you have installed. (this probably explained why VMWare Player stopped working when I upgraded – the kernel headers had changed).

I typed uname -r to find out what version headers to get, and then just passed this in to avoid typos.

Then when the question about the C header files came up, I typed in the following:

If you are trying this at home, you would substitute 2.6.15-23-386 for whatever version you have installed (output of the uname -r command).

After this, the install proceeded along and the very last step was to move my virtual machine file into the directory /var/lib/vmware/Virtual Machines.

I fired up the VMWare Server console, loaded my virtual machine and behold, Windows XP running inside my Linux box!

MacOSX solutions – Bootcamp and Parallels

My days running WinXP on Linux may be numbered because on thursday I’m expecting to receive a new Macbook which sports the new Core Duo chip. Using Apple’s Bootcamp software, I can run both MacOSX and Windows natively on the same machine.

However, because it’s a drag to have to reboot, I will probably run Windows in a virtual machine using Parallels. With the Core Duo processor, this will be faster than running it with VMWare on Linux.

Boston Macintosh Users Group

I’m looking forward to the BMac users group meeting tomorrow night because the topic is Windows on Intel Macs. Hopefully learn some tips and tricks, and also try to unload some old Mac gear that I’ve been trying to get rid of. Anyone want an Epson Inkjet printer or a Yamaha CD burner?

Technorati Tags: , , , , , , , , ,

Scraping a jazz events calendar

June 12, 2006 at 12:48 am

As mentioned in my last post building a live music calendar, I’m disappointed that the websites that list jazz events in Boston don’t offer the data as an RSS or iCal feed. One example of this is the WGBH Jazz Calendar, which has probably the most comprehensive listing of jazz events in the Boston area.

In my talk about Plone4Artists at EuroPython 2005, I mentioned a tool called Scrape ‘n’ Feed, which will scrape a website and generate an RSS feed. Well, it’s been a year since I first discovered this tool, and now I’m revisiting it to see if I can make it work. Here is my first foray into this scraping business.

ScrapeNFeed depends on Beautiful Soup and PyRSS2Gen which are easily installable on Ubuntu Linux with:

Once I installed these two packages, I downloaded the ScrapeNFeed.py script and created the following file ‘getwgbhfeeds.py’:

Run the script with ./getwgbhfeeds.py and it will output a file wgbh.xml , which is in the RSS 2.0 format. You can then open this file using your RSS reader of choice, and view all the Boston jazz events.

Once thing that I noticed is that some of the items in the list have an extra <br /> which means the title doesn’t get read in correctly. I’ll have to find a way to ignore the <br /> which I sure will be fairly simple with BeautifulSoup.

What’s next

At the OPMLCamp a few weeks ago, I met Mike Kowalchik, the creator of grazr. After seeing this tool, I immediately thought about how useful it would be for generating a browseable directory of event listings. You simply supply grazr with an OPML file, and it will then display all the RSS feeds and their entries. After I get a couple more event listing sites scraped, I’ll generate the OPML file and try them out with grazr.

Mike also mentions on his blog about Tom Morris’ idea about using grazr to ‘kill myspace’ by creating a better way for independent bands and artists to self promote using OPML. Note to self: follow up with Tom to discuss this idea further. I love the integrated MP3 player in his grazr box. Update: left him an Odeo message.

Technorati Tags: , , , , , ,

Mix n’ match hardware and operating systems

January 16, 2006 at 3:36 pm

With Apple’s decision to use Intel chips for the next line of Macintosh computers, the lines are blurring between which hardware can be used to run which operating system.

It’s reported that you will be able to run Windows XP on the new Intel Macs, and OS X can be dual-booted on a Thinkpad.

So now it’s just a matter of which kind of hardware you like, and you’ll be able to run both Windows XP and OSX on the same machine.

I prefer Apple hardware because it’s very high quality, and I admit, I’m a sucker for the design aesthetic.

However, I’m running Ubuntu Linux on a Dell PowerEdge SC430 server and using VMWare to run Windows XP. This way, I don’t need to reboot to switch to the other OS, and it’s fast too.

Technorati Tags: , ,