Sunday, June 2, 2013

Setting the host (computer) name

So, my first challenge was setting the  network name of the Pi.  It arrived as raspberrypi, I wanted to change it to something different - in this case, pi01 (just in case I get more - lots more!)

I tried looking around for some kind of pretty graphical shell to let me do this kind of thing, but failed to find it.  Instead, I had to edit the file that contained the name.

You need to have "root" privileges to do that.  By "root privileges" I mean that you have to allow yourself power to change (and possibly break) the system.  Normally you run without these privileges, which makes it harder to break the system.

So, you enable root privileges by starting your command line with the word sudo.

To change the computer name, I have to edit the file /etc/hostname.  I am using an editor called vi to do this, and so I opened a LXTerminal and typed the following command:

sudo vi /etc/hostname

Note that you might want to use another editor - nano is a popular one.  In that case, your command should be

sudo nano /etc/hostname

I could then change the hostname to whatever I wanted (in my case, pi01).

I saved the file, and rebooted - now my pi shows up on the network with the name pi01!

Saturday, June 1, 2013

Alan's First Pi

My brand new Raspberry Pi arrived today!

It shipped from Amazon in a big box.  Inside that, three very little boxes.

One of the small boxes contained an SD card, pre-formatted with Raspian "Wheezy" installed on it.  There are several other operating systems available for the Pi, but this is the one provided by the Raspberry Pi foundation and so it seems a good place to start.

The second box - a simple white cardboard box - contained the transparent plastic case I had ordered.  And the third?  The Pi itself.

It's pretty impressively small, really.  Approximately 3 x 2 inches, in size, this is a full-featured computer that runs the Linux operating system.  All it requires is the addition of an SD card and a few cables, and it's ready to go.

In this blog I hope to go through some of the steps I have taken in order to get the Pi to be a useful machine on my home network.  I will share the things that  I do in the hope that someone else may find them useful.

What do I mean by "a useful member of the network"?  Well, I have three main things that I want to be able to do with this device:

  • Make it a VPN server, so that I can log into this server from a device anywhere in the world, and have it appear that that device is on my home network.


  • Hook up a USB disk drive, and turn the Pi into a NAS (Network Attached Storage) device.  In particular, that would have two main purposes:


  1. Allow me to put all my movies and videos onto the disk, and serve them to any computer or television on my network using DLNA
  2. Act as an on-site backup for my Windows computers.  In particular, to back up the files on my main household machine, which runs Windows 8.  I would to use Windows 8's "File History" feature, which allows you to "go back in time" and see how the disk looked at one-hour intervals in the past (any similarity to Apple's Time Machine feature is, I am sure, entirely coincidental).


Both of these disk-related uses can tolerate the comparatively low disk speeds that I expect from a USB-attached disk.

So, that is the plan - I wonder how it will go?

So far, it's going okay - I have got the Pi booted, and I am typing this blog entry on it.  I am going to have to go to a Windows machine to edit the pictures, but maybe in time I shall choose to make pictures sing the Pi too... who knows?