A quick script to list all installed packages

I wanted a list of all the installed packages on my Xubuntu system. The easiest choice was to start the Ubuntu Software Center and click on the “Installed” tab. But, that requires at least one mouse/touchpad click and that is painful for me! So, I wanted a command-line option. Naturally, I googled for it but came up with no quick-to-use, ready-made solutions. So, I read glanced through the Ubuntu Community AptGet Howto and put together a quick, tiny script that is now publicly available as yet another GitHub Gist.

You will have to download the gist which will arrive in “tar.gz” format. So, you untar-gz it (tar fxvz <gist-name>.tar.gz). You will find the script itself under “<gist-name>/” directory after the untar-gz finishes. So, once you have the script, copy it to a convenient location like say “/usr/local/bin“. Assuming you haven’t renamed the script file itself, you should now see the file as “/usr/local/bin/listInstalledPackages.sh“. So, “chmod 555 /usr/local/bin/listInstalledPackages.sh” and you are good to go.

Assuming “/usr/local/bin” is in your PATH, here are some simple ways to use the script:

$ listInstalledPackages.sh | less

That will generate a paginated list of all the packages installed on your system.

$ listInstalledPackages.sh | wc -l

That will generate a total count of how many packages are installed on your system.

$ listInstalledPackages.sh | grep -i bluetooth | less

That will generate a paginated list of installed packages that have the string “bluetooth” in them. You can obviously use any other single word in place of bluetooth to find packages with that specific string.

$ listInstalledPackages.sh | grep -i pidgin | less # list all installed packages with pidgin in them
$ listInstalledPackages.sh | grep -i zenity | less #list all installed packages with zenity in them
$ listInstalledPackages.sh | grep -i ibus | less #list all installed packages with ibus in them

So, that’s that! 😀

This script should work on most Debian based systems like:

  • Debian itself
  • Ubuntu, Lubuntu, Xubuntu, Kubuntu
  • Linux Mint
  • Bodhi Linux
  • CrunchBang Linux
  • Kali Linux
  • etc.

If you want to know how this simple script works, read the comments at the bottom of the script file.

HTH!

Wireless Router + DSL Modem Rig

I put this note together for my future reference. But, then, a friend suggested that it may be helpful to others. So, I decided to post it here, on the Interwebs …

First, the backstory:

So I have had this D-Link 2730 DSL modem at home for the past year and half. Out of the box, this was a full fledged DSL-modem + Ethernet and Wifi router. Setting it up was easy, but, the Wifi on this box had always been pathetic. It started with “good signal upto about 10 ft” and gradually faded to “ok signal upto about 5 ft”.  Then, over the past 6 odd months, the Wifi started getting weaker to the point where it completely died out on March 3, 2014! That was a sad day because I had to tether my laptop to the modem over an Ethernet cable. And there was no way for my phones and tablet to connect to the Interwebs over wifi at home. So I wondered how to fix my no-Wifi at home situation.

Of course, the easiest answer was to go out there and buy another modem from an electronics retail store, like an Indian version of America’s Best Buy. India now has a lot of retail stores, big and small, that sell various computer accessories. The closest such store was just a few kms from my home. But, considering the heat and even worse, all the people interactions I would have to undertake to get a modem, I figured I would buy one online.

So, I checked at various online retail stores in India. And my favorite store so far, Flipkart, had the modem I wanted. But, ever since Flipkart goofed up my last order I have desisted from ordering anything from them. Also, with Flipkart the delivery timings are like “anytime from 9:00 am to 7:00 pm” which basically means that I would have to sit at home for an entire day just waiting for my shipment to come in.

There was a third way: I could go the route I had taken a few years back when I setup an old Linux laptop to be the Wifi gateway. Essentially, the Ethernet on the laptop was connected to the modem and then, using simple iptables configuration, I had setup the laptop as a Wifi gateway (with NetworkManager disabled). This had enabled my other notebooks to connect to the Wifi-gateway-laptop over Wifi (obviously) and then the laptop would forward all the traffic in/out the modem. But, this time through I was in no real mood to “use” an entire laptop for such a trivial task.

