Archive for February, 2010

Adding A Repository

22, February 2010

To add the Medibuntu repository, see here here for details or copy and paste this command into a [Terminal];

sudo wget –output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get –quiet update && sudo apt-get –yes –quiet –allow-unauthenticated install medibuntu-keyring && sudo apt-get –quiet update

all on one line.

Ctrl+Alt+Backspace

21, February 2010
Ctrl+Alt+Backspace (i.e. the shortcut which was used to restart the X server) has to be enabled in a different way with respect to previous releases of Ubuntu.

This is due to the fact that “DontZap” is no longer an option in the X server and has become an option in XKB instead.

Using GNOME

Goto [System], [Preferences], [Keyboard], select the [Layouts] tab and click on the [Layout Options…] button. Select the [Key sequence to kill the X server] option and enable “Control + Alt + Backspace” by ticking the box, then select [Close] and your done.

Jalbum

21, February 2010

 

Update: Jalbum is now provided as a deb, see my latest post Jalbum, create Photo web albums

This is the software I use to create my photo album on the web. I used it when I ran XP and was glad to see it came as a Linux option. It automatically creates the album in variety of skins and there is then an option to FTP the result direct from the program to your site. Visit the jalbum.net site and if you decide to user this program, download the file [JAlbuminstall.bin] to your [Home] folder. JAlbum needs Java 1.5 (or later) virtual machine to run so first we need to open the [Synaptic Package Manager] search for and install sun-java6-jre or later, from the listed packages and install it. Assuming you downloaded the JAlbum install file to your [Home] folder, in a [Terminal] type or copy and paste;

./Jalbuminstall.bin

This will open the JAlbum installer which will guide you through the installation. When it asks which Java VM to use, select the java6 version. If the box is empty as mine was, tell it to search for a java VM which took a while then select it an move on. If this still fails [as mine did on Intrepid] open a [Terminal] type or copy and paste;

sudo update-alternatives --config java

which should give you an output like this;

