Friday, October 18, 2013

Ubuntu 13.10 PHPMyAdmin - mcrypt extension is missing

I am setting up a new Drupal installation with LAMP on Ubuntu (Saucy Salamander - 13.10). Installing the LAMP server and PHPMyAdmin was like a breeze. I just needed the following command:
sudo apt-get install lamp-server^ phpmyadmin
Once I logged into the fresh PHPMyAdmin interface, I realized that "mcrypt" module is missing in default Ubuntu installation. The error I found at the bottom of the PHPMyAdmin page simply page said:

"The mcrypt extension is missing. Please check your PHP configuration."

After doing a quick "apt-cache search", I found the right php5-mcrypt module that I was missing. So I issued:
sudo apt-get install php5-mcrypt
sudo service apache2 restart
Interestingly, even after this I had the "mcrypt missing" error. So I took a quick look inside my /etc/php5/ directory and found the "mcrypt.ini" inside /etc/php5/conf.d. Now for apache2 PHP5 module, the configuration files are located inside /etc/php5/apache2/conf.d (not in /etc/php5/conf.d). So I realized that although mcrypt was installed for PHP5, it was not being loaded fro Apache.

So the fix was as shown below. Basically I am just creating a symlink for mcrypt.ini inside PHP5's Apache configuration directory.
cd /etc/php5/apache2/conf.d
sudo ln -s ../../conf.d/mcrypt.ini 30-mcrypt.ini
sudo service apache2 restart
 Hope you find it useful too!

Thursday, May 16, 2013

Disabling LightDM Lock-screen on Ubuntu 13.04

I have a custom LXDE on a Lubuntu installation. After the most recent upgrade to 13.04 (Raring Ringtail), I realized all my custom Compiz shortcuts were all overwritten. I used to use Ctrl+Alt+L as a shortcut to launch xscreensaver to lock my screen, which worked coherently with Synergy that allows me to use my laptop's  keyboard and touch-pad to control other machines in the same network. Not surprisingly after the upgrade Ctrl+Alt+L stopped launching xscreensaver and the same key-combination would fire-up LightDM lock-screen. LightDM's lock-screen is actually quite nice and I would love to keep it if it would work with Synergy, but it doesn't. So I had to disable it. Here's how you do it:
gsettings set org.gnome.desktop.screensaver lock-enabled false
After disabling LightDM, I can launch xscreensaver as shown below to lock my screen:
xscreensaver-command -lock 
Hope it helps someone in my situation. 

Wednesday, December 12, 2012

Disable HP EliteBook Laptop Keyboard HotKey Popups

Source:  HP Tech. Support

Basically HP is providing some registry keys to preferably enable/disable pop-ups that appear when Caps-Lock, Num-Lock, volume or brightness control buttons are pressed. The pop-ups are very annoying, takes longer than multiple seconds to disappear and appears on top of all other windows.