So, just as I was wondering if I should go out there and get myself a new modem a light bulb lit up in my head. Somewhere in all the stowed away “old equipment” I had a 3G router that I had bought a couple of years ago but never really used. So, if I could locate it:

  • I wouldn’t have to go out in the Indian heat
  • Even more importantly, I wouldn’t have to interact with all the people (the auto-rickshaw drivers, the unnecessarily arrogant boys and girls who work at those retail stores, the crazy sales people who want to sell me more than I want to buy, the always suspicious security that guard the retail stores, etc.)
  • I would learn some networking

So, if I could locate that 3G router then, it would be a win-win situation (no people interaction + learning networking). So, with all the will power I could muster, I pulled myself out of my chair and rummaged through all my boxes to ultimately find an old but unused TP-Link MR-3020 3G router in one of my boxes.

Alright! So, that’s the back story. Now onto the “putting together the networking rig” part of the story …

Setting up the networking rig:

I had a fairly basic configuration in mind.

A diagram of my home network made up of D-Link 2730U DSL modem and TP-Link MR3020 3G router

A diagram of my home network made up of D-Link 2730U DSL modem and TP-Link MR3020 3G router. This diagram was created using LibreOffice Draw. (NOTE: this diagram uses icons from Cisco and images from D-Link and TP-Link. See references at bottom of the page.)

Realize that this configuration is similar to the “old linux laptop as a Wifi gateway” mentioned earlier. The only difference here is that a physically big piece of hardware, the old linux laptop, has been replaced by a tiny piece of dedicated hardware, the TP-Link 3G router.

Setting up the TP-Link router wasn’t exactly “a charm”. The router has all these various modes called AP, WISP, WPS and what have you. It can act as a repeater, an client ap, a server ap and even more what have you. Without digressing: one of the biggest reasons Wifi is so frustrating is that you really need to know about all this stuff to figure out what you really want. Wifi is, clearly, not as simple and easy as Ethernet: plug-n-play. But, the biggest stupidity with this specific TP-Link MR3020 3G router is that it has this little “mechanical” switch which puts the router into various modes. So, I was never sure whether the physical/mechanical switch overrode the software configuration I did or was it the other way around. The confusion was further exacerbated by the fact that the TP-Link router continuously shows “help text” in the right-most frame of the router’s configuration web page. The fact is that this help text is complete and utter gibberish. (NOTE that I am not saying I know English well … but, I can assure you that the TP-Link 3G router help text is worse than the gibberish the Minions speak. I feel that TP-Link should hire an American technical writer to create sane user-manuals and online-help.) But, getting back to the point of this post …

After playing with various configuration settings for almost 2 hours and having forgotten English because of all the gibberish help the TP-Link 3G router kept showing on the side (just kidding … about the forgetting English part), I figured I had wasted enough time. What I wanted was really simple (see the diagram above) … so I did what most computer engineers do when they have faulty or not-working-as-expected computing equipment: I hard reset the TP-Link 3G router. But, before that I set the physical/mechanical switch on the TP-Link 3G router to “3G” mode. Then, I connected the box to my laptop over Ethernet and logged into it. Although it appeared to have been completely reset, I didn’t want to take chances with the Chinese (just kidding). So, I hunted down the “reset to factory defaults” link on the router’s configuration page and reset it once again.

Then, after the reboot, setting it up was “almost” fairly easy:

  • I enabled a Wifi network and secured it with WPA/WPA-2 (Personal) password
  • I enabled MAC filtering and added the Wifi MAC addresses of all my computers, phones and tablet
  • I setup the DHCP server on the box to dish out specific IP addresses to my computers. This makes it easy for me to transfer files from my phones and tablet to my computers. (NOTE that I run Open-SSH server on all of my computers. And I have Turbo Client on all of my phones and the tablet.)
  • I setup the box to connect to the Interwebs only over WAN and therefore to completely ignore 3G. This WAN connection is through the Ethernet port on the TP-Link 3G router.
