Friday, 5 June 2009

Loads of nautilus scripts

A nautilus script is a bash script that when placed in a special nautilus scripts directory will add extra menu items to the right click menu under scripts when you are using the nautilus file manager.

open up a terminal and type;

$ cd ~/.gnome2/nautilus-scripts && wget http://g-scripts.sourceforge.net/nautilus-scripts.tar.gz && tar zxvf nautilus-scripts.tar.gz && rm nautilus-scripts.tar.gz


and thats you done.

You can see the scripts by right-clicking on you desktop and go to scripts, nautilis scripts, to see the full list of scripts youv just added.

Saturday, 9 May 2009

Convert Video To An Mp3 Audio File

Heres how to convert a video file to an audio mp3, first open a terminal and install ffmpeg

$ sudo apt-get install ffmpeg


now cd in the terminal to the folder your video file that you want to convert is in then simply enter

$ ffmpeg -i YourVideoFile.flv -ab 160k -ac 2 -ar 44100 -vn YourAudioFile.mp3


and wait for it to convert :) yep it really is that simple.

the -i simply means your input file, the -ab indicates the bit rate, -vn means no video ouput, -ac 2 means 2 channels and the -ar 44100 indicates the sampling frequency.

You can edit these to suit your needs

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 http://kent.dl.sourceforge.net/sourceforge/obexftpfrontend/obexftp-frontend-0.6.1-bin.zip && unzip obexftp-frontend-0.6.1-bin.zip && 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;

/usr/bin/obexftp


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

example:
$ 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


or

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 http://www.otit.fi/~crope/v4l-dvb/af9015/af9015_firmware_cutter/firmware_files/4.95.0/dvb-usb-af9015.fw


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 http://linuxtv.org/hg/v4l-dvb


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;

dvb-usb-af9015


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.