Monday, November 30, 2009

OpenOffice - Programmatically!

A while ago, I had to parse an XML file and generate a spread sheet out of it.
I could have probably used an XSLT transformation; but as I was learning Python and was dying to try something on XML parsing - took some pain in understanding the format of the XML file and then set out to parse the XML file.
Being new to XML parsing and did not want to go through a lot of trouble, used the xml.dom.minidom parser and finished parsing the XML file.
Now, how did I create the spread sheet? I'll tell ya -
Well, I did not xactly create a spread sheet; instead, I created a simple HTML file with a table structure in it!
Now, all I had to do was to drag and drop the HTML file into an empty OpenOffice spread sheet! and valla..I had my spread sheet ready to be saved in the format of my choice..
However, as any programmer would agree, this is not the most optimised way of doing things and also felt a bit like cheating!
So, I took up the task of creating spread sheets programmatically using OpenOffice and Python. (Java might have been a better choice - but my Java is sorta - pathetic)...
OpenOffice comes with the PyUno module that makes this possible. I'm taking one little baby step at a time in doing this and I'm happy to say - I've started off successfully, creating a very simple and basic spread sheet :).
More on how to and what to do stuff in my next post !
Also, look out for my coming post on Python - GIMP combination and how to reduce the size of your Photography collection - without deleting files and without loosing the quality of the pictures - well, visibly in a few minutes
(I actually already have a shell script, GIMP combination doing this already - very well infact; but want to move this to a proper Python code as GIMP has very strong affinity to Python)

Saturday, October 31, 2009

How to integrate Pydev in Eclipse for Ubuntu Karmic Koala

I'm an avid Vi user. For any of my tasks on Linux, I prefer the powerful command prompt and the Vi editor. That was more than sufficient for all my tasks earlier. However,the last month, I've taken up the task of writing some solid python code and managing the code as it moved upto 5+ files was turning out to be a problem. The solution : Eclipse-pydev package: http://pydev.org/
This is an Eclipse plugin that will allow Python development in Eclipse.
The eclipse-pydev package was available until Ubuntu Jaunty and in Karmic, this package has been removed :
http://ubuntuforums.org/showthread.php?t=1307755
https://bugs.launchpad.net/ubuntu/+source/eclipse-pydev/+bug/450031
https://bugs.launchpad.net/ubuntu/+source/eclipse-pydev/+bug/135556

The following steps show how to install the Pydev package on Eclipse for Karmic. Remember, the package is not available officially in Ubuntu Karmic and if you run into any troubles, you can only post in the Ubuntu forums and hope for help (which I'm sure, you'll receive and a good one, as I did)
For this, it is necessary that you run Eclipse as a super-user for once. After the plugin installation is complete, you can use Eclipse as a normal-user
After launching Eclipse as a super-user

1. Click Help -> Install New Software
2. Click "Add"
3. Add Name: Pydev and Location: http://pydev.org/updates and Click "OK".
4. Now you should see two options as shown here. Select only "Pydev" and follow the screen shots


5. Restart Eclipse and you should now be able to develop Python code in Eclipse :)
Leave a comment in here if you see something different!

Friday, October 16, 2009

Ubuntu and Mobile Broadband

I have purchased a Nokia E63 a couple of months back and I like the phone...for all its features and the best part - it gets me connected when ever and where ever I (well, where ever my service provider has a tower ;) )want!
Couple of reasons why I bought this phone
1. WLAN
2. Connect to PC and work as Modem
3. QWERTY Keyboard

I have not until today used the 'Modem' feature yet. But, in a couple of days, I'm planning to visit a remote place where I'm not expecting any internet connection (but a full mobile service!). So, wanted to test that out. I googled and went through a couple of blogs that discussed about wvdialconf & wvdial, but did not work for me. Then one of the posts in the Ubuntu forums (can't find the link :( ) caught my eye.
Here are the steps
1. Right click on the Network Manager applet and click 'Edit Connections'
2. Click on the Mobile broadband tab
3. Add a new connection and follow through the two dialogs

and valla, it works! it works out of the box! Is Linux easy to use or what?

oh and, me and friend of mine..got the USB sound device working with some tweaking..more on that in the next post!
As you can see on the right, only a few days left for the next big release..eagerly waiting!

Friday, October 2, 2009

Ubuntu Karmic Koala A.K.A. Ubuntu 9.10

Hmm..I cannot tell u ..how many times..writing this blog saved me from re-inventing the wheel..
Now, as you can see on the right side...Ubuntu Karmic Koala , alias, Ubuntu 9.10 is Beta now ..Yay!
Download using the torrents is in progress now...
Will run it on the Virtual box in a couple of hours :)..and btw, I'm buying a new Dell Laptop (Dell studio 15) and will hopefully run Karmic on it!
I cannot really use the netbook version as I'll be rampaging on the laptop..but I'd love to try it on VM..Keep watching this space for some nice screen-shots and tips with Karmic!

