Sunday, May 13, 2007

Setting up a home server: Part One (Remote Access)

Recently I have been in the mood to get myself a good home multimedia, web and file server going. I have all of the networking set up already to allow me to do this and I have a spare machine knocking around which is ideal for the job. The machine in question is an AMD3200+ with 1mb RAM and 320gb of storage. My plan is to have this sat in my utility cupboard connected via WiFi to my network. I should then be able to access this nicely from my Mac.

The first job I have is installing an operating system on my server and allowing myself remote access. Ideally I should be able to get a remote desktop up and running straight from the Mac.

I decided that my operating system of choice would be Linux. Mainly because I don't want to pay for Windows. I decided that my distribution of choice would be Ubuntu. This is fairly simple to set up and so I won't bother going through that with you. For reference, when people read this hundreds of years in the future, the version I installed is Feisty Fawn (they have such stupid names).

After messing about with all of the new features in Ubuntu for a few hours I was ready to get down to some real work. By default Ubuntu comes with vino which should really offer me remote desktop access straight out of the box. It does do as promised but it is extremely slow and I don't like it one bit.

After a bit of digging around I found NoMachine's website. They offer server and client software that should be exactly what I need. This software is called NXServer and I decided that I would give this a go.

The first step was to install the Mac Client which was a piece of cake (you might need to install X11 for Mac as well). Next came the install on Linux. Not quite so simple. Firstly you will need to enable ssh access to your Linux box, to do this you need to type the following into a terminal:

sudo apt-get install openssh-server


Once this is done we can get on with installing the free NX Server software. There are three parts that are required for this. First you will need to install nxclient, then you will need nxnode and finally nxserver. These come in .deb format and the default option when downloading with Firefox is to install them so I just clicked OK.

Hopefully all of that went ok and you should now have nxserver installed. The next step is to test out our connection. On your Linux server enter into the terminal:

ifconfig


In here you should be able to find your IP address, you will need to know this to connect from the Mac.

In your Mac Applications folder you should be able to find a program called NX Connection Wizard.



Launching this will take you step by step through setting up your connection. You will need to enter the IP address in the host section of the first screen and choose Gnome as your default desktop but that's really all there is to it.



Once you are finished here you should be presented with a log in screen for your Linux username and password. Simply enter them and click Login.



If everything went well you should now have a nice Linux desktop.



Unfortunately everything is probably not as well as it looks. Try opening a terminal and typing something in. Not working as expected? It didn't work properly for me either.

This keyboard mapping issue seems to only appear if you use Gnome. If you are a KDE (or any other DE) user then everything is probably fine and you can stop reading at this point. Unfortunately, I really like Gnome so we will have to keep going.

There are a few things you need to check in X11 first. In the preferences you need to make sure that only the "Emulate three button mouse" option is selected. The others will cause more keyboard issues.



The only workaround I could find for this issue is to capture the keyboard settings from a remote login through the OS X terminal and then load them again through the nx client.

To do this we need to launch a terminal in OS X through X11 and ssh into the Linux box. You can open a terminal from the X11 applications menu and the command to use should be something along the lines of

ssh rjames@192.168.0.4


but replace rjames with your Linux username and 192.168.0.4 with your Linux box's IP address. Enter your password and we will be logged into the Linux server.

To record your keyboard settings issue the command

xmodmap -pke > keyboardsettings


This will save the keyboard layout to the file "keyboardsettings". We then want to create a little script to apply these keyboard settings. The following commands should do the trick (replacing rjames with your username):

echo "xmodmap /home/rjames/keyboardsettings" > setkeyboardsettings

chmod +x setkeyboardsettings


In your Linux window you should now be able to navigate to your home folder and double click the setkeyboardsettings file. Selecting the option to "Run" or "Run in Terminal" should now set your keyboard straight. You can open up any application and do some typing to test this.

You might still have some problems with your control and shift keys not working. In Linux you can fix this by editing the keyboardsettings file:

sudo gedit /home/rjames/keyboardsettings


As usual replace rjames with your username. Adding the following lines to the bottom of the file will enable your shift and control keys to function as they should.

clear shift
clear mod1
clear mod2
add control = Control_L Control_R
add shift = Shift_L Shift_R


If you log out then your keyboard will go back to being awkward and you will need to run the file again. If you wish to automatically run the file at login then it is quite easy to set up. Note that this will mess up the keyboard settings for this user if you log in from any other source.

In Gnome you want to navigate to your preferences and find "Sessions".



In here under startup items you want to choose "New" and enter as the command:

xmodmap /home/rjames/keyboardsettings


replacing rjames with your username. An alternative method is to just rename the keyboardsettings file to .xmodmap without doing anything in Gnome. If you do this you can also delete the setkeyboardsettings file.

mv keyboardsettings .xmodmap


I suggest logging out and in again to test that this has worked. If it has then you should have a nice easy way to access your Linux box while it is in the cupboard.

You can play about with things like the resolution in the menus in Gnome. I find this to be more effective than setting the options in NX Client. I usually set the resolution to be 800x600 in Gnome and then I can always increase the size of the Window in OS X. Once you have everything just the way you like it it's as if you were sat at the actual computer. You can even potentially open new sessions in the NX client and log back into your Linux box, or if you have the server installed, back into your Mac!

Enjoy!

Monday, April 23, 2007

What the hell is a rubric cube?

I think that the easiest way to answer this question is to start by looking at exactly what a rubric is. According to Google there are many many definitions of the word rubric. Most are to do with education. My favourite would have to be:
[A rubric is...] a heading, title of a printed matter, where the data is organized and united under one commonly related theme

In reality I chose the name because rubik's cube was taken, and this sounds much more clever than that!

Podcasts For Beginners

Having been without the internet for some time (for nearly a year) I had become somewhat dependent upon traditional media for my technology fill. Unforunately there's not much on the television worth watching these days so now that I am back on the net I am ready to give it the boot.

For those of you who are unfamiliar with podcasting you are really missing out. I think that the best way to think of podcasting is as a virtual T.V or Radio show. Every day/week/month/year the next episode will be waiting for you to watch when you want to watch it. No more missing your favourite show because it is on while you are at work, or on at two in the morning. The other great thing about podcasts is that anyone can set them up. Although this leads to a lot of really truly awful podcasts there are some gems out there that wouldn't even be given the time of day on television.

If you are interested in learning more about podcasts I think the best thing you can do is just get on with it (using my handy guide).

Step 1. Finding a client

The first thing that you will need is some software to subscribe to your podcasts with. I would wager that the most popular of these is Apples iTunes. There are, however, plenty of other programs that you can use, for instance Yahoo! have their own in beta.

Step 2. Finding a podcast

Now that you have your software you will need to find something to watch or listen to, you can find podcasts on the Yahoo! website mentioned above, or through the iTunes music store.

Once you have found a podcast that you want to listen to you just need to hit the subscribe button and you are away. Each time a new episode of this podcast is available it will be downloaded to your computer for you to listen to or watch automatically.

As I mentioned above you will find some really good podcasts and some really terrible ones. However, since most of them are free you can afford to shop around to find something that really fits you!