Archive for the ‘Computers’ Category

Wearing a new Mac with the DG394PN Router

Friday, March 21st, 2008

Finally giving into the four-year urge to buy a Mac after this month’s refresh, I’ve had no end of troubles. It seems like I happen to have a router from the one range that Macs don’t play well with.

Connecting to my network

Just would not work. For two hours. Two whole hours. I eventually traced it to the MAC filtering on my router. I’m not sure why Macs and MAC filtering can’t go together. Turning off MAC filtering (which I planned to do anyway, in favour of WPA security) sorted the problem out straight away. There are still days where the Mac takes a minute or so to connect, but considering the boot time of a Mac is about 10 seconds, compared to my old PC laptop’s 6 minutes, I’m willing to forgive.

Connecting to MSN

Turns out Netgear DG934PN firmware 1.05.36 has a bug in it which conspires to not allow clients on the network to connect to MSN via anything but sucky, sucky HTTP. The official Windows client is robust enough for me to have never noticed. Adium was not. A painful downgrade experience to 1.05.35 fixed this.

Not without me checking my laptop thoroughly, trying three or four different clients, checking with my ISP…

What’s Left?

Things left to do:

  • Figure out where my install of Java went to.
  • Figure out how to tag my MP3s automatically and download album art.
  • Figure out how to stop looking so damn cool with the pro balanced on my lap.

How To: Copy Files Off of Your LinkStation Pro via USB

Friday, January 4th, 2008

My LinkStation Pro NAS is great for holding all my files, and really has made a small portion of my life more convenient. The only fly in the ointment is transferring huge files to/from it over my wireless network can take ages. Copying 8 gig of data would, as a relevant example, take me the best part of the rest of my evening. Maybe the USB ports at the back can be put to good use?

The LinkStation can’t be connected to a PC via USB (as far as I can see). It can, however, connect to other USB harddiscs. It does this to expand storage, but also gives us the ability to transfer data via the USB port - which is so much quicker. To do this, we’ll need to connect to the NAS via Telnet (the web interface doesn’t support using USB thumb-drives as a transfer medium), detect and manually mount the USB drive.

First, to telnet in we’ll need to enable Telnet on the NAS:

  1. Download ACP Commander from here.
  2. Use ACP Commander using the command java -jar acp_commander.jar -t <linkstation_ip>.
  3. Telnet in. Look! It’s Linux!
  4. The standard username is root, with no password. Note this gives you complete access to the software innards of the NAS. You don’t want to do anything rash, like delete random files, in this mode.
  5. Poke about if you’re interested.

Now we need to find out where the USB thumb-drive is (obviously, your thumb-drive needs to be stuck into one of the ports at the back):

  1. Run the command dmesg | grep -i "SCSI device". The output will look something like:

# dmesg | grep -i “SCSI device” SCSI device sdb: 16121856 512-byte hdwr sectors (8254 MB) SCSI device sdb: 16121856 512-byte hdwr sectors (8254 MB)

We’re interested in the bit that says sdb. Yours may be different (possibly sda). This is the location of the USB drive in the dev directory.

Okay, to mount it:

  1. Create the directory /mnt/usbdrive to create our mount point.
  2. Run the command mount -t vfat /dev/sdb /mnt/usbdrive.

The USB drive is now accessible from within Linux on the NAS. You can copy files to and from it using the standard Linux cp command.

Unmounting the USB drive can be done via umount /mnt/usbdrive.

(Thanks to this site, here, for all the info).

How To: Get Syntax Highlighting Working for Vi in Ubuntu

Wednesday, January 2nd, 2008

If you can’t get syntax highlighting to work in a new Ubuntu install, it’s probably because the standard Vim install in Ubuntu is from the vim-tiny package. This is a cut-down version of Vi that does very little but edit files. If you want full Vi (with syntax highlighting), you need to uninstall the vim-tiny package and install vim-runtime:

  1. sudo apt-get update - may as well make sure we’re aware of the latest package updates
  2. sudo apt-get remove vim-tiny - we’re going to replace this package. You’ll be asked if you want to uninstall ubuntu-minimal. It’s safe to do this (explanation below).
  3. sudo apt-get install vim-runtime - this is quite a big package (20 meg or so).

Now we have the latest version of Vim. The command :syntax on will turn on syntax highlighting. To have it on automatically for yourself, create the file ~/.vimrc and enter the text syntax on. You can also edit /etc/vim/vimrc (as root) and change the appropriate lines to make the settings global instead. You can also set whether the background is dark or light (which affects the colour scheme).

When uninstalling vim-tiny, you’re prompted about the removal of ubuntu-minimal. This is an umbrella package that has lots of dependencies to packages needed for a basic workable Ubuntu install. If you uninstall one of the packages, you’ll need to uninstall the umbrella package too. This doesn’t affect the other dependencies so it should be safe.

As an aside, it seems to work better over Putty too. Happy days!

