How to Safely Shutdown or Reboot Your Raspberry Pi
Title says it all, but there’s a bit more useful information too. Personally, I’ve always used “sudo halt”.
Title says it all, but there’s a bit more useful information too. Personally, I’ve always used “sudo halt”.
Finally time to start learning Python. I’ve done a fair amount of programming as a hobby and in education and am competent in Objective-C, and familiar with Java and PHP (and some others). All the Raspberry Pi stuff seems to favour Python, so I’ve taken the plunge and am using this book to learn. I’ll see how I get on and post a bit more on my experience with the book in a week or two.
Something I had overlooked in my previous entries was the lack of any guide to SSH (Secure Shell). This basically enables you to access a computer (including, of course, your Raspberry Pi) using a command line interface on another computer connected via a network - so like running the Terminal application directly on your Pi, but on another computer. This is very useful if you’re running your machine without a screen but need administer it without using VNC.
If you’ve installed Raspbian (and if you’re a beginner like me, I highly recommend you do) you’re given the option to switch this on the first boot up. If you didn’t, you can start the SSH service by entering the following into the Terminal, the reboot your machine:
sudo mv /boot/boot_enable_ssh.rc /boot/boot.rc
reboot
With the SSH service now running, you need the Raspberry Pi’s IP address to connect. Enter “ip addr show” and your IP address should be on the last line after the word “inet” (see here for more details).
Next you need to connect to your Raspberry Pi using an SSH client.
With your client open and ready to go, connect to your Raspberry Pi. The following assumes you’re using the default username “pi”. Enter:
ssh pi@xxx.xxx.xxx.xxx (where xxx.xxx.xxx.xxx is your Raspberry Pi’s IP address)
Then enter your password - the default is “raspberry”.
You should now see a different prompt, “pi@raspbmc:~$”, and you’re ready to enter commands. Type “ls” to list the files in the current directory. Type in any other commands you would in a regular Terminal window, such as in any of the guides on this Tumblr. When you’re done, just type “exit” and you’ll return to the normal prompt, such as “compname:~ username$”
Notes:
Eager to improve the performance of my Raspberry Pi, I installed the Raspbain-based SD card image today and have tested the tips/guides on this tumblr and all work as expected. I hope to continue to add more within the next week or so.
If you’re planning on using your Raspberry Pi as an appliance, you’ll want it to automatically login and load LXDE (the GUI). You may also want to do this if you are just tinkering around with the Raspberry Pi (as I am at the moment) and are using it without a monitor using a VNC server.
This eLinux Wiki guide explains how to do it, but if you want to start your VNC server instead, instead of adding startx to the bottom of the /etc/profile file, add the command you use to start your VNC server, e.g. “vncserver :1 -geometry 1024x728 -depth 24”.
EDIT: eLinix Wiki updated their entry, the above will no longer work. This is a better way.
Another post for Mac users. If you’ve followed my previous post to setup Avahi for AFP auto discovery, you might want to do the same for VNC.
To do this, add a new service under /etc/avahi/services. Using Terminal:
sudo nano /etc/avahi/services/rfb.service”<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_rfb._tcp</type>
<port>5901</port>
</service>
</service-group>sudo /etc/init.d/avahi.deamon restart”You should now see a “Share Screen…” button when you select your Raspberry Pi in the Finder side bar. Click this and the Screen Sharing app will open, enter your VNC password (leave the username blank). Other VNC software should be able to discover it also, though I’ve only tested it on Mocha VNC for iPad.

Strangely, the Apple Remote Desktop app still does not discover my VNC server using bonjour. I’ll update this post if I find out why.
Source: fusionsecurity.blogspot.co.uk
This post will only interest you if you’re using a Mac. AFP (Apple Filing Protocol) is the protocol Macs use to share files over a network. This post will guide you through setting this up using Netatalk. It will also cover setting it up to be easily accessible without the IP address.
To install Netatalk, simply use apt-get:
sudo apt-get install netatalk”You should now be able to access your Raspberry Pi from the Finder side bar and under Network (shift + command + k).

EDIT: The remainder of this post is now outdated and should not be required once you have installed netatalk.
This installs 2.1.2 of Netatalk which is not the latest (2.2.3 at time of writing) which may cause issues with using this for Time Machine and with Lion, although I have not experienced any issues on my two Lion machines. My attempts at installing 2.2.3 failed though I’m sure it’s possible.
When apt-get has finished, you can connect from the Mac:

sudo apt-get install avahi-daemon”.sudo update-rc.d avahi-daemon defaults”.sudo nano /etc/avahi/services/afpd.service”. Enter (or copy/paste) the following: <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group> sudo /etc/init.d/avahi-daemon restart”
Once you’ve copied the Linux image to your SD card, be sure to resize the partitions to ensure all the SD card’s space is available (or you can create an additional partition). Follow this eLinux Wiki guide, which explains how to do it from Linux and from the Raspberry Pi itself. If, like me, you’re not running Linux on your main machine, follow the the steps in section 5.2.
The RPi version of Debian comes with the Midori web browser, but you might want something a bit more mainstream, so try why not Chromium.
To install simply run “sudo apt-get install chromium-browser” from the command line and it will appear under Internet in the Application menu (icon in the bottom left corner).