Saturday, August 1, 2009

Ubuntu , Sun Java JDK and Eclipse

For some reason, I had installed Eclipse on my system and as a dependency it pulled java-gcj packages along with it and if JAVA_HOME is not set, it ends up using java-gcj packages.
BTW, I have a question is java-gcj the same as OpenJDK? (which went through Sun's certification recently)?
Any way, I've for all my purposes (well, a very less # them) had used Sun's JDK and JRE all my life and did not want to move to another JDK and JRE.
I had already installed using Synaptic sun-java6-jdk and related packages
However, after the installation of Eclipse, it always uses the java-gcj binaries and not the Sun's Java binaries.
What to do? Ubuntu's help at work again. Thank you Ubuntu's Documentation team!

Here is the link:

Below are the commands:

update-java-alternatives -l

Should list you the possible alternatives
To choose Sun's java/JDK

sudo update-java-alternatives -s java-6-sun


and ofcourse, I've had to set the JAVA_HOME in /etc/profile
Valla, now eclipse uses Sun's JDK and JRE :)

Monday, June 15, 2009

Uploads!

I've been using BitTorrents to download the latest Ubuntu images.
I had downloaded the Ubuntu 9.04 via. the torrents.
Also, for some reason, I had downloaded the Ubuntu 8.0.4.2 (600+MB) and the OpenSuSE KDE Live CD (600+MB)
and now I'm downloading Ubuntu 9.04 alternate CD and will download 8.0.4.2 alternate CD using the torrents!

Now, the typical thing about torrents is that as you download, you also "upload" or rather, allow others to download the same file from you!
I've now uploaded 300+MB (Ubuntu 9.04 desktop ISO), Ubuntu 8.0.4.2 (600+MB) and OpenSuSE (600+MB); thatz 1500 MB and up; feels very gud :)

More Ubuntu for uploads!

Saturday, April 11, 2009

We're linux contest winners announced!

"We're Linux Contest" Winners announced!
One of the best PRs for Linux @ zero cost :)..
Click on the links below to view the videos

Winner

Runner-up #1

Runner-up #2

You can view the other videos here.

Friday, March 27, 2009

Ubuntu Jaunty Beta release and the countdown

Ubuntu Jaunty Beta is released!
Also checkout the kewl Jaunty countdown on the right :D

Tuesday, March 24, 2009

Ubuntu jaunty new login screen - awesome!

Take a look at the Ubuntu Jaunty (Alpha 6) login screen. These look perfect and professional! (Click on the images to see these enlarged)

