So, if you are alike me and want to stop the pop-ups from appearing forever, just download/save the following registry file and import into your registry (Saving the text below into a *.reg file and double-clicking should do the trick in case you haven't ever done it before).

P.S.
I just realized, the registry trick doesn't work if you have an older version of  "HP Hotkey Support" module installed. According to the source page, the latest version can be downloaded from here: ftp://ftp.hp.com/pub/softpaq/sp57501-58000/sp57879.exe


Monday, September 24, 2012

MiKTex 2.9: Packages and Styles Not Found Error on Windows 8

I just tried to compile one of my old Latex documents (which compiles fine on my Linux boxes) on my freshly installed Windows 8 machine with MiKTeX 2.9 and all hell broke loose with different a million "missing package" and "missing styles" error. My document is a IEEE conference paper. So it all started with a "IEEEtran.sty missing" error. Interestingly, although I had "Install missing packages on the fly" set to "Yes" (as can be seen on the screenshot), still I was getting this error.

A little bit of debugging through the error messages reveals - it's all about file write permission. Windows 8 has a stricter ACL set for the installed programs on write access. Therefore, the "on the fly" installable packages, although were being fetched, were failing to get installed.

The trivial solution was to launch the "command prompt" (cmd.exe) as administrator and do a "pdflatex document.tex". This time all my missing styles and packages were fetched and installed!

P.S.
  • To manually install Latex packages on Windows 8, run "C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\mpm_mfc_admin.exe", select and install your package.
  •  To set your packages to install automatically, run "C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\mo_admin.exe" and set "Install missing packages automatically" to "yes" as shown in the screenshot.

Monday, September 10, 2012

Fix Error Code 2503/2502 on Windows 8

I have decided to give Windows 8 a few more days of my life (before deciding if I am going back to Windows 7). So I am re-installing many of the programs that I used everyday on my Windows 7 setup. Some of them are giving me this - "Error code 2503" dialog box followed by one more with "Error code 2502" while installation.

It appears that these installation packages lack required permissions to access and deploy files  necessary files due to Windows 8's strict security model. Right-clicking the installer (MSI or EXE) and selecting "Run as Administrator" solves the issue.

P.S.
Just realized that some of you might still be struggling to find the option "Run as Administrator" in the context menu. Try right-clicking on you MSI or EXE with the Shift button pressed (Shift+Right Click that is), you should have the option now.

The second option would be to search for the file through Window 8's unified start-button-search.
  1. Press the Windows key 
  2. Type part of the file name and navigate to the file
  3. Now press Ctrl+Shift+Enter
This will run your MSI or EXE as administrator. Cheers.

Wednesday, September 5, 2012

The Quickest way to edit environment variables in Windows 8

I am trying to setup my Android development environment on my freshly installed Windows 8 machine and quite obviously I needed to add "tools" and "platform-tools" directory from the Android SDK into my %PATH% environment variable. It took me a good couple of minutes to figure out how to do it under Windows 8. So I thought why not save someone else from wasting 2 minutes of his life. Thankfully it really is a 3 step process once you know how to get there:

  1. Press the Windows key and just type "control panel" followed by Enter to quickly navigate to Control-Panel.
  2. Now press F3 and type "environment"
  3. That's it, now you should have found a link waiting to be clicked saying "Edit the system environment variables" as shown in the screenshot on the right hand side. Click on that to open the window titled "System Properties" with the "Environment Variables..." button.

UPDATE:
  • Looks likes it's actually a 2 step process :-). You can simply press Windows key, type "Environment" and navigate to "Settings". It will give you the  options to edit both system environment or the user environment variables. Cheers!

Wednesday, August 15, 2012

PDroid (1.32) patch for Android Jelly Bean (AOSP 4.1.1)

Hi Guys, I ported the PDroid ICS patch to apply against AOSP Jelly Bean source. Here is the GitHub repository hosting the patch. I built Jelly Bean with the patch for Motorola Xoom (wingray) and Nexus S (crespo). Everything seems to work! You'll find the build instructions for Ubuntu on GitHub. Cheers!

[1] https://github.com/gsbabil/PDroid-AOSP-JellyBean

PDroid with Android Jelly Bean on Motorola Xoom Tablet (wingray)

Monday, August 6, 2012

AntiTaintDroid (a.k.a. ScrubDroid)- Escaping Taint Analysis (and stealing private information) on Android for Fun and Profit

UPDATE:  source code published on Github [2, 5]
Good news Everyone! I wrote an app that bypasses TaintDroid's [1] privacy monitoring features (Taint analysis) in more than a few ways. I will share the app on my GitHub [2] account very soon. Currently the app is capable of collecting private information such as Android device ID, Google account ID, network ID, IMEI etc. and send it to a pre-configured server (of course without raising any TaintDroid alert). If anyone is interested while I fine-tune my app (add support for reconfigurable server among other small things), please drop me a line in the comments. I would be happy to share how and what I have done.

To know more about how TaintDroid and Taint analysis works, please read their publications here [2]. If you Google for TaintDroid, you will also find a fair amount of information on what it is and how it works. Thanks for reading my Blog. I will update this post as soon as the next bit is ready.



[1] http://appanalysis.org/
[2] https://github.com/gsbabil
[3] http://appanalysis.org/pubs.html
[4] http://www.google.com.au/search?q=TaintDroid
[5] http://gsbabil.github.io/AntiTaintDroid/

Monday, June 18, 2012

Android emulator gives "SDL init failure" error on Ubuntu/Linux

If you are getting the following error:
SDL init failure, reason is: No available video device
from Android emulator on a Unix/Linux platform, this typically indicates your shell's DISPLAY variable is not pointing to the correct X11 Display. Try launching the Android emulator as shown below. You may add your own parameters as needed as long the DISPLAY=:0 is there.
DISPLAY=:0 emulator -kernel your_zImage -system your_system.img -ramdisk your_ramdisk.img -sdcard your_sdcard.img


Wednesday, June 13, 2012

Disable New Tab Page in Firefox 13

Firefox 13 introduced something called "New Tab Page" which shows a history of 9 most visited pages in a tile interface, much like the way Google Chrome does. Actually it looks like the picture below:


But, there are two problems with it. First, if you don't want your browsing history to be shoulder-surfed (someone looking at your browser over your shoulder), this is not a good thing. Second, it actually makes the new tab open a slighter slower than before for which the reason must be obvious.

Anyway, since there's no point-and-click kind of configuration options anywhere in Firefox 13 to turn this feature off, we need to edit Firefox's hidden global configuration settings. This settings interface can be reached by typing "about:config" in the address bar and pressing enter. It will show you a plethora of Firefox's internal options. Most of these options are explained in "Mozilla Knowledge Base". In order to turn off the new tab page, the two relevant options are:
  1. browser.newtab.url
  2. browser.newtabpage.enabled
You can quickly locate these two by typing "newtab" in the search bar. As the name suggests, the first option is set to "about:newtab" as default which is the page that displays the 9 most visited page links in tiled interface. We can set it to "about:blank" to force disable the new tab page feature. The second option is better is setting it to "false" (by right clicking and selecting "Toggle" from the menu) will disable new tab. Next time we click the plus icon in the tab-bar or press Ctrl+T, Firefox will open new tab page without the tiled history links. Cheers!

Thursday, June 7, 2012

Ubuntu 12.04 – How to use VNC even at the login prompt


I have a partially headless desktop machine on my desk only connected with a monitor. I typically use this machine for heavy duty computation or simulation. The machine is more than decent hardware wise. But I have a decent enough laptop where I like to keep all my day to day stuffs. Given the scenario, if I should ever have to use keyboard and mouse on the desktop machine, I would typically use Synergy to control the desktop using the keyboard and mouse from my laptop. Since the desktop has a much larger screen, it is quite convenient that way for many specific things. The desktop runs a SSH server. So, I can login over SSH and start the Synergy client which would connect back to the Synergy server running on my laptop. The setup is actually quite handy.

Now, there’s a catch. The problem is that synergy refuses to bind to the keyboard and mouse on the desktop machine due to missing X authentication credentials at the login prompt. Since at the login prompt, the user (me@desktop) hasn’t logged in yet. So, he (me@desktop) doesn’t have a proper X credential yet. Apparently, there is no easy way to pass the custom MIT-MAGIC-COOKIE to synergy. Therefore, I decided to fall back to VNC, which is also occasionally useful when I am working remotely.

Ubuntu 12.04 Precise Pangolin (I think 11.10 too) comes with LightDM as the login and display manager. Therefore, the desktop environments such as GNOME, KDE or LXDE would be started by LightDM only after the login has been successful. As mentioned before, Synergy can’t work in this phase because the X server authentication credentials from LightDM can not be passed easily. Therefore, to type in the password at LightDM login prompt, I use x11vnc. On Ubuntu, a quick “apt-get install x11vnc” will install it. The reason I like it a lot is mostly because it can be used like a regular console utility to start-up the VNC service. For example, I could just do “x11vnc –display :0” to quickly setup a VNC session over SSH and then login remotely over VNC. The additional benefit would be that VNC will be passed thru SSH (by means of SSH port forwarding), it will be way more secure than just plain VNC. So, coming back to where we were - to start x11vnc at the login prompt, a typical “x11vnc –display :0” wouldn’t work. Because the X server will refuse authentication as we need the authentication credentials for the LightDM service which is started as “root”. x11vnc provides an “-auth auto” option. But, it will also mostly likely fail because the “.Xauthority” file wouldn’t be found.

To get around this, we need to locate the right “.Xauthority” file where the MIT-MAGIC-COOKIE is saved. After some snooping around on my file-system, it appears that the LightDM service stores it’s files in “/var/lib/lightdm” directory. Great! now if we just do a “sudo x11vnc –display :0 –auth /var/lib/lightdm/.Xauthority” x11vnc will run in the login prompt and we will be able to use VNC even after login .

So, to recap, the steps are:

  • apt-get install x11vnc openssh-server
  • Reboot the machine (or log-out). In my case it’s my desktop.
  • ssh user@desktop. I would do it from my laptop.
  • sudo x11vnc –display :0 –auth /var/lib/lightdm/.Xauthority
  • Now, from my laptop I can use any VNC viewer to connect my desktop even in the login prompt.


Saturday, March 10, 2012

Recovering from repeated crash at Firefox (11 Beta 7) start-up

Quick Solution
 
Delete
  • session.js
  • sessionstore.bak
  • files inside sessions folder
from inside your Firefox profile directory. Follow this page to find out where you profile directory is located.

How I found what caused the crash
 
After quite few "unresponsive script" error inside Firebug 1.9.1 (mostly on LifeHacker.com and Boston.com) and repeatedly selecting "Stop Script" with no apparent benefit, I chose to kill Firefox from Windows Task Manager [1]. For those who don't know that it is - try pressing "CTRL+Shift+Esc" on your keyboard or just right-click on your task-bar and select "Start Task Manager". It looks like this:


I didn't realize the fun is just about to begin. To my surprise, upon the next restart Firefox started as usual and but quickly crashed. It kept happening much like flashing the Firefox's main window for a second or two and boom, it crashed! This behavior was already a good indication that it might be caused by a corrupted file, most probably a SQLite [2] database and this must have happened due to my killing Firefox forcefully using the Windows Task Manager. So, I started to digging around for a resolution.

First, I tried to start Firefox in "Safe Mode" with all add-ons disabled as suggested here [3] with "-safe-mode" flag. It didn't work! From my all previous experience, Firefox's safe-mode always seemed the best way to solve crash related problems, buggy extensions and add-ons. But, in this case it kept crashing even in safe-mode.

Then, I tried to open Firefox in "Private Browsing" mode with the "-private" flag. On Windows 7 (I guess on Vista too), this can be done with right-clicking the Firefox task-bar icon and selecting "Enter Private Browsing". Interestingly, Firefox was able to start in this so-called incognito mode! This was another strong hint that some files must be corrupted in my "Firefox Profile Folder" [4].

To try the theory, I closed all running instances of Firefox and I renamed Firefox's "profiles.ini" [5] to "profiles.ini.bak" to force Firefox into creating a fresh new profile. I started Firefox and it successfully created a new profile in my "%APPDATA%\Mozilla\Firefox" directory. The new profile directory was named "an9pz0cj.default".  By the way, if you are like me and you love your Firefox's plethora of customized settings and very longs list (77 in my case) of plugins only to profoundly avoid reinstalling them, don't forget to regularly backup your profile directory. My default previous profile directory was called "yn0z15ze.default" and I backed it up in a RAR archive.  After generating a fresh profile, which also generated a new profiles.ini, I copied all files (not folders, I decided to try them in the second iteration) from "an9pz0cj.default" and pasted them in "yn0z15ze.default". Windows 7's copy and paste is great. It kept showing me all the conflicts due to size, date-time of source and destination files. I kept the list of the files where the file-size was different. In my case, the list looked like the following:
  • cert8.db - SSL certificates are stored here.
  • chromeappsstore.sqlite -- HTML5 local data store.
  • content-perfs.sqlite -- Individual settings for pages.
  • permissions.sqlite -- Permission database for cookies, pop-up blocking, image loading and add-ons installation.
  • search.sqlite -- Information about search plugins
  • sessionstore.bak -- saved sessions.
  • sessionstore.js -- saved previous session
  • signons.sqlite -- Encrypted saved passwords
  • TestPilot.log --  Log file.
  • webappsstore.sqlite -- DOM local storage.
I Google'd up on the name of the files and got a rough idea of what they are meant for and how they are used inside Firefox. So, at this point I my preferred profile "yn0z15ze" is working but with some default files which means I must have lost some data, may be some customizations too as the list contains cert8.db, search.sqlite and signons.sqlite etc.

Now comes the final part - I have to test each of the files above one by one and figure out which one was causing the crash. As you may have gotten the idea already - I love my Firefox and my customizations. So, I wanted to make sure that I lose minimum amount of data due to the crash.

So, I renamed my previously moved "profiles.ini.bak" to "profiles.ini". By the way, profile.ini looks like below:
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=Profiles/an9pz0cj.default
Default=1
So, I could have just replaced "an9pz0cj" with "yn0z15ze" and saved profile.ini to achieve switching between profiles. Anyways, I did that anyhow and started copying files as shown on the bulletted list above from  "yn0z15ze" RAR archive to now running "yn0z15ze" with some fresh files of "an9pz0cj". I kept restarting Firefox each time to check if Firefox is crashing. After a few iterations of stopping Firefox, copying fresh files into "yn0z15ze" and restarting, I stopped at "sessionstore.js". I copied this file and Firefox crashed!

Wow, so now I know which file was causing my Firefox to crash! Also, now that I know this file only contains a list of my tabs which I was browsing before the very initial task-manager kill, I can safely disregard this file now ;). Phew, so the case is solved. If you happen to come across a situation like mine, try deleting the "session.js" and/or "sessionstore.bak" and/or files inside "sessions" folder. It's weird that even in Firefox's safe-mode the problem managed to persist. Time for a bug report I guess :). Hope you find it useful.