How To: Get Ubuntu To Stream Videos To Your Xbox360 With UShare

Wednesday, December 26th, 2007

The recent Xbox360 fall update gives users the option to view DIVX films. If, like me, you have a huge collection of DIVX movies stored on a separate Linux machine, you’ll want to find a way to get the linbox to deliver these movies to your Xbox (trust me, it’s great). The particular tool I’ve used to do this is uShare (part of the GeeXBoX distro - specialising in HTPC implementations).

So, to get started, install uShare. The uShare website (here) gives details on how to do this. Installing uShare using apt-get will set up three files (amongst others) on your Ubuntu machine:

  • /usr/bin/ushare - the uShare binary file
  • /etc/ushare.conf - the uShare configuration file
  • /etc/init.d/ushare - the uShare daemon start/stop script

We can get uShare to start serving our files immediately to the Xbox with the command

uShare -D -x -c /media/directory (where /media/directory is the path to your files).

This isn’t very neat though, so read on if you want to integrate uShare properly with your Ubuntu install.

We now need to make sure uShare knows which files to serve and to make it operate in Xbox 360 compatibility mode. Bring up your text editor (using sudo) and open up /etc/ushare.conf. Change the line ENABLE_XBOX= to USHARE_ENABLE_XBOX=yes. Set USHARE_DIR to the path(s) of the files you want to serve. If you want web access, change the line ENABLE_WEB= to USHARE_ENABLE_WEB=yes and set the USHARE_PORT.

The uShare daemon script also needs to be amended slightly to tell uShare to use the config file we’ve just changed. Using your text editor (again with sudo), open up /etc/init.d/ushare and add a new line under the CONFIGFILE=/etc/ushare.conf that reads USHARE_OPTIONS="-f $CONFIGFILE" (running uShare straight on the command line will automatically open that config file. For some reason, the command used in the script doesn’t. Thanks to [this forum](http://ubuntuforums.org/showthread.php?t=631213&page=7 for the solution)).

Once this is all done, restart the uShare daemon by running the command

sudo /etc/init.d/ushare restart.

If you load up your Xbox 360 and go into the Videos section under the Media blade, you’ll see your new media server listed as “uShare” (press X to change video source if not). Happy viewing!

Still need to resolve the following issues:

  1. uShare does not differentiate between media types, so all my movies are appearing as music as well. Music also isn’t organised into albums.
  2. Only the first directory I’ve specified for sharing in the configuration file is being scanned and delivered.

Conclusion - Use uShare if you want to just deliver movies. For delivery of multiple media types, including a large music collection, uShare can’t seem to handle it just yet.

What To Do If You Leave Your Ubuntu 7.10 Server Install CD In Your Mac Mini

Wednesday, December 26th, 2007

You’d have to be pretty dumb to do this. In fact, if you have done it, I wouldn’t recommend you tell anyone lest they laugh at you.

So a “friend of mine” left their Ubuntu 7.10 Server Install CD in their mac mini with Ubuntu 7.10 Server already installed and configured. This lead to the following path of shame:

  1. He turned off his mac mini, moved it to another part of his room and turned it back on.
  2. He forgot about it for a few weeks.
  3. He decided to spend Christmas evening getting his mac mini to deliver media to his xbox 360.
  4. He couldn’t figure out why his mac mini wasn’t on the network.
  5. After rebooting it again, he realised the CD was in the drive and there was no manual eject pinhole on the chassis! (Gah!)
  6. Nor would the PC boot from the “First Hard Drive” (some bootup parameter not set right perhaps?)

The only solution I could find was to:

  1. Choose to install the CD onto the harddisc.
  2. Press escape within the installer to give a list of various install steps.
  3. Choose to detect the CD. Get to the point where the installer starts configuring the network.
  4. Press escape again to go back to the install steps.
  5. Choose to detect hardware (your harddiscs). Get to the point where the installer starts configuring the network.
  6. Press escape again to go back to the install steps.
  7. Choose to bring up a shell.
  8. Running fdisk -l will show that the Mac Mini harddisc with the current Ubuntu install is on /dev/sda1.
  9. Mount the harddisc to an accessible node by running the command /mount -t ext3 /dev/sda1 /target.
  10. Run the command /target/usr/bin/eject /cdrom.

Et voila! Couldn’t have been easier now, could it? Well, a proper Linux expert could probably find an easier way, but since all the Internet could advise was for me to disassemble the Mini (erm, no), I’m calling this a win.

Heh heh heh, at least South Park is still funny.

Media Server: A New Hope

Saturday, December 8th, 2007

With all the different ways to access music, it makes sense to centralise my collection so it can be accessed from anywhere in the house. Same for videos and pictures. And it’s always fun to start a new computer project which I probably will lose interest in a few weeks before completion. So far I’ve selected a vague outline on the software I’ll need and, from that, the hardware. Progress can be tracked here.

Jay’s also creating his own media server which’ll be part-bespoke. Details are on his site.