This windows shows the TP-Link MR 3020 configured to use WAN (over Ethernet) and to completely ignore 3G.

The TP-Link MR 3020 configured to use WAN (over Ethernet) and to completely ignore 3G.

After saving that configuration I reboot the TP-Link 3G router and hooked it up to the D-Link 2730 over Ethernet.

With that setup, my computers, phones and tablet showed that they had a super strong Wifi signal like I had never seen in the past few years. 🙂 I got all of them to connect to my newly setup Wifi network. But, I couldn’t browse the Interwebs! 😦

Do you remember that earlier I said it was “almost” easy to setup? You see, the TP-Link 3G router has this crazy thing called MAC-clone which I had never seen/heard before and I hope I never have to deal with it again! Also, the gibberish help added to all the confusion. You see, earlier I had copied the MAC address of the D-Link modem into this “field” on the TP-Link 3G router’s configuration page because I was unable to figure out what the TP-Link help manual was trying to convey. But, since things weren’t working as expected, this seemed to be the only field that could be causing the problem. So, I “restored” that field to have the TP-Link 3G router’s MAC address. I saved the configuration, prayed to the Gods and reboot the 3G router. And after about 3 minutes, I was browsing the web like there was no tomorrow. 🙂

But, the show wasn’t over boys-n-girls. I still had to get a few things done on the D-Link 2730.

  • I directly connected my laptop to the D-Link modem over Ethernet and logged into the modem
  • I completely disabled Wifi (rather, whatever was left of it) on the D-Link 2730.
  • If you didn’t realize why I had to directly connect my laptop to the D-Link modem, then here it is: Because of the two address spaces (the TP-Link router gave out addresses in 192.168.0/24 on its Wifi. The D-Link modem gave out 192.168.1/24 on its Ethernet … thus giving the TP-Link router’s Ethernet port an IP address of 192.168.1.111) the D-Link modem had no way to get back to my computers. It probably assumed that any unknown IP address (even private IP?) should be routed out to the ISP. So, to get my computers and the D-Link modem to talk to each other I setup a static route on the D-Link 2730 so that all communication with 192.168.0.0/24 is directed back to the TP-Link 3G router (192.168.1.111) over Ethernet.

And finally, all was good. Now, I have a fairly decent Wifi signal all through my house. In fact, even my neighbors are getting it and I noticed they have already tried to hack in … so far unsuccessfully.

So, that’s that boys-n-girls. Thanks to my laziness (not wanting to go out in the heat) and craziness (wanting to learn the TP-Link gibberish and waste my time putting together this rig), I finally put together a rig that gives me decent Wifi access all through my house and lets me connect to the Interwebs. I am happy … for now.

References:

HTH!

Oscars 2014 … How did I do?

So, the Oscars 2014 are over and we have the results. How did you do in predicting the winners this Oscar season?

Here is how I did with my predictions: About 12 hours ago (at the time of writing this post), I put my predictions for the Oscars 2014 on Facebook.

Dallas Buyers Club movie poster from Wikipedia. Mathew McConaughey won

Dallas Buyers Club movie poster (from Wikipedia).

The easiest winner to predict this year was Jared Leto. His performance in the movie Dallas Buyers Club was fantastic. All the while that I was watching the Dallas Buyers Club movie, I was disturbed because I knew I had seen that “queenie” in some other movie, but, I just couldn’t figure out which movie it was. So, as soon as I got home I checked on Wikipedia. And I was shocked to learn that the actor was Jared Leto, yes, the same guy who acted as the younger brother to Nicolas Cage’s gun runner character in “Lord of War“, one of my favorite movies. Leto’s acting in The Dallas Buyers Club was superb and he deserved every bit of the award conferred on him. In fact, I felt that Leto should have been given “best actor” while Mathew McConaughey should have been given the “best supporting actor” award. Just saying!