[1] http://en.wikipedia.org/wiki/Windows_Task_Manager
[2] http://en.wikipedia.org/wiki/Sqlite
[3] http://kb.mozillazine.org/Safe_Mode
[4] http://kb.mozillazine.org/Profile_folder_-_Firefox
[5] http://kb.mozillazine.org/Profiles.ini_file

Friday, January 20, 2012

GTK Theme is not being followed by all GTK Applications (on LXDE)

On my LXDE (Ubuntu Oneiric 11.10) setup, I have recently discovered that not all GTK applications are getting themed with the GTK theme (Adwaita) of my preference. 

My first obvious attempt was to reset theme with LXDE Menu > Preferences > Customize Look and Feel. I set Adwaita in the "Gadget" tab. That Didn't help. Many "sudo" applications along with some other normal GTK-3.0 applications (e.g. evince) stills stayed un-themed.


Ubuntu repository apparently has two tools to set GTK-2.0 themes:
  1. gtk-chtheme
  2. gtk-theme-switch
Gtk-chtheme is much better in my opinion. So, I gave it a shot and selected "Adwaita" from the list of installed GTK theme. Still no change.

Then as a last resort, I wanted check which GTK theme files are actually being accessed during the initialization of the applications. For that, I started Evince from the console with strace as below:
strace -e trace=access evince 2>&1 | less
After a quick checking through the output it was obvious that my GTK-3.0 themes are not being found by the applications and the theme files are being searched for both in:
  1. /home/USER-NAME/gtk-3.0
  2. /home/USER-NAME/.config/gtk-3.0
