Archive for the ‘Ubuntu’ Category

New Blog

31, August 2011

I’ve decided to start a new blog with a more generic name as I am beginning to move away from Ubuntu to other distributions and want to write about my experiments without them being tagged to an Ubuntu blog. My new blog is here, Martin Cooper’s Linux Blog

Amazon MP3 Downloader for Linux

6, August 2011

I’ve just come across a site called textbookstuff that does DRM free audiobooks in MP3 format, these are limited to out of copy write books and poems and they are new so only have a few available at the moment. The difference is the books are read by well known reader but are produced with sound effects and music which make them more like a BBC play. They provide their book through various download options but the prices vary quite widely, the one I looked at downloading cost between £4.99 and £9.99 dependant which option you chose, the cheapest being Amazon which immediately caused me a problem as I wanting to use a Linux solution however the Linux solutions provided by Amazon failed to work due to dependency issues and also no 64bit support. This was solved by a little program called pymazon found here this worked for me in both Ubuntu 11.04 and Linux Mint Debian Edition both running XFCE . To install it from a Terminal just run the following commands;

$ sudo apt-get install python-crypto
$ sudo apt-get install python-qt4
$ wget http://pymazon.googlecode.com/files/Pymazon-0.9.tar.gz
$ tar -xzf Pymazon-0.9.tar.gz
$ cd Pymazon-0.9
$ sudo python setup.py install

and run from a Terminal with;

$ pymazom

Open the [Preferences] options and change the [Save Directory] to one of your choice.

Then buy your audiobook/music on Amazon, during the process it will ask you to download their Linux version of the software unfortunately it does not support 64 bit and even the 32 bit versions have dependencies missing. So just click on the link following the text which says “If you have already installed the Amazon MP3 downloader click here” and continue the purchase. Once complete a download should start of an .amz file e.g AmazonMP3-12345678.amz which you should direct to a folder of your choice. Next open python, select the [Load Files] optin and navigate to your previously stored .amz file and open it, pymazon will then display a list of your purchased tracks and these can then be downloaded using the [Download] button and once downloaded displayed with the [Show Downloads] button.

DeVeDe, iso’s too small from m4v files

23, March 2011

I’m running Maverick Xubuntu on my Desktop Box and finding that if I burn m4v files created in Handbrake of about 1.4Gb using DeVeDe that the resulting iso image is 80Mb yes Meg. When I play them in VLC they are either chopped short or run too fast and short. If I convert them from m4v to avi then DeVeDe creates the correct sized working iso. It’s a solution but who wants to convert files twice when DeVeDe should just do it. All worked ok just a couple of weeks ago [March 2011]. I’ve tried reverting to previous versions of both handbrake and DeVeDe with no luck and am beginning to think it may be an ffmpeg problem. If I run DeVeDe from the command line I get the following output in the Terminal..

mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
/usr/lib/devede/devede_other.py:685: GtkWarning: GtkSpinButton: setting an adjustment with non-zero page size is deprecated
tree.add_from_file(filename)
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Skipping frame!

Skipping frame!

[pages worth of Skipping frame]

Skipping frame!

Skipping frame!

Skipping frame!

Skipping frame!
Launching program: dvdauthor -x /home/bob/Videos/test.xml
elemento: /usr/bin

So apart from a missing mplayer socket problem, a deprecated python reference it’s skipping lots of frames no wonder the results are poor. I think I’ve now solved this after days of testing, the solution seems to be to not convert m4v’s in handbrake using the Framerate option [Same as Source].

Handbrake Video options

Handbrake Video options

So in the Video Tab you need to select an actual frame rate for the conversion. I’ve tested this with two different clips from DVD’s and this has now let DeVeDe create a correctly sized iso image which plays perfectly in VLC. I hope this helps out others with the same problem.

Orange Mobile Broadband Dongle and Ubuntu

17, March 2011

I decided I wanted to use my Asus eeePC 704 netbook during my lunch hour at work on the net so after doing some research and finding little help on the net I decided I’d just take the plunge and sign up for a cheap Orange dongle as they offer a £5 a month discount to there PAYG mobile phone customer. I have the E1752 HUAWEI usb dongle which it says will, plug in for instant internet access,
* use with a PC or Mac
* use it at home or on the go
* supports speeds up to 7.2Mbps (download) and up to 2.0Mbps (upload) subject to network availability

