Educating the world

Our blog has over 10,000 readers a month

Nepal Day 1 - Heathrow, Mumbai, Kathmandu

July 17th, 2013

On the 29 March 2013 I caught a flight from London Heathrow to Mumbai with Jet Airways. They were late setting off but I wasn’t worried because I only had a 10 hour stop over waiting for me.

When we tried to enter the transit area of the airport we where told we couldn’t enter because of blar, blar, blar so we sat on the floor waiting for something to happen. I was there for about an hour but it gave me a chance to vet the other passengers and find out who else was going to Kathmandu.

I formed a little support group of other Kathmandu‘ers. Although 10 hours sounds a lot you’d be surprise how quickly it goes when you are trying to get to know 3 new people. Rachel a student doctor on an elective. Jen, who had helped out at the Olympics was visiting some friends. She was a strange new age young woman who lived in a van. Also visiting friends was an accountant.

Mumbai airport was okay for shopping, although we did think that $20 (US) for 4 cups of tea was a bit steep. It was also full of mosquitoes which made it feel dirty. I don’t think I’ll transit through Mumbai again.

On arriving at Kathmandu Airport I had to go through immigration. I sorted out my Nepalese visa when I was in England so I joined the queue with 3 people in it, instead of the queue with 300!

The Angel Holiday notes said that I’d be attacked by taxi drivers the moment I stepped outside. So I used an old tourist trick. I hovered inside the entrance and waited for a patsy. An arguing couple came along and so I let them go ahead of me. The herd of taxi drivers took the bait. I skirted around the outside and exited to the cacophony of cars and people.

While I was distracted by the myriad of signs being flashed at me, a stooped man tried to take my bag. When I turned to look what was going on he said, “I carry your bags". I’d just caught sight of the Angel Holiday’s sign, so thanked him and hastily headed over to it. The crazed porter followed me saying “I carry, I carry". The funniest part was when I got to the taxi, he wanted a tip, for doing nothing!!

Pabi was a delightful young woman whose calm demeanour put me at ease. One thing I immediately noticed was that there wasn’t a single car that didn’t have a considerable amount of damage. Pabi sat in the front and I tried to sort out the seat belt in the back, it’s safety first with me! It was hidden behind the seat so the taxi driver disassembled the car and dug it out. The clicker didn’t click anyway so it was useless!

The drive was amazing, frightening, extremely dusty and bumpy. Did I say bumpy? Really, really bumpy, there was no road for some of the journey. The smell fluctuated between in car air freshener, dust, more dust, sewage, more sewage, I’m gagging in the smell sewage to cooking.

Pabi pointed out various sights as we weaved through the traffic. The hotel was about 30 minutes so I listened to her giving the tourist spiel and enjoyed the spectacle of Kathmandu.

The hotel was lovely and seemed very separate from the world outside. It felt nice and safe. Pabi had put Jon and I together for room sharing. He was coming tomorrow so I picked the bed by the window. After unpacking, despatching an enormous cockroach in the bathroom and showering I headed back to the reception to see if I could find any of other Angel Holidayers.

Steve, the operator of the tour, was sitting in the garden doing his emails. Spent most of the afternoon chatting to him. He was a Welsh documentary broadcaster for the Beeb and was very well travelled with plenty of funny observations.

Towards the end of the afternoon Clare, Lisa and Simon came back from town. Clare and Lisa were fellow City Socialisers from Reading and Simon was a tall Mancunian, a few years younger than me who loved flowery shirts, music and spiritualness.

Steve had been going on all afternoon about the steak that the restaurant in the hotel cooks. I was staying in for the first night as I’d been watching films on the journey over instead of sleeping.

We all sat in the terrace bar overlooking Kathmandu for the evening and headed to the restaurant when the sun went down. I took Steve’s advice and I have to say it was pretty bad, not what I had been lead to believe. All my friends had said don’t eat the meat, just go vegetarian for your trip, so I was just happy to be able to ignore the advice.