On Ubuntu, GTK themes are installed in /usr/share/themes. So, the quick, easy and clean solution to the problem was to create a sym-link to the GTK-3.0 theme of my preference as shown below:

ln -s /usr/share/themes/THEME-NAME/gtk-3.0 /home/USER-NAME/gtk-3.0
ln -s /usr/share/themes/THEME-NAME/gtk-3.0 /home/USER-NAME/.config/gtk-3.0

After creating the sym-links, I restarted Evince and voila! it's perfectly themed with Adwaita now.


P.S.
If you ware selecting another themes other than Adwaita, make sure /usr/share/themes/THEME-NAME/gtk-3.0 actually exists. Not all themes in /usr/share/themes/ are GTK-3.0 compatible and they will miss the gtk-3.0 directory inside the theme folder.

Friday, November 11, 2011

Compile NS-2.34 and 2.35 with GCC-4.6

I stumbled into the compilation issue after upgrading to Ubuntu Oneiric 11.10. The error occurs in "mac-802_11Ext.h" saying something like the following:
mac/mac-802_11Ext.h: In member function 'u_int32_t PHY_MIBExt::getHdrLen11()':mac/mac-802_11Ext.h:175:19: error: expected primary-expression before 'struct'mac/mac-802_11Ext.h:175:41: error: 'dh_body' was not declared in this scopemac/mac-802_11Ext.h:175:51: error: 'offsetof' was not declared in this scope
I found the solution in Ubuntu's patched version of NS-2.35-RC6. The direct link to the patch is here: http://launchpadlibrarian.net/74445224/ns2_2.35~RC6-4_2.35~RC6-4ubuntu1.diff.gz

