Wednesday, 17 December 2008

Transfer files to and from your nokia in ubuntu

Transfering files to and from your nokia phone is easy under linux if you use the correct tools, im going to show you how to do it using obexftp, obexftp-frontend, DKU-2 cable and my old Nokia 7600, this will work with any Nokia phone it doesnt have to be a 7600, You could also transfer files by mounting your phones system onto your hard drive but ill leave that for another blog :)

OK firstly we need to get the tools so fire up the terminal and enter;

$ sudo apt-get install obexftp openobex-apps

now we could use just these tools to transfer our files but whats the point in that when theres a nice GUI frontend available for obexftp.
You need to have java runtime installed to run the GUI so if you have java installed then skip the next step and if you havent got java installed then install it now by going to the command line and entering;

$ sudo apt-get install sun-java6-jre sun-java6-bin

Now well download the obexftp-frontend, its not available in the repositories but you can download extract and move it to your /home directory by entering;

$ wget -c && unzip && sudo cp -r obexftp-frontend-0.6.1-bin /home

Now we need to set our permissions to allow us to access and transfer files to and from our phone, go to the terminal and enter;

$ lsusb

and we should see a line similar to;

Bus 004 Device 002: ID 0421:0400 Nokia Mobile Phones 7600 Phone Parent

Now iv marked the important numbers above in red, the first number is the;
VendorID: 0421
and the second number is the;
ProductID: 0400

Your numbers will differ slightly but just remember that the first is the VendorID and the second is the ProductID.

Now in the terminal enter;

$ sudo gedit /etc/udev/rules.d/40-permissions.rules

and add the following to the end of the file that opens;

BUS=="usb", SYSFS{idVendor}=="VendorID", SYSFS{idProduct}=="ProductID", GROUP="plugdev", USER="yourUserName"

replacing VendorID and ProductID for your actual id numbers from before and put your own username where it says yourUserName and save, for example mines looks like this;
BUS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="0400", GROUP="plugdev", USER="mark"

Now we're almost finished just right click on the desktop and select "create launcher", name the launcher whatever you want and in the "command field" type;

java -jar /home/obexftp-frontend-0.6.1-bin/OBEXFTPFrontend.jar

Now all you need to do is click on the launcher you just created and it will open the ObexFTP-frontend for you to configure and the last step are to add;


where it asks for the ObexFTP Path:
Change Transport to USB and set Value to 1 then press Test connection and thats you done, you can now just use the launcher to start transfering files to and from your mobile phone.

Convert kaffiene .m2t or any other video file into images

A quick "how to" convert kaffeine dvb-t recordings which are stored with the file extensions .m2t or any other video file eg; mpg,avi etc into .png files,

First things first create a new folder where you want the images to be stored and remember there can be a lot of images depending on the size of the video.

To convert to small pictures which are 768 x 576 pixels (1.3 mb) simply open up the terminal cd to the new folder you'v just created and enter,

$ mplayer /Path/To/Your/File.m2t -aspect 16:9 -mc 0 -fps 30000/1001 -delay -0.222 -ao null -vf pullup,softskip,scale=768:576 -vo png

changing where iv wrote /Path/To/Your/File.m2t to your actual path and watch as your file converts into images.

To make the images bigger in size change scale=768:576 to scale=1440:1080 to make the images bigger in size 1440 x 1080 pixels (4 mb) make sure you have plenty of space on you hard drive if its a large file

$ mplayer /Path/To/Your/File.m2t -aspect 16:9 -mc 0 -fps 30000/1001 -delay -0.222 -ao null -vf pullup,softskip,scale=1440:1080 -vo png

Wednesday, 12 November 2008

Geniatech T328B dvb-t usb freeview stick on ubuntu

Update 8/1/2009:
Changed the hg clone source and added a different firmware

Yesterday i got a Geniatech T328B usb freeview stick deliverd and decieded to try set it up on ubuntu and after some searching on the internet i managed to get it working and this is how i did it, i think this should work with any usb freeview stick with the Af9015 chipset, if this works for you then post what stick your using to let others know.

Ok here we go, first up open the terminal and enter;

$ lsusb

now we should see either

Bus 001 Device 001: ID 15a4: 9015


Bus 001 Device 001: ID 15a4: 9016

in our results, if you see either of these then you can use this tutorial to get your TV up an running in ubuntu.

Now we are going to install all programs and libraries needed to compile the drivers to make our usb stick work.

In the terminal enter;

$ sudo apt-get install mercurial linux-headers-$(uname -r) build-essential gcc make

Now we'll download and install the Firmware;

$ wget