These images are from the Jaunty Alpha 6 running as a VM on QEMU emulator.
On a side note, I was surprised that a sound device was detected on the virtual machine, which never was detected on my previous virtual machine images running on QEMU...but no sound yet..:(..Need to check what is going on !

Monday, March 16, 2009

Restoring your Ubuntu password

As you probably already know, Ubuntu does not allow you to login as root onto the system.
Any action that need root privileges needs to be run using the "sudo" utility
For ex: sudo command
Situation 1:
You have a dual-boot system with Ubuntu and Windows and haven't logged onto the system for a while and you forgot the login password for the Ubuntu installation

Situation 2:
You have installed Ubuntu as a VM and have not booted the system for a while and you forgot the login password for the Ubuntu installation

What would you do now? Re-install the OS?
Here is a very simple solution!

Boot up the Ubuntu installation..and
Press the ESC key immediately to see a Menu that would show the different installations available on the system
Select the option as shown in the image on the right here:
The option shows a "recovery mode" in the brackets.


P.S. Though the snapshots are from a Ubuntu server boot-up , the same will apply to Ubuntu Desktop editions too.

The system boots up and shows the prompt shown below:


{
NOTE : Anything that happens after here has to be done very carefully and exactly as listed below. 'Coz, you'll be root and root can do ANYTHING! Including wiping your hard disk clean if wrong commands are used. You've been warned.
}

Select the option "root Drop to root shell prompt" and this will bring you to a shell prompt with root privileges
Now, if you remember the user, you could simply do a

passwd username

and re-set the password of the user.

But, if you do not remember the username also, run the command


cat /etc/passwd

and this will list all the users on the system; may be the list will make you remember the user that was created as the "sudo" user.

You should be able to login at the UI prompt, after the password has been re-set.
Now run the command,

reboot

and let the system boot normally

If you still have problems logging into the system, leave me a comment with your e-mail id, I'll contact you!

Tuesday, March 3, 2009

Random non-Ubuntu post

The approaching train caught the corner of my eye...it appeared to be approaching quicker than I expected on to the platform # 2.....I was on platform # 1 which was connected to the other platform by a foot-over bridge.....I dashed up the flight of stairs ...at the same time wondering, will I make it to the other side before the train leaves the platform ....40 steps in number.....2 steps at a time.....trying to avoid bumping into other people climbing down onto platform #1.........slid down another 40....... almost jumping a couple of steps to land on the platform......

and then....................


the train moved............

Monday, March 2, 2009

Meet my new friend - K3B.... Ripping Video CD

I promised to write about Plone and other things, but this one cannot wait.
I have a couple of VCDs but I'd never watch them out of the CD drive....ever....
Earlier, I used to load the CDFS driver(check my post here) and then mount the VCD with the CDFS as the mount option for the file system.
However, one problem (that I did not realize earlier) is that the CDFS driver needed to re-compiled every time the kernel was upgraded (I update my system with all the patches Ubuntu shows me :D ). This worked for a while, but when I tried to re-compile the CDFS, even the latest version cribbed :( and I was again out on the web road looking for a solution.
I read some where on the Ubuntu forums that VLC could play the VCDs (without mouting with CDFS) out of the drive and that worked, but I did not want to that do that. Then again Ubuntu forums was there to the rescue and found information about the K3B - A CD burning tool optimized to run with KDE.

sudo apt-get install K3B


However, to be able to rip video CDs, you'll also need another package "vcdimager"

sudo apt-get install vcdimager

Now, the option that I loved the most "Rip Video CD" and this worked out of the box and this is my new friend :D

I'd love to know how this ripping thing works with out actually mounting with the right file system!

Tuesday, February 24, 2009

Coming up!

Coming up more posts on Plone and re-setting your lost Ubuntu user password.
Keep watching this page for more technical news!

Watch out the latest and greatest Ubuntu release in April! Ubuntu Jaunty release date is Thursday 23rd April 2009!

Sunday, February 15, 2009

How to run gnome scripts as root?

You probably are already aware of $HOME/.gnome2/nautilus-scripts/ directory..
You could copy any script here with executable permissions and this will enable the "Scripts" label on the right-click menu and the scripts available will be listed in the sub-menu.
Say, you have a script that needs elevated* privileges, but do not want to open up a terminal to type in the password, but want to open up the fancy dialog that blocks everything and just allows you to type in the "sudo" password.
You could use the 'gksudo' command to accomplish this task
My Scripts menu features a script "Terminal (as root)", which allows me to open a terminal with elevated privileges.

#!/bin/sh
gksu gnome-terminal
exit 0

There you go...now you will also be able to launch the UI dialog that allows you to type-in the sudo password as shown in the image here





WARNING: Running applications with elevated privileges is risky. You better know what you are doing.

Saturday, February 14, 2009

Command line updates to Ubuntu DEB packages

Ubuntu Desktop provides Synaptic which automatically informs you of the available updates, weekly/daily based on your choices (daily, every two days, weekly or every two weeks)
But, with the Ubuntu server distribution you do not have a GUI and what to do to check the available updates automatically?

Here are the commands.


sudo apt-get update


will update the meta-data of all the packages that are "known" i.e known to the package repositories added to your /etc/apt/sources.list

sudo apt-get upgrade

will download and install any updates that available to the currently installed packages.
However, this will need a user intervention that asks your approval to go ahead and install the packages
It is recommended you download and install the available fixes regularly to ensure your system is free of any know vulnerabilities.

Saturday, January 31, 2009

OpenOffice.org spell check does not work!

When installing Ubuntu, I choose the default language to be "English (India)" and apparently OpenOffice.org does not have a dictionary for "English (India)" and as a result the Spell check does not detect any errors!
Weird isn't it? How different is English (India) from English (USA) or English (UK) (apart from Slangs, of course). I wish if possible, I could create a dictionary myself..Need to find out how to do that...
However, a simple solution to this problem, is to make OpenOffice.org Writer to use English (USA) or English (UK); I choose English (USA) (no particular reason to do so).

Open the OpenOffice.org Writer, Tools -> Options -> Language Settings -> Languages .
The right pane should show:
Default languages for documents -> Western

Choose "English (USA)" and you should see a small "ABC tick mark" beside the option. Click "Ok" and now you should be able to do "Spell Check" the document. :)

Ubuntu Pocket Guide; e-book downloadable for free!

These days, I've been following the different Ubuntu developers' posts Via. Planet Ubuntu.
and if not all, most of the posts have taught me something new about Ubuntu, Linux and Windows ;)
A couple of posts referred to the Ubuntu Pocket Guide and I decided to check it out and was very happy to know that it can be downloaded for free and re-distributable (of course, the un-modified format :) ).
I'd say, this is definitely a book for any one who wants to try something different (read, Windows and Mac users :p ). I am gonna pass this book around and see if I can influence at least a couple of my acquaintances to use Ubuntu :D
I should also say, this is not a book for power users, well, power users do not need any books ;)