The second “easiest” to predict winner was Mathew McConaughey. McConaughey’s role and acting in The Dallas Buyers Club was so far distant from the usual McConaughey roles and acting that I felt the Academy in specific and Hollywood in general had to recognize and reward the rise of a star who had goofed around so far but was ready for serious roles.

Gravity movie poster.

Gravity movie poster (from Wikipedia).

The only other movie I had seen from the list of movies at Oscars 2014 (featuring humans, not minions) was Gravity. And what a movie it was … err, what a movie it is! Fantastic! Fantastic! Fantastic! So, I was kind of SHOCKED when Gravity did not win the best movie award. I was even more shocked when Sandra Bullock did not win the best actress award for her role in Gravity. In fact, Cate Blanchett winning for her role in Blue Jasmine came from out of the blue, because I didn’t even know of that movie.

The only other surprise for me was that my minions from Despicable Me 2 didn’t get to do stupid things or speak gibberish while receiving the award for best animated feature film at the Oscars 2014. I haven’t seen Frozen so I cannot say whether it was worthy of the win but I felt DM2 was a fun movie that should have won the award for best animation.

The DespicaBlimp was a blimp disguised as a Minion used for advertising the Despicable Me 2 animated feature film.

DespicaBlimp (from Wikipedia).

So, overall, I predicted 14 awards out of all the possible ones. And I got 9 correct, giving me a “prediction accuracy rating” of about 64%. See this spreadsheet for how I came up with that result.

On a side note, I feel that if Hollywood wasn’t so uptight about its release dates I could have achieved a higher prediction accuracy. Just saying. 😀

Poster for 75th Academy Awards, 2003

75th Academy Awards, 2003 (from Wikipedia).

On a final note: my best prediction rating was way back in early 2003 for Oscars 2003. A friend dragged me to watch Chicago at a small movie theatre in San Jose, CA. I say “dragged me to watch” because I didn’t want to watch it, but girls rule … so we did her bidding. As the closing credits started to roll and we got up to go home, I happened to say “that movie’s got an Oscar written all over it.” Over dinner, I said Catherine Zeta Jones ought to win the Oscar for best supporting actress. Now, the reason I remember that discussion so distinctly is because I was left stranded at San Jose airport on February 11, 2003, because my friend wanted to see how well I could predict! I was picked up almost an hour after the Oscars were over with a small quip: “Yeah! So, you were right about the two awards you mentioned over dinner that day.” And all the while after that I wondered: you left me stranded at the airport so you could verify whether I was right or wrong? Are you serious? People can be unpredictable most of the times. 🙂

Touchpad problems … SOLVED! :)

I am thrilled! I am excited! I am happy! For the past few days I had been suffering a real bad case of “touchpad problems.” Let me explain.

So, a couple of days ago I switched on an old laptop and updated it to the latest Xubuntu 13.10. Till then I had been using a much smaller laptop with a very tiny, 11.6 inch screen. But, about a few weeks back I realized that I was done with those tiny-screens and really needed to get back to a larger screen on which to work. You see those tiny 10, 11 and 12 inch screen laptops have puny little bodies to go with those tiny little screens. So, the keyboards and the touchpads are smaller on those tiny laptops. And since my 11.6 incher was a Thinkpad, I had disabled the touchpad as I was only using the nipple.

Things were working ok for the first few days after switching to the 14″ behemoth. Or maybe I wasn’t noticing that things weren’t working out ok because I was too enamored with the larger screen. But, when you suddenly move to a 14″ behemoth, after years of using those tiny 11.6″ laptops everything changes. Let me explain some more …