I get a free dongle, 1GB of anytime access and 1GB of quiet time access [between 00:00 to 16:00] which is normally £15 pcm on a 1 year contract for £10pcm.

Orange HUAWEI E1752 Dongle

Orange HUAWEI E1752 Dongle

It arrived the day after I ordered it and took a phone call to Orange to activate it before I could start using it. The activation worked straight away and needed me to provide them with the phone number of the dongle [on the box] a password [that I had setup during the telephone ordering process], id details and to confirm the IMEI number of the SIM card.

The eeePC is running EasyPeasy v1.6 at the moment which is based on Ubuntu 10.04 (Lucid Lynx) with an Xfce Desktop, my internet search had found that I needed to add the usb-modeswitch package to the PC to start with see here. Although the program was already available from the Synaptic Package Manager on my PC and I therefore installed it with;

$ sudo apt-get install usb-modeswitch

[I found that on my other laptop currently running Xubuntu Natty 11.04 development edition the usb-modeswitch option was not required as the Network Manager picked up the dongle] out of the box.

I then rebooted the laptop switched off the inbuilt wifi card [Fn F2 on the eeePC] inserted the dongle and right clicked on the Network Manager, selecting to [Edit Connections] then the [Mobile Broadband] tab, click [Add] and on my eeePC it said on the next screen “create a connection for this mobile broadband device:”, giving the only option of;
HUAWEI Technology HUAWEI Mobile
so I clicked on [Forward]
accepted the Country as Britain [UK] and clicked [Forward]
selected Orange and clicked [Forward]
again accepted the plan as Contract and [Forward]
and finally [Apply].
I then closed the Network Manager and when I left clicked on the Network Manager icon the dongle shows under [Mobile Broadband] as Orange Contract 1.
Clicking on this option then connected me to the Internet.

If the dongle is not recognised you may find starting the laptop up with the dongle in the USB slot works better and I found that it had to be in a specific slot on my Sony laptop, disconnect any other USB devices while you test.

Network Traffic Monitor
The next problem is how to monitor your data usage so you don’t go over the limits of your package and get changed for doing so. I found a useful program called NTM [Network Traffic Monitor] at http://netramon.sourceforge.net/, I downloaded a .deb package [55kB] and installed it. the program sits in your system tray monitoring your traffic, make sure it’s monitoring ppp0 which you can set by right clicking the icon and selecting [Preferences] then just set up your options, it can cut you off when a limit is reached or time etc. and if you left click it you get an updating display of your current usage.

Wammu SMS Manager

The Orange site also lets you monitor your usage but not in real time, as I already monitor my PAYG mobile on the Orange site I decided to add the dongle account. This was not as easy as I first thought because once you add the phone number of your dongle the site then sends a registration code via SMS to your dongle so that you can continue. The Windows software that is installed on the dongle includes a SMS Manager so you could do this part on a Windows PC but I wanted to do it via linux. After several hours Google searching I found a program that reads SMS messages from a selection of Mobile phones and dongles. The program is called Wammu and is available from the Synaptic Package Manager in Lucid and above. It also needs gammu running in the background but does not add this automatically. I installed both with;

$ sudo apt-get install gammu

$ sudo apt-get install wammu

Wammu then shows up in the [Accessories] menu and when started up asks you to make sure your phone is connected to continue with the configuration wizard. I selected the [automatically search for phone] option and told it the phone was connected via a usb cable and after a while it asked me to select one of the 2 options it had found, I selected the at19200 option and it then asked me to name it and finish. I found on my other Sony laptop that I had to move the dongle to the right hand USB ports before Wammu could locate it. The settings show the dongle as being on /dev/ttyUSB1. Wammu then returns you to the default window but does not connect automatically. Select the [Phone] top menu item then [Connect] then the [Retrieve] top menu item then [Messages] to download your messages. you can now register the dongle on orange and retreive the SMS with the registration number to continue the registration process. You can also send SMS via this program.

Once you log into your Orange account and select your Mobile broadband account you can check your usage using the button at the top of the screen labelled [View your remaining minutes & texts], from the 2 option then given, select [View the balance of your bundles]. You may want to note the “Your next bill date is” date as the end of the month did not match what I was expecting and the remaining Mb had therefore been adjusted to this end date.