Onced downloaded we need to move this file into our kernel folder in the directory /lib/firmware/YourKernalNumber-generic , to do this enter;

$ sudo cp dvb-usb-af9015.fw /lib/firmware/$(uname -r)

Now we will download the drivers by entering into the terminal;

$ hg clone

Once finished enter;

$ cd v4l-dvb

Now we will compile and install the drivers by entering;

$ make && sudo make install

Now to load the module at the begining of each session we need to edit the modules file by entering;

$ sudo gedit /etc/modules

now add;


at the end of the file and save and close it.

probe dvb module;

$ sudo modprobe dvb-usb-af9015

Now you dvb-t stick should be working but if its not reboot the system and when its reloaded your dvb-t stick will be working.


Updated 8/1/2009: changed the hg clone source and added a diffrent firmware

Monday, 20 October 2008

How to turn off linux system beeps

If like me it annoys you when your using your pc late at night and always get the system beeps from your pc speaker on the front of your tower (not your actual sound speakers) like when you press delete on the terminal and theres no letters to delete your pc wakes half the house up with the little beep noise then heres how you can turn it off.

Open up the terminal and enter;

$ sudo gedit /etc/modprobe.d/blacklist

add the following line at the bottom of the file;

#Annoying speaker beep
blacklist pcspkr

then save and reboot your pc and the beeps have gone :)

Alternatively if you dont want to reboot you can execute the following command in the terminal;

$ sudo rmmod pcspkr

and your done, no more annoying beep but if you do want the beep back again for some reason then just remove the line

#Annoying speaker beep
blacklist pcspkr

from your /etc/modprobe.d/blacklist file :/

Sunday, 21 September 2008

Mov/Divx/Xvid/Wmv/Etc to DVD (PAL or NTSC)

A Guide To: Making DVDs from Various Video Formats

First up we need to make sure we have correct tools install by opening the terminal and typing the following;

$ sudo apt-get install mencoder ffmpeg dvdauthor mkisofs

now wait for the tools to install.

Step 1: Convert Media to .AVI (Go to the next step, if the file you wish to convert is already in the .avi format)

In this step we will transcode your media into .avi format so that it is accepted by ffmpeg, by going to the folder your videos in on the terminal eg; $ cd /home/YOU/Videos then enter the following into the terminal;

$ mencoder YourMovieHere -ovc xvid -xvidencopts pass=1 -oac mp3lame -lameopts vbr=3 -o /dev/null

Replacing YourMovieHere in the line with your video file's name and wait for that to finish.

Next up we type into the terminal

$ mencoder YourMovie -ovc xvid -xvidencopts pass=2:bitrate=1000 -oac mp3lame -lameopts vbr=3 -o output.avi

Changing YourMovie to your movies name in that line.

Step Two: Convert the .avi file to a .mpg file

Right, now that you have a file that ffmpeg will accept, enter one of the following depending on the type of DVD your making into the terminal to transcode the file into a compliant .mpg file.

$ ffmpeg -i output.avi -target pal-dvd final.mpg

Or If your DVD player uses ntsc then replace the 'pal' to 'ntsc'. Or if you want you can type:

$ ffmpeg -i output.avi -target pal-dvd -aspect 16:9 final.mpg

This will make the aspect ratio 16:9, see what works for you.

Now wait and youll have your final.mpg file ready after this.

Step 3: Create the DVD file structure

In the terminal enter;

$ dvdauthor -o DVD/ -t final.mpg

wait for that to finish then enter;

$ dvdauthor -o DVD/ -T

Now we have our dvd stucture in the folder named dvd.

Step 4: Create The .ISO File

In the terminal type;

$ mkisofs -dvd-video -v -o DVD.iso DVD

and this will leave us with our file name DVD.iso which is ready to be burned to a disk, You can do that by simply entering a blank DVD into your DVD drive and right clicking on the DVD.iso image and selecting "Write To Disk" from the drop down menu.

Wednesday, 27 August 2008

How to create a seperate /home directory on ubuntu

This guide will show you how to create a seperate /home directory on another partition on your pc.
I had a spare hard drive and an old pc so i decided to give myself some more space and move and run my home directory from the spare hard drive and this is how i did it. You need to set up your hard drives so as your original is the master and the second drive you are adding is the slave, this can be done easily by moving the small jumper pin on the back of the hard drive over to the second last pin position or maybe the last pin position, check and see which works for you althought the second last position has always worked for me.

O.K now were about to begin, please follow these instructions carefully as i assume no responsibility if you screw up but you should be fine as long as you follow the backup part in the instructions :)

Step 1

