Changing the http_proxy variable in Karmic (9.10)

After a lot of searching, I finally found the place to reset the http_proxy variable in Ubuntu 9.10. I checked in synaptic preferences, the proxy settings in system->admin->proxy, ~/.bashrc, /home/root/.bashrc, /etc/wgetrc but couldn’t find it set anywhere.
I finally found it in /etc/environment. Commenting it out and rebooting it finally stopped setting the http_proxy variable.

Setting up a website in home directory instead of /var/www

I have an Apache web server set up with cakephp as the framework on Ubuntu. But I got bugged very quickly at having to sudo to edit every file since they were placed in /var/www. Besides, it didn’t strike me as the right thing to do.

So, a quick google on “/var/www on ubuntu” took me to this page which turned out to be exactly what I was looking for. You can set it up so that http://localhost points to a folder in your home directory (/home/user/public_html). Now I can edit all files without sudo and it works with http://localhost.

Formatting SD Card on Ubuntu

This is a post just to remind me about the steps needed to format an SD Card on Ubuntu 9.10. I just got a class 4 8GB Kingston SD Card to replace the 1GB Stock SD Card on my G1. Since I’m using a rooted ROM (this one to be precise), I need an ext+fat+swap partition setup on my SD Card. I needed to format the new card identical to the old one and copy the old data onto the new card.

First of all, Ubuntu has a very weird delayed write mechanism that writes data to plugged in devices only when you eject or unmount them. So, if you write something to the card and pull it out, there’s a very good chance that it doesn’t show up. I haven’t seen this anywhere before, especially when using gentoo earlier.

GParted doesn’t display my card which is /dev/sdb. (Update in comments below) So, I decide to use the command line for this. There are three command line utilities for formatting, i.e. fdisk, cfdisk, sfdisk.

cfdisk gives you a UI so that you can select everything using arrow keys. But for some reason, when creating the partitions, it kept creating them as /dev/sdb1p1, /dev/sdb1p2 and /dev/sdb1p3 instead of /dev/sdb1, /dev/sdb2, /dev/sdb3. This kept the disk from showing up when listing the partition table with sudo fdisk -l. Didn’t really investigate why it was doing that. Checked out sfdisk, but the commands are different and looked like I’d need to learn a bit more before I could use it.

So, finally came down to fdisk which is quite handy once you get used to it. Important commands are ‘m’ which displays all the commands and ‘p’ which prints the partition table. So, first created the partitions using ‘n’ and setting them up as 7.4GB win95 fat32 (code ‘b’), 500MB ext3 (code ’83’), remaining 30+MB swap (code ’82’). The file system type can be set using ‘t’ and the codes obtained using ‘L’. The partition table is written using ‘w’.

Now, we need to format the different partitions with the corresponding file systems. This is done as follows:

  • Fat32: sudo mkfs.vfat /dev/sdb1
  • Ext3: sudo mke2fs -j /dev/sdb2 (the -j is required for ext3. Omit it for ext2)
  • Swap: sudo mkswap /dev/sdb3

Once this is done, you should immediately be able to see the different partitions in Nautilus.

Restore default settings in gnome on ubuntu

I got tired of the Mac theme for ubuntu and decided to get rid of it (also realised that Ubuntu needs to be unique and not look like a mac clone!). So after mucking around with the settings for a while and finding that it’s not easy to undo the damage, I started searching online. That’s when I came across this post and the idea is so simple that I wondered why I didn’t think about it to begin with. Take a look, it’ll reset your ubuntu gnome desktop to ‘factory settings’ :).

Link: http://linuxfud.wordpress.com/2007/02/14/how-to-reset-ubuntugnome-settings-to-defaults-without-re-installing/

Update: As mentioned by A Y Siu in the comments, it would be safer to rename your folders using mv rather than delete them flat out.

Personal Diary options for Ubuntu

Looking for some software for a personal diary, I came across the following two utilities for Ubuntu:

ThotKeeper

It’s a pretty good diary option, but has a very major drawback – the diary entries are stored in plain xml on your hard disk and it doesn’t need a password to login. In fact, it doesn’t have a password option. If you want a diary just to take notes of your daily tasks or an alternative to an online blog (why?), you can go ahead with this.

MyDiary

This is exactly what I was looking for. It has password protection, keyboard shortcuts and easy to use interface. It even has a shortcut to insert the time in your diary post! It’s as if the developer was reading my mind. I would highly recommend this for anyone looking for a personal diary. Just remember that it needs gtkspell installed for python otherwise it won’t even start. If you’re using ubuntu, just search for it in synaptic and install the python libraries for gtkspell.

Update:

Alamanah (updated link)

Almanah looks good, but again the main negative for this one, just like thotkeeper,  is that it isn’t password protected. But apart from that it has a nice calendar and the ability to store the diary entries in encrypted format. One unique feature about Almanah is the ability to add a definition to some text. This definition can be used to link your text to a file, note or a URL. Pretty neat. Plus it’s available in synaptic, so you can give it a shot.

Update (23rd Sep, 2011):

Lifeograph

Another personal diary option brought to my notice by Amit in the comments below. Unfortunately, I couldn’t get it to run on my Debian setup (yes, I’ve moved to a virtualbox Debian installation from a full blown Ubuntu install) and many of the dependencies seem to be in the unstable repo. But the screenshots look good and the features look great. It has been sometime since it was last updated (~10 months), but hopefully it will make it to stable some day.

Ubuntu Jaunty: Error authenticating packages partial upgrade

Was getting this error when trying to do a partial upgrade in Ubuntu (I didn’t select ‘Partial Upgrade’, it brought it up on its own). Then checked in Synaptic->Repositories->Authentication. Apparently, http://ppa.launchpad.net jaunty was not authenticated.