You see on these large 14″ laptops the keyboard keys are well spaced out but you also have to move your hands a lot. But, an even bigger problem is that the touchpads are large on these larger laptops. And the biggest problem with those large touchpads is that they are placed right where your, err … my left palm would rest. Would that be a problem? It was a HUGE problem … at least for me. Because say I am in the middle of typing some code and suddenly the cursor would jump to a completely different location. Why? Because my left palm would “unknowingly” rest upon, i.e. touch, the large touchpad on the behemoth laptop.

This whole cursor jumping problem was getting so frustrating that:

  • I figured I would just throw this older, larger notebook after banging it on the wall a few times. (Yes, I do find computers, tablets and phones VERY frustrating and often contemplate whether I should just go about banging all of my computers, tablets and phones on walls. That was meant as a joke, all though I am sure my future employer will use that against me sometime.)
  • I figured I would go back to those tiny screen laptops/netbooks. But, no matter how much I zoom, i find it hard to work with those tiny screens and their smaller real estate. I mean, you zoom and you suddenly have only 50% of your code visible on the screen.
  • I figured I would get myself a trackball since that is what I was using till about a year ago. But, then, I looked around and realized that because of India’s crazily depreciating rupee and high taxes, trackballs cost a fortune in India! I mean, a China-made trackball sold by an Indian company … obviously without any warranty … costs close to about USD 60!!! That’s freaking crazy, but that’s what it is.

So, as I was about to give up on this older, larger computer and get back to my tiny, puny laptop it suddenly hit me! All I had to do was:

  • disable touchpad taps
  • switch from two finger touchpad scrolling to single finger edge scrolling.

So, I jumped into Mouse and Touchpad settings in Xubuntu System Settings and changed those two things! And voila! (I really need to find the meaning of that word voila, but, I am going to use it right now because I am really excited!) Now, the touchpad on my older, larger laptop behaves just as I want it to behave: no cursor jumping around and no typing in unknown locations. I am THRILLED! I am EXCITED! I am HAPPY!

Here’s how my mouse/touchpad settings were before I made the change … and I am going to assume those are the default settings for Xubuntu, after install:

Touchpad settings "before" I made the change. Notice that "tap touchpad to click" and "two finger scrolling" are enabled ... I guess during Xubuntu installation.

The default settings for touchpad on Xubuntu 13.10. Notice that “tap touchpad to click” and “two finger scrolling” are enabled here … and these setting were causing all the problems for me.

Here’s how my mouse/touchpad settings look after those two changes:

Touchpad settings "after" I made the change. Notice that "tap touchpad to click" is now disabled. Also, I have switched to "edge scrolling".

The new settings for touchpad on my Xubuntu 13.10 laptop. Notice that “tap touchpad to click” is now disabled. Also, I have switched to “edge scrolling”.

So, if your laptop mouse/touchpad is troubling you by making the cursor jump all over the place, change those two settings and you will be Happy, thrilled and excited like me. (I know that’s getting cheesy, but, you would realize my excitement if your cursor suddenly stopped jumping around and let you type your code in a sane environment.)

Show date and time in Xubuntu (as well as other Linux distros)

Microsoft Windows 8.1 has a very neat little feature I use a lot: you can hit “win+c” to bring up the “charm” which shows the clock along with a few other things. For me that ability to see the current date and time makes this “charm” useful. On a side note, I really do not know what that word “charm” means in the Microsoft world but let’s not digress

The fact is that I use my Xubuntu machines more often than my Windows machine. So, I wanted that “show the clock” ability on my Xubuntu 13.10. I basically wanted to hit “win+c”, like in Windows 8.1, and have the current date and time shown in a pop-up-window on my desktop.

I figured I could easily do this with a shell script. Ages ago, I had very briefly played with a command called Zenity. Zenity is a command line program from the GNOME world that lets you show various graphical dialogs. Basically, Zenity lets you add GUI to your shell script.

Knowing all that, I fired up a terminal and read through the man page for Zenity. After a few minutes of playing around with Zenity, I managed to put together a simple script that does what I want: to show the current date and time in a pop-up window on my desktop.

