Resizing your Debian root fs on Raspberry Pi

Once you’ve copied one of the Debian disk images to an SD card, you may have noticed that the disk image is only for 2GB and you have a lot of unused space on your SD card. The raspi-config util has an option (Expand Root FS) to resize your root partition for you. There’s also plenty of other utils to do the job. I used gparted from a gparted LiveCD booted on my Mac to resize my partition and it worked well.

Configuring a static IP on Debian Wheezy for Raspberry Pi

$ sudo nano /etc/network/interfaces

Change:

iface eth0 inet dhcp

to

iface eth0 inet static

Below this line enter the following, replacing x where necessary for your network config.

address 192.168.x.x
netmask 255.255.255.0
network 192.168.x.0
broadcast 192.168.x.255
gateway 192.168.x.x

Things you always forget: XML Character Entities

Certain characters break XML or need to be escaped in HTML so they are rendered literally and not interpreted themselves as markup. There’s a few predefined character entities that are commonly used:

  • &lt;      :     <
  • &gt;     :     >
  • &amp; :    &

For other characters though, you sometimes need to use their Unicode encoded value. For example to literally display { and } in a JSP or JSF page (since they are used in EL syntax ${} and #{} ), you can use their unicode values like this:

  • &#x007b;     :     {
  • &#x007d;     :     }

There’s many unicode ref charts online, here’s one that I’ve used:

http://en.wikibooks.org/wiki/Unicode/Character_reference/0000-0FFF

Removing a passphrase from an OpenSSH pub key

I’d set a passphrase on an OpenSSH key that I use to connect to a git repo on my local server. It started to get annoying, and more annoying with any other tool that I tried to use with the same key as it’s seems not all tools are setup to handle the prompting for the keyphrase.

Quickest workaround: remove the passphrase with ‘ssh-keygen -p’

– when prompted give the name of the pub/priv keypair (eg id_rsa), give the current keyphrase, and then when prompted for the new keyphrase, just hit return and again to confirm.