It's really simple. All you have to do is to add #include cstddef as shown below:
#ifndef ns_mac_80211Ext_h
#define ns_mac_80211Ext_h
#include cstddef
#include "marshall.h"
#include "timer-handler.h"
 Now, NS-2.34 should compile fine with GCC-4.6. Enjoy your simulation!

P.S. BlogSpot is simply terrible for posting code snippets. For clarity, here's a screenshot of what the code should look like.

 

Friday, October 21, 2011

Google Chrome (Chromium) font anti-aliasing is wrong on LXDE (L)Ubuntu Oneiric (11.10)

The solution was to add the following in the ~/.fonts.conf 

xml version="1.0"?>DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>noneconst>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>truebool>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslightconst>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>truebool>
  edit>
 match>
 <match target="font">
   <edit mode="assign" name="lcdfilter">
    <const>lcddefaultconst>
   <edit>
 <match>
</fontconfig>

One may have to play around with the "hintstyle" to get it right. The available options are:
  • hintslight
  • hintmedium
  • hintfull
  • none

Wednesday, October 19, 2011

Ubuntu Oneiric (11.10) DPKG error removing old Linux kernel

I stumbled into another trouble removing my obsolete packages after upgrading into Ubuntu Oneiric 11.10 with Linux kernel 3.00-12. The problem is with removing the old 64bit kernel 2.6.35-24. The Debian package name is 2.6.35-24. The error I got is following:
[13:41:34] user@machin:[/var/lib/dpkg/info]$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages will be REMOVED:
  linux-image-2.6.35-24-generic