Back to the terrace bar to play who can stay awake the longest. Several beers later and Rob and I are trying to explain to the girls how time travel is possible, according to the theory of relativity, don’t ask me how that came up.

Photos on my FaceBook page.

Installing Oracle Java 8 on Raspbian wheezy

July 16th, 2013

I had great trouble installing Oracle Java on my Raspberry Pi due to the liblji.so problem. The main Raspberry documentation tells you that you must use the soft-floating point (SFP) version of “wheezy” in order to run Oracle Java as it doesn’t have a version compiled for using the hardware floating-point (i.e. normal Raspbian).

It was only after I had re-installed everything using the software-floating point
versions (see Installing Oracle Java 7 on Raspbian wheezy) that I stumbled across a forum post that said there was a beta of Oracle Java 8 bundled with the JavaFX libraries that was compiled using the normal hardware floating point.

So here are the instructions for that.

  1. Using the instructions Installing and setting up a Raspberry Pi, install Raspbian “wheezy”, 2013-05-25-wheezy-raspbian (at the time of writing).
  2. Navigate to the JDK 8 Early Access Releases, accept the agreement and download the Linux ARM HardFP.
  3. Copy the file to the Raspberry Pi (from the command line).

    scp jdk-8-ea-b97-linux-arm-vfp-hflt-03_jul_2013.tar.gz pi@192.168.0.69:/home/pi

  4. Open a session to the Raspberry Pi.
  5. Do my sudo bash trick again to open a root shell. This will stop us having to write sudo in front of everything. It also has the handy benefit of separating the history of your sessions with extraneous commands that you wouldn’t normally use.
  6. Also there now! Create somewhere for Oracle Java to live and uncompress the downloaded zip file.

    mkdir -p /opt/java
    cd /opt/java
    tar -xvzf /home/pi/jdk-8-ea-b97-linux-arm-vfp-hflt-03_jul_2013.tar.gz

  7. Now we’ll tell the system about the Oracle Java 8 installation. (Note double minus on the –install and ‐set).

    update-alternatives –install “/usr/bin/java” “java” “/opt/java/jdk1.8.0/bin/java” 1

  8. We must also tell the system that we want it to use this version of Oracle Java 8 by default.

    update-alternatives –set java /opt/java/jdk1.8.0/bin/java

  9. Now test:

    root@drswifty:/home/pi# java -version
    java version “1.8.0″
    Java™ SE Runtime Environment (build 1.8.0)
    Java HotSpot™ Client VM (build 25.0-b97, mixed mode)

  10. The Java that has been installed here is the Java Runtime Environment (JRE). So when you type java you’re getting the JRE version and not the Java Development Kit version and as a result you are not getting javac either. This is ok because all the applications on the platform will run under it. As developers we need the JDK version so we’ll have to rejig our PATH environment variable so it picks up the JDK’s version of Java before the JRE’s. Edit ~/.bashrc and add the following lines. (Note double minus on the –list)

    export JAVA_HOME=`update-alternatives –list java | sed ’s>/bin/java>>’`
    export PATH=$JAVA_HOME/bin:$PATH

  11. Log out and log back in again and you should now have access to the Java Development Kit and the compiler tools e.g. javac.
  12. Give yourself a pat on the back!

Installing Oracle Java 7 on Raspbian wheezy

July 15th, 2013

I had great trouble installing Oracle Java on my Raspberry Pi due to the liblji.so problem. So here are the instructions to get Oracle Java 7 up and running on a Raspberry Pi from scratch.