Orange Turn Off Safesurf
I found quite early on with my surfing that the dongle has Safesurf enabled which seems to block all the forum’s I like to surf [and no they are not adult] including the Ubuntu Forum, to remove this annoying option visit your online Orange Account as above. Once in the main broadband page note the padlock icon below the “Pay Monthly” title, this is the Safeguard, Parental Controls button and is by default turned on. Click on it and accept the option to turn the controls off. This updates your access to the web immediately. Happy Surfing …

My Server

16, March 2011

Laptop Server
The Server I use is an Aspire Laptop, 5633WLM Core 2 Duo T5500 1.66 GHz with 1Gb of RAM with a missing screen [don’t ask] with a standard install of Xubuntu. I’ve built a rack so that it stands upright so save space and it is linked to my monitor via a KVM switch. It runs an Apache web server, an Apt cache server, backup server to an attached USB Hard Drive, the Folding@Home application, Torrent Server, a bunch of other cron run scripts and the Mediatomb Media Server.

Home Server

Home Server

Apt Server
Apache Server
Folding@Home
Torrent Server

Move multiple files from command line

15, March 2011

Using find to copy or move multiple files

All the .txt files are located in directories and subdirectories of the ~/tmp folder and I want to copy them to ~/tmp2

To copy them, open a Terminal and use;

$ find ~/tmp -name ‘*.txt’ -exec cp ‘{}’ ~/tmp2 \;

This copies all the files in the original folders and sub folders and saves them to the ~/tmp2 folder.

or to move them,

$ find ~/tmp -name ‘*.txt’ -exec mv ‘{}’ ~/tmp2 \;

this deletes them from the original folders and sub folders and saves them to the ~/tmp2 folder.

Shutdown Sound

15, March 2011

Shutdown Sound:

This works on my Xubuntu Natty install. I found a .ogg sound file that I wanted to use as a shutdown sound so needed an command line ogg player to play it.

$ sudo apt-get install ogg123

now add a script as follow script to /etc/init.d as follows

In a Terminal, create the file with, [change mousepad to your favourite text editor]

$ sudo mousepad /etc/init.d/K99shutdownsound.sh

copy the following into the script

#!/bin/sh
#### play sound at startup ####
## reduce volume ##
amixer -c 0 sset Master,0 50%
## play sound ##
/usr/bin/ogg123 /path_to my/shutdown.ogg

save the script and make it executable.

$ sudo chmod +x /etc/init.d/K99shutdownsound.sh

now add a shortcut to /etc/rc0.d where shutdown scripts go and to /etc/rc6.d where reboot scripts go

$ sudo ln -s /etc/init.d/K99shutdownsound.sh /etc/rc0.d/K99shutdownsound.sh

$ sudo ln -s /etc/init.d/K99shutdownsound.sh /etc/rc6.d/K99shutdownsound.sh

Now I get a reboot and shutdown sound.

Sony Laptop, Special Function Buttons

15, March 2011

Sony Laptop VGN-NS11J

This laptop has 2 extra keys on the top panel next to the Power Button, AV Mode and Mute

These keys are detected by Natty Xubuntu as;

AV MODE = XF86AudioMedia
Mute = XF86Launch1

These keys can be activated by opening the [Settings], [Keyboard] option, selecting [Application Shortcuts] tab then the [Add] option.

Add amixer set Master toggle to the [command] box of the Mute key then press [ok] and in the next window press the Mute key to activate it.

Add a command of your choice i.e /usr/bin/exaile [this will launch the Exaile media player] to the [command] box of the AV MODE key then press [ok] and in the next window press the AV MODE key to activate it.

Natty Unity

5, January 2011

So I’ve been doing some ISO testing of the Natty Alpha 1 release and have had one or two problems [see previous post iso Testing Natty ] but my main problem with it has been the decision to replace the default Gnome desktop with Unity. Unity is a 3D replacement for the 2D Gnome desktop which Gnome are about to replace anyway with Gnome Shell. Ubuntu seem to have decided Gnome Shell is not the direction they want to go so are replacing the desktop with their own. Unity brings the notebook and desktop versions of Ubuntu together with only minor differences which will be detected and applied during install. The standard approach will therefore be a notebook type display on both desktop and notebook. The main difference will be the loss of the bottom panel, the replacement of the top panel with a more interactive menu and a Mac style icon dock down the left hand side.