0 upgraded, 0 newly installed, 1 to remove and 31 not upgraded.
1 not fully installed or removed.
After this operation, 139 MB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 248250 files and directories currently installed.)
Removing linux-image-2.6.35-24-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
update-initramfs: Deleting /boot/initrd.img-2.6.35-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-12-generic...
E: /usr/share/syslinux/debian/extlinux: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-2.6.35-24-generic.postrm line 328.
dpkg: error processing linux-image-2.6.35-24-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-2.6.35-24-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
The highlighted lines told me the error is caused by the postrm script called zz-extlinux located in /etc/kernel/postrm.d/. I don't know how I managed to have extlinux installed on my system. If I am not mistaken booting is still managed by grub-2. So, I decided to remove both extlinux and linux-image-2.6.35-24-generic. But, since my DPKG is already going crazy removing linux-image-2.6.35-24-generic and failing on zz-extlinux, I have to remove the old Linux image first. I quickly patched the zz-extlinux script with an "exit 0" at top followed by an "sudo apt-get -f install". One could also make it non-executable as following as a solution, followe:
sudo chmod -x /etc/kernel/postrm.d/zz-extlinux; sudo apt-get -f install
This solved my problem removing the Linux image. Now, I guess one can also remove extlinux considering Grub-2 is the bootloader.
sudo apt-get remove --purge extlinux

Tuesday, October 18, 2011