You should know that the build we are going to use, uses a software floating point algorithm instead of the on-board hardware it is as a result slower than the other plain wheezy version. You should consider using the OpenJDK which is installed on the normal wheezy.

  1. Using the instructions Installing and setting up a Raspberry Pi, install Soft-float Debian “wheezy”, 2013-05-29-wheezy-armel (at the time of writing).
  2. Navigate to the Java SE Downloads and click through JDK and get a copy of Linux ARM v6/v7 Soft Float ABI (jdk-7u21-linux-arm-sfp.tar.gz).
  3. Copy the file to the Raspberry Pi (from the command line).

    scp jdk-7u21-linux-arm-sfp.tgz pi@192.168.0.69:/home/pi

  4. Open a PuTTY session to the Raspberry Pi.
  5. Do my sudo bash trick again to open a root shell. This will stop us having to write sudo in front of everything. It also has the handy benefit of separating the history of your sessions with extraneous commands that you wouldn’t normally use.
  6. Also there now! Create somewhere for Oracle Java to live and uncompress the downloaded zip file.

    mkdir -p /opt/java
    cd /opt/java
    tar -xvzf /home/pi/jdk-7u21-linux-arm-sfp.tgz

  7. Now we’ll tell the system about the Oracle Java installation.

    update-alternatives –install “/usr/bin/java” “java” “/opt/java/jdk1.7.0_21/bin/java” 1

  8. We must also tell the system that we want it to use this version of Oracle Java by default.

    update-alternatives –set java /opt/java/jdk1.7.0_21/bin/java

  9. Now test:

    root@drswifty:/home/pi# java -version
    java version “1.7.0_21″
    Java™ SE Runtime Environment (build 1.7.0_21-b11)
    Java HotSpot™ Client VM (build 23.21-b01, mixed mode)

  10. The Java that has been installed here is the Java Runtime Environment (JRE). So when you type jave you’re getting the JRE version and not the Java Development Kit version and as a result you are not getting javac wither. This is ok because all the applications on the platform will run under it. As developers we need the JDK version so we’ll have to rejig our PATH environment variable so it picks up the JDK’s version of Java before the JRE’s. Edit ~/.bashrc and add the following lines:

    export JAVA_HOME=`update-alternatives –list java | sed ’s>/bin/java>>’`
    export PATH=$JAVA_HOME/bin:$PATH

  11. Log out and log back in again and you should now have access to the Java Development Kit and the compiler tools e.g. javac.
  12. Give yourself a pat on the back!

Can't install Java 7 on Raspbian wheezy

July 15th, 2013

Crumbs, I thought it would be a simple job to install Oracle’s Java 7 on a Raspberry Pi but it wasn’t.

I started with an installation of Raspbian “wheezy”, uninstalled all the openjdk packages and installed Oracle Java. On typing java -version, I received the error:

java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

A lot of reading later and I discover the problem is caused by a conflict in the binaries used by the operating system and the Oracle java executable. The Raspberry Pi hardware comes with hardware floating point (HFP) and as a result all the binaries that come with Raspbian “wheezy” take advantage of that. The Oracle java executable, however was compiled with options that use software-based floating point (SFP). This mismatch means that although the file JDK_HOME/jre/lib/arm/jli/libjli.so exists, the operating system is unable to understand it properly and as a result continues on it’s search to find one that will work. Eventually it gets to the end of the list and reports that it couldn’t find libjli.so.

So what can be done? Reinstall everything! Oracle does not yet provide a HFP build of Java. The only option is use a special version of Raspbian called Soft-float Debian “wheezy”. Then try installing Java 7 again.

Installing and setting up a Raspberry Pi

July 15th, 2013

I’m doing this on the Mac this time because it comes with loads of tools pre-installed to help. I’m also assuming that the Raspberry Pi has a keyboard and an active network connection (wired or wireless) with a DHCP server floating about somewhere.