When you install the Ubuntu default now you will need a 3D enabled graphics card to run Unity or you will be presented with a pop up message currently;

Information:
Sorry you don’t have 3D support, install it for
your graphic hardware to get Unity or please
reboot and select “Classic session” at startup.

Not a very helpful message in my opinion, basically you can go into [System], [Administration], [Login Screen] and change [Ubuntu desktop Edition] to [Ubuntu Classic Desktop] then log out and back in again to 2D Classic Mode but this is not obvious from the message. The other option would be to add the 3D driver [if your card supports 3D] and log out and back in again for Unity to display, Nvidia owners beware! The message is particularly unhelpful if you are running a Live CD version or USB stick with persistence not enabled because you will not be able to install the driver as a restart will wipe the changes, noobs will be confused.

Personally I don’t like Unity, it’s more Mac like styling, I don’t have 3D effects turned on and don’t want them, the dock on the left is unnecessary clutter but if I wanted one there are plenty of docks available without this being the default. We are told we can use the Classic 2D Gnome desktop if we don’t like Unity but that this will eventually disappear when Gnome Shell arrives and Gnome 2 is depreciated. My thoughts for Gnome Shell are much the same I just don’t want to go there so the hunt starts for an alternative. I’ve already tested Lubuntu with it’s LXDE desktop and although I like the styling it’s still a bit basic. So for now Xubuntu with it’s Xfce desktop is becoming my test o/s. I’m currently running Natty Xubuntu testing and loving it.

Sheevaplug

2, January 2011

Ok so I’ve had my Sheevaplug since January 2009 and have now bricked it at least 3 times trying to be too clever by half! As it’s getting to be a rugular thing and it always takes me hours to work out what to do, here are my instructions.

I have used the same info. from the page below and added/changed it to reflect my process, please read both to make sure you understand what you are doing! as I take no reponsibility for errors blah, blah etc.etc.

I found the “instructions”, script & packages on this site

SheevaPlug Installer Page;

http://plugcomputer.org/plugwiki/index.php/SheevaPlug_Installer

but to be honest they are a bit difficult to follow for a bit of a noob so I’ve adapted them a bit.

The installer will reflash a bricked plug & can be used to install another distro [I’ve used Debian Squeeze this time] but if you just want it back to “factory settings” use the packages as they are.

My plug is the BFLS one supplied with Ubuntu Jaunty on the internal flash card and the PC I will use to reflash it has Ubuntu Jaunty on it so although the scipt includes Windows support I won’t mention it here, see the above page for details.

Note::
The runme.php would not run on Ubuntu 10.10 as the version of python on Ubuntu 10.10 has depreciated some terms. I got round this at the time by installing the old 32 bit Karmic Ubuntu and using that but since then I have found the possible answers in this post

http://plugapps.com/forum/viewtopic.php?f=20&t=428#p3178

but not tested the solution yet although I have saved copies of the files it talks about for future use, contact me if you need them.

If you can get onto the plug then backup your stuff as this script will delete the lot, be Warned

First Download the tarball from

http://www.plugcomputer.org/index.php/us/resources/downloads?func=select&id=5

This includes all the files you need to re flash your sheevaplug with the default install of Ubuntu Jaunty. Check out this post http://plugcomputer.org/plugforum/index.php?topic=878.0 if you want to Install a Debian system, you can either download the pre-built Lenny or Squeeze rootfs.tar.gz files or use the script that mgillespie has created.

You now need to add the following packages to your host PC, cu, php5-cli, and libftdi1, so install with the following commands in a [Terminal];

$ sudo apt-get install cu

$ sudo apt-get install php5-cli

and

$ sudo apt-get install libftdi1

adding libftdi1 fixes the error message “openocd/openocd: error while loading shared libraries: libftdi.so.1: cannot open shared object file: No such file or directory” latter on.

You now connect the Sheevaplug to your PC with the USB lead [supplied] and issue this command in a [Terminal];

$ cu -s 115200 -l /dev/ttyUSB1