Changing Gnome-Screensaver Background on Lubuntu 11.10 (Oneiric)

I had to find a way on Lubuntu flavoured LXDE to lock/unlock the current running desktop session. The obvious easy way is to use xscreensaver and/or gnome-screensaver and do one of the following:
xscreensaver-command -lock
gnome-screensaver-command --lock
I chose to keep with gnome-screensaver since it is prettier. But immediate annoyance was after locking screen, gnome-screensaver would not retain the same background as current Lubuntu session. After trying so many options (gconf, editing files in /etc), finally I figured - the solution is rather easy.

It appears Lubutu session keeps a separate sets of options from LXDE. When gnome-screensaver is launched, it takes the background option of LXDE (not Lubuntu). To match same background both on LXDE and Lubuntu, which also matches gnome-screensaver background inside Lubuntu session, the steps are below:
  1. Set preferred desktop background on running Lubuntu session by right-click > Desktop Preferences > Background.
  2. Log-out from Lubuntu session.
  3. On the log-in prompt, select LXDE as desktop session to log into.
  4. Once inside LXDE, you'll see the desktop background that gnome-screensaver uses as background.
  5. From the right-click menu, change the background to match your preference.
That's all !!! Now, you can log in back into Lubuntu and lock screen by initiating gnome-screensaver (I use a Compiz command shortcut with Ctrl+Alt+L which triggers "gnome-screensaver-command --lock") and desktop background will match.

Ubuntu Oneiric 11.10 - problem with package dictionaries-common

I started getting troubles with dictionaries-common package right from the beginning of upgrading into Ubuntu Oneiric (11.10). The error message looks kind of like the following:


Setting up dictionaries-common (1.11.5ubuntu1) ...
update-default-wordlist: Question empty but elements installed for class "wordlist"
  dictionaries-common/default-wordlist: return code: "0", value: ""
  Choices: , Manual symlink setting
  shared/packages-wordlist: return code: "10" owners/error: "shared/packages-wordlist doesn't exist"
  Installed elements: american (American English)
  Please see "/usr/share/doc/dictionaries-common/README.problems", section
  "Debconf database corruption" for recovery info.
update-default-wordlist: Selected wordlist "" 
does not correspond to any installed package in the system
and no alternative wordlist could be selected.
dpkg: error processing dictionaries-common (--configure):
 subprocess installed post-installation script returned error exit status 255
dpkg: dependency problems prevent configuration of xscreensaver-data-extra:
 xscreensaver-data-extra depends on dictionaries-common; however:
  Package dictionaries-common is not configured yet.