A quick google brought me to this post. Looks like I’m not the only one with this problem. I followed the instructions left by one of the users and that fixed the authentication problem.

Then tried running the Partial upgrade again and it worked!

Jaunty (Ubuntu 9.04) on Acer 4530 – nvidia drivers

Using the default recommended version of the nvidia drivers (180.44), I found that while running compiz-fusion and AWN my screen would hang every now and then for no reason. It would hang if I played around with the wobbly windows for too long or sometimes even if I just minimized firefox.

The only way to reproduce it seemed to be to use the j2ee version of eclipse ide 3.5 (Galileo) and click on Windows->Preferences. The screen would hang for sure and only way to fix it would be a hard reboot.

After a post on the compiz-fusion forums it looked like the problem was because of the driver I was using. Also, on the nvnews forums, I found this thread which showed that a lot of people were having trouble with the 180.* version of the nvidia drivers.

So, I installed envyng from synaptic and downgraded the drivers to the next recommended version i.e. 173.14.16 which made my browser fonts look like crap and slowed everything down. Atleast it stopped hanging, but I couldn’t bear the slow crawl of the display.

So, I finally bumped into this blog post which explained how to manually install the drivers on Ubuntu.

DISCLAIMER:

  1. I presume you are already using the nvidia drivers but are having frequent performance problems because of the &%#@ 180.* drivers. If you do, then you can use the existing xorg.conf with your new drivers and it’ll work just fine.
  2. I don’t know how to uninstall the drivers. I know the driver installer from nvidia has a –uninstall option, but I haven’t tried it. If you did and it worked for you, please leave a comment.

These are the steps I followed:

  1. Download the latest nvidia drivers. I downloaded NVIDIA-Linux-x86-185.18.31-pkg1.run from the nvidia site. It’s available under GeForce 9Mobile series and Linux x86.
  2. Install envyng-core from synaptic. The text version will be all you need.
  3. Go into console mode using Ctrl + Alt + F1. Before that copy all these steps into a file in your home directory so that you can read them when you’re in console mode. Before going to the next step if you need to get back into X, press Ctrl + Alt + F7.
  4. Login using your username and password
  5. kill gdm/kdm using sudo killall gdm or sudo killall kdm. You cannot uninstall/install drivers unless you kill X.
  6. Use envyng to uninstall the drivers: Type envyng -t and select uninstall drivers.
  7. Backup your existing xorg.conf using:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_good_backup
    I would highly recommend this step so that you don’t lose your good working xorg config. You will need it after you install the new drivers.
  8. cd to the location where you’ve downloaded the latest nvidia drivers.
  9. Give execute permission by typing:
    chmod +x NVIDIA-Linux-x86-185.18.31-pkg1.run (or whatever your version is)
  10. Run the drivers using:
    sudo ./NVIDIA-Linux-x86-185.18.31-pkg1.run (or whatever your version is)
  11. Follow instruction on the blue screen.
  12. After completing installation, copy your old good working configuration of xorg.conf using the following command:
    sudo cp /etc/X11/xorg.conf_good_backup /etc/X11/xorg.conf
    This is assuming you already had the ubuntu recommended drivers installed before this. If you didn’t then you will probably need to do some poking around to get your xorg.conf working properly.
  13. Reboot and enjoy your new slick and better performing compiz-fusion!

After doing this, I downloaded the jee version of eclipse 3.5 and clicked on window->preferences and it worked fine! Looks like it’s working great!

It has only been a few hours since I installed it and haven’t seen any problems yet. If I do find anything, I’ll update this post.

Acer 4530 and Ubuntu 9.04 – Perfect!

It’s here ladies and gentlemen … the perfect match. Ubuntu 9.04 appears to be well and truly tailor made for Acer 4530. Absolutely everything works. I’ve got the wifi working, sound playing, nvidia graphics working seamlessly with compiz-fusion.

The best part is, it’s working off a windows NTFS partition with write access to all the NTFS partitions, thanks to Wubi! And the entire installation took a little over 5 minutes. That’s even less than what it would have taken if I had installed a full blown Ubuntu installation.

My biggest concern was about the Atheros wifi card which has always been a problem in Linux because of the bad drivers. But Ubuntu 9.04 works out of the box. My laptop uses the ath9k kernel driver which is working great.

I feel everyone should give this a shot, windows users included. I’ve been dying to get rid of the vista home premium that came bundled with my laptop and along comes ubuntu 9.04 with it’s amazing compatibility. I’ve been a die-hard gentoo user for the past 5 years and now seeing how convenient ubuntu is, I finally feel Linux has arrived!

Edit:

Ok, here’re some more details:

This is my laptop: Acer 4530-6823 which has AMD Athlon XP 64bit QL-62 processor. I’m using the 32bit version of Jaunty and the default Gnome desktop.

Of course, I would say that this distro, although miles ahead of the others, isn’t without some bugs. The audio port for headphones/speakers doesn’t work out of the box. Neither does the built in mic. But I think this can be fixed by updating/configuring alsa.

But the webcam works fine. I’ve tried it with Ekiga and it’s working.

I did try installing Ubuntu 8.10 on my friend’s Acer 4530 which was identical except for the memory and HDD and I gave up after spending a miserable few hours struggling with it. Same was the case with Suse. But the ease with which I could get Ubuntu 9.04 up and running is amazing. If you’ve got this laptop, I would highly recommend this version. Also, if your laptop has got an atheros wifi card. This is the first Linux distro I’ve seen which has got it working out of the box (I couldn’t get it to work in any of the others even after struggling with them – Ubuntu 8.10, OpenSuse 11.1, Gentoo!).

Edit2:

Ok, got the headphones working. Followed the instructions in the post given by Asif over here:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/360181/comments/1