Ubuntu - Installing Sun Java - CLI

January 2nd, 2010

Always forget this:

To install Sun Java on your Ubuntu via the command line, emit the following comand:

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

Run “wubi” from usb stick

December 28th, 2009

As we move away from “burnable” media to solid state, then need to be able to use distros on usb sticks becomes more important. I have never yet tried wubi, but with a new PC on the way (with no optical drive) and Windows 7 pre-installed, I am tempted to try wubi as my installation method (even if only for a while! :))

So using unetbootin I setup a 1GB usb stick with Ubuntu Karmic Koala 9.10, booted up into Windows 7 and put in the stick.

Hmmm… no autorun of wubi.exe?

So opt to open folder and double clicked on wubi.exe. Accept the UAT control dialog and the wubi menu pops up. But with one problem. No “Install inside Windows” option. Not much good then.

Google away and find out its a bug. How to fix is quite easy and just takes one more step.

Open up a command window (or go Start > Run)

Type:    X:\wubi.exe force-wubi

(where X is the drive letter of your usb stick)

and pass the UAT again and lo and behold,

your “Install inside Windows” option is there.

HOWEVER, wubi still seems to insist on downloading the distro from a torrent, as opposed to using the one you have on a stick. To overcome this, and if you have a big enough stick (!) copy the whole *.iso from your HDD onto the stick, into the same directory as wubi.exe. This will ensure you still have a bootable stick. Alternately, extract the wubi.exe from the iso, then with a blank formatted stick simply copy wubi.exe and *.iso onto the stick. Insert to a booted up Windows and go. You may nned to follow the initial instructions to get an install button, but I found with Xubuntu.9.10 I didn’t have too.

Mplayer - neat and tidy on the CLI

November 18th, 2009

How long have I been using mplayer? Years. Why has it never bothered me to sort this out before? Don’t know. Ageism, autism, or general grumpiness sent me off in search of a solution, and how easy was it.

Every time I have run mplayer from the cli I got three lines written out before the “action”:

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.

The very simple fix to this is to add an entry to your ~/.mplayer/config file

lirc=no

That’s it, no more extra lines. Remember to comment out “lirc=no” if you want to use a remote control, though :)

Grub Menu not Visible after attaching new widescreen Monitor! Solved!

November 18th, 2009

Was time to treat myself to an early Christmas present, so splashed out on the ridiculously cheap HannsG HH241 24″, 1980×1080 WUXGA monitor @ £140. Comes with a VGA-VGAcable abd a DVI-HDMI cable (monitor has an HDMI port)

Plugged it in, powered up.

Nvidia Geoforce 6200 Graphics card with DVI/VGA output
HannsG HH241 24″ widescreen 1980×1080 WUXGA, HDMI 1.3 compatible
Multibooting @ 5 OS’s