The second part was to associate this script with “win+c” keyboard shortcut. But, before setting up the keyboard shortcut, I put the script into /usr/local/bin on my system and made the script executable. Then, using the “application shortcuts” tab in “keyboard” settings of the Xubuntu “settings manager” I created the “win+c” keyboard shortcut to launch the script.

The end result of all that activity is that now when i hit “windows+c” i get a quick, big date and time window on my desktop. As currently implemented this date and time window disappears after 10 seconds, but, you could hit escape anytime before that to close the window.

NOTE: This is the output from version 1 of the script. Check the update below for newer version.

This is how my script pops up a window showing current date and time

My (first version) script pops up a window showing current date and time

UPDATE Feb 14, 2014: I updated the script to improve the pop-up window display. Specifically, I changed from Zenity’s “info” to “progress bar” dialog option. I changed a few colors and added text that indicates the window can be closed by hitting Escape key. Here is how the new pop-up window looks:

This is how my script pops up a window showing current date and time

My (second version) script pops up a window showing current date and time along with helpful text hinting how to close the window and a progress bar at the bottom indicating when the window will close by itself.

This script is especially useful to me because:

  • I hate multiple panels on my desktop
  • I “auto-hide” the top panel on my Xubuntu desktop
  • I love keyboard shortcuts!

Even if you do show the top panel on your desktop, this script may be useful because of its big date and time display. Try it to see if it is useful to you. And if you find it useful please leave a good/encouraging comment below … as that would be much appreciated. Please note that all comments are moderated, so some comments may not appear on this blog.

You can download the script from my GitHub Gists. The script carries a GPL license.

Note that the script uses Zenity supported Pango Markup to get the display to look “beautiful” with colors and bold formatting … although, as some Chinese or Western philosopher had said “beauty lies in the eyes of the beholder,” so you may want to change the formatting to suit your needs.

References:

Google Chrome and password keyrings on Xubuntu

Google’s Chrome is a great web browser. Its tight integration with Google’s services makes it indispensable.

Although I installed Google Chrome on my Xubuntu system I never got to starting it on my Xubuntu systems because I had been spending more time using my Windows 8.1 machine. Today I started Chrome on my Xubuntu system and got that sinking feeling when an ugly window popped up asking for keyring password.

image of Xubuntu asking for keyring password.

Xubuntu asking for keyring password.

Flash back to 2009-10: back in the old days all my computers were exclusively on Ubuntu. That was because Vista was the most annoying OS I had ever bought+used and Windows XP was getting fatter and slower every day.

So, continuing with our flashback … back in the old days, I installed Chrome on my Ubuntu system and started it only to find a “please enter password to unlock keyring” message/input window pop out of no where. Those were the early days of confusion, so people had a lot of weird solutions floating around: “install seahorse and ride it to magical lands” said a few, or, “be a gui ninja and click here, click there, and then click through a few menus and then through a few buttons to magically end these atrocities“, or “be a terminal ninja and change /etc files” said a few others. None of those “solutions” worked for me. So, I did what came logically: I hunted down those “*keyring*” files and deleted them! The next time I started Chrome, a new window popped up. That window asked me to setup the keyring by entering a password. I chose an empty password for which I got a warning that said something to the effect “your passwords will be stored with no security” … to which I replied “yeah! whatever!” and hit ok. From that time on the keyring manager never bothered me with “enter password before I let you browse” stupidity.

Today, I had to repeat that entire procedure on my current Xubuntu systems. So …

So! Bottom line: if you are on Xubuntu 13.x AND if you have installed Google Chrome AND if you have setup your Google account in your Google Chrome AND if you start Google Chrome AND if a window has popped up asking for keyring password AND if you don’t recollect setting up a keyring password, here’s is what you do:

  • close that window asking for keyring password
  • close Google Chrome
  • open a terminal
  • go to “.local/share/keyrings” (cd; cd .local/share/keyrings)
  • create a directory called ORIG (mkdir ORIG)
  • move the existing files into ORIG (mv *.* ORIG)
  • reboot because that is always the best thing to do! (sudo reboot)