dpkg: error processing xscreensaver-data-extra (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
 dictionaries-common
 xscreensaver-data-extra
E: Sub-process /usr/bin/dpkg returned an error code (1)

May be I was too quick to have skimmed over the error message and did not realize what is missing. It looks like the problem actually is that I do not have any word-list installed (or, somehow uninstalled during the distribution upgrade process) on my machine for the dictionary to point to. The quick solution is to install the preferred word-list as following:
sudo apt-get install wamerican-insane
 This should remove fix the package installation error with dictionaries-common package.


Compiz Config Settings Manager (CCSM) crashes with SIGSEGV on (L)ubuntu Oneiric (11.10)

On my latest Lubuntu 11.10 installation, CCSM stumbles into a segmentation violation (SIGSEGV) if "Desktop Cube" is enabled in Compiz plugins and I try to disable it through CCSM. Since, I managed to convince myself that "Expo" is capable of providing what I really need, I needed a way to disable it without using CCSM. So, for my own future reference and someone who's going through the same kind of nagging crash, the Compiz config file is located here:
/home/$USER/.config/compiz-1/compizconfig/Default.ini
My list of enabled plugins are below:
 [core] 
s0_active_plugins = core;detection;gtkloader;composite;opengl;copytex;decor;mousepoll;commands;imgjpeg;regex;addhelper;annotate;resize;grid;compiztoolbox;place;imgsvg;imgpng;notification;dbus;gnomecompat;resizeinfo;opacify;wobbly;move;text;loginout;scale;animation;kdecompat;thumbnail;workarounds;scaleaddon;scalefilter;animationaddon;expo;ezoom;switcher;
All one has to do is remove "cube" (or whichever is causing trouble) from "s0_active_plugins".

LightDM Fails to Load with (L)ubuntu Oneiric (11.10)

After my migration from default Ubuntu with Unity and Gnome3 to Lubuntu with LXDE and OpenBox, I realized I have managed to sacrifice beautiful LightDM, the new default login manager on 11.10 and instead, running not so pretty LXDM.

After realizing that LightDM is missing the first thing to do was obviously:
sudo apt-get install lightdm
Followed by:
sudo dpkg-reconfigure lightdm
sudo service lxde stop
sudo service lightdm start
Not much to my surprise on 11.10, LightDM didn't start. After a little digging through the log files located at /var/log/lightdm, I came across the following:

"lightdm can not write to /var/lib/lightdm/.Xauthority"

Time to check /var/lib/lightdm directory:

[11:13:26] user@machine:[/var/lib/lightdm]$ sudo ls -alh
total 44K
drwxr-x---  9  109  130 4.0K 2011-10-14 20:08 .
drwxr-xr-x 74 root root 4.0K 2011-10-17 16:56 ..
drwx------  4  119  136 4.0K 2011-10-14 15:28 .cache
drwx------  4  119  136 4.0K 2011-10-14 15:28 .config
drwx------  3  119  136 4.0K 2011-10-14 15:28 .dbus
-rw-------  1  119  136   16 2011-10-14 15:32 .esd_auth
drwx------  2  119  136 4.0K 2011-10-14 18:29 .gconf
-rw-------  1  119  136    0 2011-10-14 19:55 .goutputstream-54JJ3V
drwx------  2  119  136 4.0K 2011-10-14 15:28 .gvfs
drwxrwxr-x  3  119  136 4.0K 2011-10-14 15:32 .local
drwx------  2  119  136 4.0K 2011-10-14 16:22 .pulse
-rw-------  1  119  136  256 2011-10-14 15:32 .pulse-cookie
-rw-------  1  119  136    0 2011-10-14 20:08 .Xauthority


After checking /etc/passwd and /etc/group, it confirmed that somehow user-id 119 and groupd-id 136 has gone missing from my system. So, as a quick roll-back, I did the following:

sudo apt-get remove --purge lightdm
sudo mv /var/lib/lightdm /var/lib/lightdm.bak
sudo apt-get install lightdm
sudo service lxdm stop
sudo apt-get remove --purge lxdm
sudo service lightdm start

Voila, LightDM showed up with a nice log-in prompt. Re-installing LightDM, added a new user and group with ids 109 and 130 respectively. Also, the ls output in /var/lib/lightdm looks correct.

[11:33:08] user@machine:[/var/log/lightdm]$ sudo ls -al /var/lib/lightdm/
total 44
drwxr-x---  9 lightdm lightdm 4096 2011-10-18 11:14 .
drwxr-xr-x 74 root    root    4096 2011-10-18 11:15 ..
drwx------  4 lightdm lightdm 4096 2011-10-18 11:14 .cache
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .config
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .dbus
-rw-------  1 lightdm lightdm   16 2011-10-18 11:14 .esd_auth
drwx------  5 lightdm lightdm 4096 2011-10-18 11:15 .gconf
d?????????  ? ?       ?          ?                ? .gvfs
drwxrwxr-x  3 lightdm lightdm 4096 2011-10-18 11:14 .local
drwx------  2 lightdm lightdm 4096 2011-10-18 11:14 .pulse
-rw-------  1 lightdm lightdm  256 2011-10-18 11:14 .pulse-cookie
-rw-------  1 lightdm lightdm   49 2011-10-18 11:14 .Xauthority



Edit (20 Jan 2012):
I stumbled into another problem with LightDM after uninstalling gnome-settings-daemon. It looks like the background file to set for LightDM is requested through gnome-settings-daemon for some reason on my system. So, if you have the same problem, a quick apt-get install gnome-settings-daemon will solve the problem.