There are 2 alternatives which provide `java’.
Selection Alternative
———————————————–
* 1 /usr/lib/jvm/java-6-sun/jre/bin/java
+ 2 /usr/lib/jvm/java-6-openjdk/jre/bin/java<
Press enter to keep the default[*], or type selection number:

Select java-6-sun and note the path to it i.e.

/usr/lib/jvm/java-6-sun/jre/bin/java

now run the Jalbum installer again

./Jalbuminstall.bin

and use the [Choose Another] option to navigate to

/usr/lib/jvm/java-6-sun/jre/bin/java then click on [Next]

When it asks where do you want to install it will give the default path of /home/user/Jalbum I change this to /home/user/.Jalbum to make this folder hidden the “.” does this but still keeps it within your [Home] folder. The program can now be run from the link in your [Home] folder.

Sheevaplug – automount USB drive at boot

17, February 2010

The problem with the Sheevaplug is that it boots too damn fast and the USB drive is too slow to be available for the fstab mount.

The solution, see here for my post on setting up the fstab file to mount your USB drive. When you edit the fstab on the Sheeva you will find it empty but you should end up with an entry similar to this.

# UNCONFIGURED FSTAB FOR BASE SYSTEM
/dev/sda1 /mnt/usbdrive ext3 auto,user,rw,exec 0 0

My usb drive is mounted at /dev/sda1 and I created a mount point called /mnt/usbdrive, the drive is formatted as ext3 but you can replace this with the format of your drive or just replace with the word auto for it to check.

Once you have your fstab in place you need to create a script which will slow down the boot for the USB drive to start. Thanks to restamp on the plugcomputer.org forum see here for the solution.
First navigate to the init.d folder, in a [Terminal] issue the command;

cd /etc/init.d

then using whatever text editor you have installed [I added nano], open a file called wait4usbdrive with;

nano wait4usbdrive

then copy into it restarts script;

#!/bin/sh
#
# If /etc/fstab has been configured to mount a USB drive, pause to give
# the USB drive devices time to show up in /dev. If this is not done,
# checkfs.sh will fail, requiring manual intervention…
#
case "$1" in
start)
grep -q ^/dev/sda /etc/fstab &&
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
[ -b /dev/sda ] && exit 0
sleep 1
done
exit 1
;;
stop)
;;
esac

Then make it executable with;

chmod +x wait4usbdrive

Then link it to the rcS.d folder with this command;

ln -s ../init.d/wait4usbdrive /etc/rcS.d/S25wait4usbdrive

Now you can shutdown and restart the plug and the USB drive should now auto-mount. My USB drive is a 1.5 TB iomega with it’s own power supply.

Sheevaplug – install get_iplayer

10, February 2010

With help of Percival P Plugsley’s post here

I managed to get get_iplayer working on my Sheevaplug with Ubuntu jaunty installed on it’s internal flash memory.

You need to visit the download page at linuxcentre.net and download the get_iplayer perl script to a folder of your choice i.e c/root/

As you cannot get the mplayer app in the Sheevaplug repositories you need flvstreamer from, here which you will need to compile for the Sheevaplugs ARM architecture. First download the flvstreamer source flvstreamer-1.9.tar.gz from http://mirrors.aixtools.net/sv/flvstreamer/source/ and save it to the Sheevaplug unpacking it into a directory of your choice i.e. /root/flvtemp

Now we need some other packages installed, in a [Terminal]

sudo apt-get install build-essential
sudo apt-get install ffmpeg
sudo apt-get install lame
sudo apt-get install perl
sudo apt-get install libwww-perl

I like to use nano rather than vi, so I also added;
sudo apt-get install nano

now move to the directory you saved the source to;

cd /root/flvtemp

create a new file called MakefileARM

sudo touch MakefileARM
now open it with
nano makefileARM
Then add the following to the file;

############## start #######################
CC=gcc
CXX=g++
LD=ld

CFLAGS=-Wall -D_FILE_OFFSET_BITS=64
CXXFLAGS=-Wall -D_FILE_OFFSET_BITS=64
LDFLAGS=-Wall -D_FILE_OFFSET_BITS=64

CXXFLAGS=
LDFLAGS=-Wl,-rpath=/opt/lib

all: flvstreamer

clean:
< TAB >rm -f *.o

streams: bytes.o log.o rtmp.o AMFObject.o rtmppacket.o streams.o parseurl.o
< TAB >$(CXX) $(LDFLAGS) $(ARMFLAGS) $^ -o $@_arm -lpthread

flvstreamer: bytes.o log.o rtmp.o AMFObject.o rtmppacket.o flvstreamer.o parseurl.o
< TAB >$(CXX) $(LDFLAGS) $(ARMFLAGS) $^ -o $@_arm

bytes.o: bytes.c bytes.h Makefile
log.o: log.c log.h Makefile
rtmp.o: rtmp.cpp rtmp.h log.h AMFObject.h Makefile
AMFObject.o: AMFObject.cpp AMFObject.h log.h rtmp.h Makefile
rtmppacket.o: rtmppacket.cpp rtmppacket.h log.h Makefile
flvstreamer.o: flvstreamer.cpp rtmp.h log.h AMFObject.h Makefile
parseurl.o: parseurl.c parseurl.h log.h Makefile
streams.o: streams.cpp log.h Makefile
############### end ######################

remove the texted called < TAB > and replace them with a TAB as copying the text and pasting it into a document often replaces the TAB with a space and you will get an error message when you compile it similar to;

Makefile:15: *** missing separator. Stop.

save the file and now run the command;

sudo make -f MakefileARM flvstreamer

This will create a file in the same directory called flvstreamer_arm, create a directory to store it in;

sudo mkdir /root/flvstreamer

move flvstreamer to it;

cp /root/flvtemp/flvstreamer_arm /root/flvstreamer

now move to the directory;

cd /root/flvstreamer

and make the file executable with;

chmod +x flvstreamer_arm

now test all is working with;

./flvstreamer_arm –help

If that works then you can move on to get_iplayer

create a directory for get_iplayer and copy the perl script you downloaded to it

sudo mkdir /root/get_iplayer
sudo chmod 755 get_iplayer
cp /root/get_iplayer /root/get_iplayer/

move to the Directory and run get_iplayer
cd /root/get_iplayer
./get_iplayer

The first time you run it get_iplayer should update itself and end, the second time it will download the current BBC listings.

Now add the following prefs;

./get_iplayer –prefs-add –flvstreamer=”/root/flvstreamer/flvstreamer_arm”
./get_iplayer –prefs-add –ffmpeg=”/usr/bin/ffmpeg”
./get_iplayer –prefs-add –lame=”/usr/bin/lame”
./get_iplayer –prefs-add –output=”/PATH/To/Your/Download/Directory”

Check for a program;

./get_iplayer –type=radio “News”

check out the 5 digit index code of one of the programs and download it as follows

./get_iplayer –get 13119

Hope this helps