Now, start your Google Chrome. A new window will pop up like this:

image of Xubuntu requesting you to setup a new password for the keyring

Xubuntu requesting me to setup a new password for the keyring.

Just hit enter … implying you don’t want to set up any keyring passwords. You will be WARNED! Ignore the warning, as most warnings are meant to be ignored (just kidding! never ignore warnings, but, you must ignore this warning).

image of Xubuntu warning me that all my passwords will be stored unencrypted

Xubuntu warning me that all my passwords will be stored unencrypted. Sure! Whatever!

And now you are all setup! Starting Google Chrome will not bring up a stupid “enter password for keyring” window … ever again … that is till you goof around with the default, empty password, keyring setup.

Enjoy, as always!

Xubuntu 13.10 … after the install

I meant to write this post a long time back, but, I had to attend to some important matters at home, so … here is the post now.

This post is more for my future reference, but, if some or most of the content helps you … that would be all the better.

So, immediately after installing Xubuntu, here are the thing I typical do:

Setup the desktop environment:

Using the settings manager, I set up the desktop environment to my liking. Some of the things I get done in the settings manager include:

  • Delete the bottom panel that Xubuntu has by default. This panel, I believe is designed to give you a fake-Mac like feeling, but, I don’t like it, so it gets deleted immediately after install.
  • I setup my fonts. I like big fonts. E.g. on one of my Xubuntu machines I am using 12pt Droid Sans, which is large enough that I don’t have to squint to read the contents on my desktop.
  • I clean up my main menu and uncheck/hide most of the programs that I don’t use and don’t need.
  • I use keyboard settings to setup application shortcuts. As an example, here are my current application shortcuts …
My Xubuntu keyboard settings.

My Xubuntu keyboard settings.

Setting up screen brightness:

All of my current laptops love to start up into highest brightness. That hurts my eyes. So, I like to set my screen brightness across boots by adding this line into my /etc/rc.local file, before the last exit line in that file:

echo 7 > /sys/class/backlight/acpi_video0/brightness

And with that line added, it is important to make sure that rc.local is actually executable. So:

$ sudo chmod +x /etc/rc.local

Enabling autologin:

I find it painful to select my user-id and then enter the password on my laptops. So, I end up enabling auto login. What that does is simple: the system directly boots into my account, bringing up my desktop directly. You could choose to do this at install time, but, I always forget that. So, I do it manually by editing the /etc/lightdm/lightdm.conf file to add this line:

autologin-user=myUserID

Set up CapsLock as Control key:

This is fairly important for me because I have a bunch of systems that have CapsLock and Fn keys misplaced. (Yes, I am talking about you old IBM and new Lenovo Thinkpads!) Even more importantly, in my last 25 odd years of using PC-s, I have NEVER used the caps lock key for anything worth while. So, I like to reconfigure my caps lock to make it an additional control key.

First I edit the file /etc/default/keyboard and change XKBOPTIONS like so:

XKBOPTIONS="ctrl:nocaps"

… and then I run this command to make sure the keyboard configuration changes forever:

$ sudo dpkg-reconfigure keyboard-configuration

Setup APT so it does not delete old .deb files:

At home I have a bunch of old systems running Xubuntu 13.10. And I live in India where we pay very high fees for very low speed, flaky Internet access. Also, the bandwidth caps are severe. E.g. I pay almost US $20 (equivalent) for a DSL plan that has the following caps: 1Mbps upto 6GB and about 400kbps after that. Clearly, preserving bandwidth is something I care about. And so, I don’t like to download the same deb packages again and again.