I am assuming that the Raspberry Pi has a keyboard and an active network connection (wired or wireless) with a DHCP server floating about.

  1. We need to install the operating system on the SD card. For this we will need to be the root user. You could prefix all the commands with sudo, but I find it easier just to sudo bash which will run another shell with elevated privileges.

    MrN-host:RaspberryPi mrn$ sudo bash
    Password:
    bash-3.2#

  2. Insert the SD card. The Mac will put an icon on the desktop representing the SD cards filesystem. Before anything we need to take control of the SD card.
  3. On the command line type: mount

    /dev/disk0s2 on / (hfs, local, journaled)
    devfs on /dev (devfs, local, nobrowse)
    map -hosts on /net (autofs, nosuid, automounted, nobrowse)
    map auto_home on /home (autofs, automounted, nobrowse)
    /dev/disk1s1 on /Volumes/NO NAME (msdos, local, nodev, nosuid, noowners)

  4. The name of the icon on the Desktop was “NO NAME", but it could be different for you if you have renamed the volume. Look for the device with the same name. In my case /dev/disk1s1.
  5. We unmount the SD card:

    diskutil umount /dev/disk1s1

  6. Type mount again and the “NO NAME” device should have disappeared.
  7. The /dev/disk1s1 is the name of the partition so /dev/disk1 is the name of the SD card’s device. We’ll need that later.
  8. Now, go to the Raspberry Pi download page and get a copy of the Raspberry Pi operating system. For this example I’ll use the recommended operating system Raspbian “wheezy” (2013-05-25-wheezy-raspbian). If it is possible, get the torrent version; there was 200 in my swarm and it downloaded in a few seconds.
  9. Unzip the download:

    unzip 2013-05-25-wheezy-raspbian.zip

  10. Now the fun bit. We’re going to lay the downloaded file on to the SD card, well on to its block device. It took 15 minutes to copy the 1.8GB disk image on to the SD card.

    # dd if=2013-05-25-wheezy-raspbian.img of=/dev/disk1 bs=1m
    1850+0 records in
    1850+0 records out
    1939865600 bytes transferred in 1128.683885 secs (1718697 bytes/sec)

  11. The disk image that has been laid down on the SD card contained a single partition which when completely written was recognised by the Mac and automatically mounted. A boot disk icon should appear on the Desktop.
  12. Drag the boot disk icon to the Trash.
  13. Pull the card out of the Mac and place into the Raspberry Pi and switch it on.
  14. Boot up the Raspberry Pi and it should drop you off at a menu screen where we set up a few things.
  15. First up we will check and install the latest version of the menu screen or raspi-config. Use the up/down keys to go down to 8 Advanced Options and hit return. Now go down to A5 Update. The menu will restart running the latest version.
  16. Now we’ll configure a few things to help us along the way.
  17. Most important is to change the default password. Not for any security concerns but because the default password is “raspberry” which is not only too long but also plays havoc with my dyslexia. I can never remember if it’s “bp” or “pb", anyway I digress. I usually just use “pipi". Go into 1. Change User Password and follow the instructions.
  18. During the course of our installations and set up we may need to reboot a few times so we don’t want it going in to the windows environment each time we do. Switch it off with 3 Enable Boot to Desktop.
  19. As we are good to the world also consider using 6 Add to Rastrack. It just tells a magic server that you have installed a Raspberry Pi so they can do stats and things. There’s no registration.
  20. Penultimately go to 8 Advanced Options and then A2 Hostname. The current hostname is raspberrypi which is a bit long. You could end up writing this everywhere. So I’ll just name it after the owner drswifty.
  21. And finally select 1 Expand Filesystem. This takes the 1.8GB disk image you installed and expands it to fill the whole SD card giving you access to the other 14GB!. This can take a while, about 20 minutes for a 16GB card.
  22. When you exit with Finish, it will ask you if you want to reboot. Select No. We still need to find out what its IP address is so we can continue remotely from our favourite laptop using PuTTY.
  23. You will be dropped at the command prompt so issue the command ifconfig. Your external address will be listed in either the eth0 or wlan0 interfaces.

    eth0 Link encap:Ethernet HWaddr b8:27:eb:9b:6b:84
    inet addr:192.168.0.13 Bcast:192.168.0.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:170 errors:0 dropped:0 overruns:0 frame:0
    TX packets:113 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:15605 (15.2 KiB) TX bytes:14637 (14.2 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    wlan0 Link encap:Ethernet HWaddr 4c:60:de:61:61:04
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

  24. Finally, reboot the machine so the hostname change comes into effect.

    sudo reboot

  25. When the machine reboots login as pi with whatever password you selected.