Note: [you may need to try cu -s 115200 -l /dev/ttyUSB0 my plug seemed to use either!]

If you get any sort of error message along the lines of

cu: open (/dev/ttyUSB1): No such file or directory
cu: /dev/ttyUSB1: Line in use

you need to issue the following commands in a [Terminal] to remove then add the driver support and re try.

$ sudo rmmod ftdi_sio

followed by

$ sudo modprobe ftdi_sio vendor=0x9e88 product=0x9e8f

If you now get on then you can proceed to the task at hand, if not it’s time to Google!. However I found that I could not get onto the plug sometimes and then realised that the plug end connection of the usb PC to plug cable was working itself out socket in the plug.

Installation

1. Prepare an empty USB stick that is FAT16/32 formatted. [Note: the 2 USB sticks I used were not detected by the plug even though I had used 1 of then before to unbrick my plug, be warned]. Re formatting and unplugging safely etc.etc did not help.

2. Extract the tarball you downloaded earlier into a folder on your PC (for example: ~/plug)

3. Edit the ~/plug/uboot/uboot-env/uboot-mmc-custom.txt or uboot-nand-custom.txt file to the correct MAC address according to the MAC address on the back of the Plug (default set to ethaddr 00:50:43:01:c1:e6). If your system is to boot from the internal flash then it’s the nand file you change, if it boots from a flash card in the side slot it’s the mmc file you change.

4. Copy all the files from ~/plug/installer to the USB stick.
NOTE: that the files should be written to the root directory of the USB stick. For example:

$ sudo cp -a ~/plug/installer/* /media/usb-pen/

5. You should now have a copy of the following;

  1. Init ramdisk (initrd)
  2. Kernel modules (modules.tar.gz)
  3. README.txt
  4. Root file-system (rootfs.tar.gz) Note if you are installing Debian, replace this file with the Debian version you have either downloaded or created with the mgillespie’s script.
  5. ubuntu-sheevaplug.sh
  6. Kernel (uImage)

6. Copy the uboot image (named uboot.bin) to the ~/plug/uboot/ directory, if it’s not there, mine was.

7. Safely remove the USB stick from the host PC, power off the plug and plug the USB stick into the Plug’s USB host interface (not via a USB HUB I disconnected all other periferals also!)

8. Connect the Plug to your PC with it’s USB cable.

9. On your PC in a [Terminal] again change to the working directory

$ cd ~/plug

and run the runme.php file with the command;

sudo php runme.php and either nand or mmc, nand if your system is on the internal flash mmc if on an external card, in my case;

$ sudo php runme.php nand

If you get an error message along these lines of;

Error: unable to open ftdi device: device not found
Runtime error, file “command.c”, line 469:
****    openocd FAILED
****    Is the mini USB cable connected?
****    Try powering down, then replugging the Sheevaplug

then try issuing these commands in a [Terminal] to delete and reload the driver, then retry;

$ sudo rmmod ftdi_sio
$ sudo modprobe ftdi_sio vendor=0x9e88 product=0x9e8f

[and make sure the USB cable at the plug end is firmly in]

If all goes well the process should start and end a couple of minutes later with a “beep” to indicate that the uboot install process has finished with the following message. [no beep on my plug]

****   U-boot should be up and running now. Open your console …

Now, open another Terminal  and log with this command

$ cu -s 115200 -l /dev/ttyUSB1

if you get this message;

## Booting image at 00800000 …
Bad Magic Number

as I did when using the first USB stick, then the process probably has not found the USB Stick and not loaded the o/s. You could try running the command;

run recover1

but in my case it just did not like the USB stick and I had to use another

If all goes well you should now see the o/s being installed with the final lines being..

* Starting kernel log daemon…
Ubuntu 9.04 ubuntu ttyS0

ubuntu login:                                                          [ OK ]
* Starting OpenBSD Secure Shell server sshd         [ OK ]
* Starting periodic command scheduler crond        [ OK ]
* Restarting OpenBSD Secure Shell server sshd     [ OK ]

with just an unhelpful flashing curser, in the centre of the last line!

After pressing [Enter] you get:

Ubuntu 9.04 ubuntu ttyS0

ubuntu login:

Just login with the default user root and password nosoup4u

done!!