Download the book!

Tuesday, January 20, 2009

Ubuntu Intrepid and Cairo dock

Although, cairo-dock was available in Ubuntu Intrepid repositories, this document suggests installing it using the below entry in /etc/apt/sources.list
deb http://repository.cairo-dock.org/ubuntu intrepid cairo-dock

and so I did and I love it.

Isn't this a new way to look at the so called and boring "Start" button :p

However, the problem was that the cairo-dock did not launch itself automatically after my login!
I had to launch Alt+F2 and type in cairo-dock every time

I have read about Upstart earlier and tried if that would work and before I could finish making it work( now, I do not know if that would have worked :( ), I have discovered a better way to get it working

Here are the steps:
1. Main Menu -> System -> Preferences -> Sessions
Or
Alt+F2 and run "gnome-session-properties"

2. Click the "Add" button and look into the image here for the details to fill in.
3. Logout and Login and valla! Cairo-dock launched automatically after login :)

Saturday, January 10, 2009

Ubuntu apparel

I've been for quite some time now wanted to get myself a Ubuntu T-shirt and was looking for ways to order it over to India.
One of my friends was returning from the U.S. this Jan and so decided to have him order it for me :)
And...guess what?? I went to office last week sporting my Ubuntu T-shirt and Ubuntu hoody :)
Check out the Ubuntu store for yourself!

Sunday, January 4, 2009

Upgrade to Intrepid Ibex

Yesterday over the night, I upgraded from Ubuntu Hardy to Intrepid. I know Hardy is LTS, but them I've been reading again and again that Intrepid is quick and very fast, I decided to upgrade to Intrepid. Though, I already have a test machine with Intrepid at my work place, I initially was against upgrading to Intrepid as Hardy was an LTS. Anyway, now that I've upgraded my PC @ home to Intrepid, I could not have been happier.
The upgrade as it is was quite easier, and man...Nautilus, Gnome and boot up and shutdown was so fast, I could actually quickly differentiate the speed compared to Hardy!

I've been running Intrepid on a VM on my PC and now I'll have it upgraded to Jaunty Jackalope! (Ubuntu 9.04)
There is a small glitch, troubling me; after the upgrade, the Network Manager icon shows disconnected (where in fact, actually I was totally connected to the Internet). This could be because of my entries in /etc/network/interfaces (as I run my VM over QEMU)
I'm reading through the forums and launchpad bugs to resolve this ASAP.