PC booted up fine with post/bios screen viewable, then a blank screen for a few seconds (where grub menu usually is, then usual starting up for Xubuntu 9.04 (the default OS in my grub menu (grub legacy)

Once X was running everything fine.

Tried all sorts, reinstalling grub to mbr, reconfiguring X, checked for settings in bios (none obvious), but nothing changed.

So switched to VGA-VGA cable, and grub menu was back. So I am kind of sorted, but wavy lines and distorted image during post and splash, and was getting a better picture and all round performance using the hdmi connection.

Previous monitor, an Iiyama 17″ LCD worked fine on a DVI-DVI cable.

Also, Xubuntu Progess screen during boot up was not centred, off to the right a bit.

After hours and hours and hours of googling, finally found a post about toshiba laptop owners not getting grub on a cold reboot. The recommendation was to install grub2
To install grub2 on Jaunty or below

sudo apt-get install grub2

Test it by loading grub2 as chainloader (this option is offered on installation)
You’ll need to “e” “e” and change root to uuid to get the chainloader to work

If you are happy run

sudo upgrade-from-grub-legacy

and grub2 will take over, And lo and behold, the grub menu is back! New things to learn in order to customise grub2 menu, and set up a splash image for it.  Xubuntu progress splash also nicely centred.

Best place to go for just about everything grub2 is here

get_iplayer - Command Line Downloader for BBC iplayer

November 7th, 2009

get_iplayer

My favourite program of the moment which exceeds the delivery of the iPlayer on Windows in just about every way!

To get the best out of it, download the latest version (and everything else you need) from here, and also make sure you have the following installed to make the most of the features available:

flvstreamer
ffmpeg
mplayer

(If you must install on Windows, there is an installer which takes care of everything for you)

flvstreamer is especially useful for getting higher quality versions of programmes, but you may have to fiddle about with the location of the file and its permissions to get things working correctly.

Ok, here are the commands I use the most:

get_iplayer
(this gathers a full index of programmes available)

get_iplayer keyword
(gathers index but also finds matches for “keyword” of your choice, e.g. Dr Who or Casualty)

Running the two above will show you the index number for the programme. Use this as follows:

get_iplayer –info 123
(will provide detailed info about the programme, including the various versions and qualities available)

get_iplayer -get 123
(will download the default version, usually iPhone - mov quality)

get_iplayer -get 123 modes=flashhigh flvstreamer=’/usr/bin/flvstreamer’
(will download a higher quality version in mp4 format using flvstreamer, my binary is located in /usr/bin/)

Finally

get_iplayer –update
(simply checks for any updates to get_iplayer and installs them)

Further commands, help and information here

Dual Booting Karmic and Jaunty and then using grub-legacy

November 7th, 2009

What a palava. Grub2 will become the defacto standard in time, but right now I am not quite ready to switch over. Having installed Karmic to a separate partition, and chosen to install grub2 to the local root (not mbr) I could not chainload boot to karmic from grub legacy.

So, bootedup the live cd again and installed Grub2 to the mbr. Instructions on how to do this can be found here.

OK, good. Boot up Karmic now, and run “sudo update-grub” in order to load up all the other OS’s into Grub2 menu.

While you are in Karmic, open up the grub.cfg file and copy out the boot menu info for Karmic (you will need this later to put into your grub-legacy menu.lst) Should look something like this:

“sudo nano /boot/grub/grub.cfg”

menuentry “Ubuntu, Linux 2.6.31-14-generic” {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,10)
search –no-floppy –fs-uuid –set b50237f3-c90c-4af6-a275-892a09165ea3
linux    /boot/vmlinuz-2.6.31-14-generic root=UUID=b50237f3-c90c-4af6-a275-892a09165ea3 ro   quiet splash
initrd    /boot/initrd.img-2.6.31-14-generic

Now reboot, and you should be OK to boot back into Jaunty.

In Jaunty, open up menu.lst, and add the following entry to your “Other Operating Systems” section

title       Xubuntu Karmic Koala
uuid       b50237f3-c90c-4af6-a275-892a09165ea3
kernel    /vmlinuz root=UUID=b50237f3-c90c-4af6-a275-892a09165ea3 ro  quiet splash
initrd    /initrd.img
quiet

You’ll see why you needed the info from grub.cfg to insert the UUID information. This layout, I believe also has the benefit of coping with kernal updates to Karmic.

Save your menu.lst file, and reboot. You should now have an entry for Karmic and it should boot.  :)

HJSplit with Zenity (Thunar custom action)

November 7th, 2009

Lots of large files come down split up into pieces using HJSplit. It’s a bit of a slog to do the joining manually, so here is a simple command line that solves the problem as a thunar custom action

java -jar /path_to/hjsplit_g.jar -c join -f %f

of course you need sun java installed  :)

Permanently Remove Files with Zenity (Thunar custom action)

November 7th, 2009

 Have previously used xdialog for this, but it was time to update to zenity

zenity –question –width 640 –height 240 –title=”Permanently Remove Files” –text=”Are you sure you want to remove these files? \n\n %N”; if [ $? = 0 ] ; then rm -r %F ; else exit; fi

You do get a sanity check before you decide to delete, and of course, DON’T run this on /        :)

Terminal Fight solved by Zenity (Thunar Custom Actions)

November 7th, 2009

Love my thunar custom actions, and all I wanted to do was run mediainfo against a media file to see how it was made etc. Trying to do this with just xfce4-terminal was a pita. This simple line throws the info up in a zenity info dialog:

mediainfo %f | zenity –width=640 –height=480 –text-info

Unfortunately you don’t get the nice alignment you get in a terminal but hey…

Set Firefox mailto links to GMail/Googlemail

September 5th, 2009

Nice easy tip this one.

Open Firefox, and open up  GMail/Googlemail.

Paste this command into the address bar with the GMail/Googlemail page on view

javascript:window.navigator.registerProtocolHandler(”mailto”,”https://mail.google.com/mail/?extsrc=mailto&url=%s“,”GMail”)      << all one line

and click on green arrow

Firefox will ask if you want to add the application, to which you say yes.

Now click on a mailto link, and Firefox will ask you which email client you wish to use. Select Googlemail and also tick the box to allow this to persist.

Job done :)