So, what I typically end up doing is that I update one of my Xubuntu systems, then tar up the /var/cache/apt directory and copy that tar onto the other systems. The /var/cache/apt directory has the deb files for latest packages somewhere under it. What this does, is that when I run “sudo apt-get update and sudo apt-get upgrade” on my other systems, they don’t need to download any packages! That’s a huge savings in data download.

(NOTE 1: till a couple of months ago, I had a script which linked my /var/cache/apt/archives directory to a directory on an external drive. The script would then update/upgrade/dist-upgrade the system. What all that would do is to put the updated deb files onto the external drive. Whenever I wanted to update a system, I would connect the external drive to it and run the script. This would avoid the whole tar-gz-scp-gunzip-untar business that I am doing right now to update my systems. I am currently not using that script because I am waiting for my new external HDD. I will publish that script sometime soon with the hope that it helps others.)

(NOTE 2: I need to learn about apt-offline and figure out if it would be easier/better for my case.)

So, the important thing here is to make sure that none of my systems delete old deb files. By default Xubuntu is setup to delete old deb files that are older than the pre-specified number of days, like 30 days or something. What I do is, I tell apt to not delete any of my old deb files … EVER! That is easy to achieve. I just edit /etc/apt/apt.conf.d/20archive file and change all numeric values to 0.

Reduce swappiness:

Ubuntu and its derivatives, like Xubuntu, are configured with a default swappiness value of 60. The swappiness value can range between 0 to 100. A swappiness value of 0 tells the kernel to avoid swapping processes out of memory as much as possible. On the other hand, a swappiness value of 100 tells the kernel to aggressively swap processes out of memory.

I have decent amounts of RAM in most of my current systems, spare one, which only has 2GB of RAM in it. So, I like to set the swappiness on my systems to 5, implying don’t swap too much as much as possible!

To achieve that I edit /etc/sysctl.conf file and add the following line to it:

vm.swappiness=5

Remove unwanted packages:

This is the penultimate step. In this step I get rid of the following packages:

  • Risteretto, the XFCE image viewer
  • Mines (package name gnomine and gnome-mines), because who’s got time to play games, eh?
  • Mousepad editor (package name mousepad)
  • Notes (package name xfce4-notes and xfce4-notes-plugin) because I keep my notes in Google Keep.
  • Catfish file search (package name catfish) because if I ever need to hunt down files, I open a terminal and play with find.
  • Orage calendar manager (package name orage) because I don’t think the Xubuntu guys-n-gals were serious when they included that package in the distro.
  • Thunderbird email client (package name thunderbird) because I just read my mail in my browser
  • Pidgin messenger (package name pidgin) because I have never, ever used it and really don’t see the need for it
  • GMusic browser (package name gmusicbrowser) because I don’t even know what this is for!
  • Abiword word processor (package name abiword, abiword-plugin-grammar and abiword-plugin-mathview) because … I never really use a word processor, but … (see next section)
  • GNumeric spreadsheet (package name gnumeric) because I find it hard to use!

Install useful packages:

This is the final step in my post-install modifications. In this step I install a few packages that I find useful.

  • Open SSH server (package name openssh-server) because I really like to ssh and scp into my systems.
  • GEdit, the GNOME text editor (package name gedit) because I feel comfortable using this nice piece of software for most of my normal text editing needs. Although, in reality I find myself launching vi from a terminal more often than using any fancy text editor.
  • Restricted extras which contains all sorts of codecs and other things I don’t really understand but i know I need for my system to be a useful music and video player (package name xubuntu-restricted-extras).
  • Libreoffice which contains a fairly full fledged office suite that satisfies most of my word processing, spreadsheet data analysis. creating presentations, and other office suite needs.
  • A bunch of tiny utilities like xchm (to read CHM files), fbreader (to view EPUB and Mobi files through a really ugly interface).
  • VLC Player if you want to.

And finally … after all those changes are done, I run:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
$ sudo reboot

… and I reboot into a sane system.