Boot up your pc with your ubuntu live CD, now open the terminal and type:

$ sudo fdisk -l

this will show you an output of your hard drives, mine looks like this:

Disk /dev/sda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdf5edf5e

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9789 78630111 83 Linux
/dev/sda2 9790 9964 1405687+ 5 Extended
/dev/sda5 9790 9964 1405656 82 Linux swap / Solaris

Disk /dev/sdb: 30.0 GB, 30060527616 bytes
255 heads, 63 sectors/track, 3654 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00256c7d

Device Boot Start End Blocks Id System
/dev/sdb1 1 3654 29350723+ 83 Linux

Be sure to keep track of the names of your partitions—these names are very important (/dev/hda1, /dev/hdb1, /dev/sda2, etc.).
Im going to be mounting my new home directory onto the /dev/sdb hard drive.

Step 2
Now open gparted partition editor, you can open the partition editor by opening another terminal and typing:

$ sudo gparted

find the partition in gparted that you want to mount your new home directory onto (in my case /dev/sdb) and save it as filesystem ext3. When you're satisfied with your new partition layout, click Apply.
Once the changes have been applied, make note of the partition name of your new partition and then quit GParted.

Step 3
Now, in my example, my original partition that Im using was /dev/sdb, and it created a new partition called /dev/sdb1, and my original /home folder lives on /dev/sda1. It's very important that you substitute in your own appropriate partition names where you see me using my own.

Now, back in the terminal, I'm going to mount /dev/sda1 and /dev/sdb1 by using the following commands:

$ sudo mkdir /old
$ sudo mount -t ext3 /dev/sda1 /old
$ sudo mkdir /new
$ sudo mount -t ext3 /dev/sdb1 /new

Step 4
Now we're going to back up the old /home directory on the old hard drive and move it to the new hard drive using these commands:

$ cd /old/home
$ find . -depth -print0 | sudo cpio --null --sparse -pvd /new/
$ sudo mv /old/home /old/home_backup
$ sudo mkdir /old/home

Note: I have tested the second command myself, and it works, but some have pointed out it might make sense to preface the first part of the command with sudo in case one of the other users has subdirectories manually marked as unreadable to the user making the move. Since I have not tested this out and all directories and readable to all by default, I'm offering this as only an alternative in case the command iv already given doesnt work for you:
sudo find . -depth -print0 | sudo cpio --null --sparse -pvd /new/

Step 5
Next, we're going to specify to use the new home partition as /home, type this into the terminal:

$ sudo cp /old/etc/fstab /old/etc/fstab_backup
$ sudo nano /old/etc/fstab

You'll then be taken to the nano text editor. Add in this line:

/dev/sdb1 /home ext3 nodev,nosuid 0 2

Then save (Control-X), confirm (Y), and exit (Enter)

Note: Remember to change my /dev/sdb1 to you new home partition.

After you reboot, you should be now using your new /home partition.

If you find that you are running out of room on your old partition and you're pretty confident everything is working as it should be, then go ahead and delete the backup of home using:

$ sudo rm -rf /home_backup

What if it doesn't work?
You know, it really should work, but if you somehow messed up your /etc/fstab and didn't configure it correctly... well, that's why we have a live CD, so we can fix things.

Boot up the live CD, go to a terminal, and type:

$sudo mkdir /recovery
$ sudo mount -t ext3 /dev/sda1 /recovery
$ sudo cp -R /recovery/home_backup /recovery/home
$ sudo cp /recovery/etc/fstab_backup /recovery/etc/fstab

Then, reboot. :D

Connect to the internet with wvdial & a mobile phone

Step 1
Obviously you'll need to connect your nokia phone to the pc, im using a dku-2 cable and a Nokia 6630 for this part.

Step 2
Open up the terminal by going to Applications >> Accessories >> Terminal .
Now type:

$ lsusb

and you should see a line similar to:

Bus 002 Device 002: ID 0421:0410 Nokia Mobile Phones 6630 Imaging Smartphone

This means that the phone is connected to the pc correctly.

Step 3
Open up the terminal again and type:

$ sudo gedit /etc/wvdial.conf

and change the file to look like this:

[Dialer Defaults]

Modem = /dev/ttyACM0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
Phone = *99#
Username =
Password = " "
Stupid Mode = 1

Please Note: You must change the lines Username and Password (and possably Phone) to whatever your mobile networks defaults are, then save and exit the file, this examples for t-mobile uk and works perfect with my Nokia 6630 and an old 7600 phones.

Step 4
Now all you have to do is open up the terminal again and type:

$ wvdial

and you should see it dialing, and to exit simply press:

Ctrl and c