Friday, October 30, 2015

Find out apache module version

It took me sometime to find out a way to determine the version number of any apache module. Basically the 'strings' command can extract the existing strings in the shared library and with grep we can use the regex "${mod_name}/[0-9]\.[0-9]" where mod_name is a variable containing the name of the module. I am omitting the real version numbers below for security reasons:
$ strings /usr/lib/apache2/modules/ \
    | grep "mod_pagespeed/[0-9]\.[0-9]"
$ strings /usr/lib/apache2/modules/ \
    | grep "mod_ssl/[0-9]\.[0-9]"

Wednesday, October 28, 2015

RabbitVCS needs restart in ubuntu 14.04 with lxde

It used to work out of the box with 12.04 and unity but now it needs restart after installation:
sudo add-apt-repository ppa:rabbitvcs/ppa
sudo apt-get -q -y --force-yes install rabbitvcs-core rabbitvcs-cli rabbitvcs-gedit rabbitvcs-nautilus3exit
sudo shutdown -r now
In addition in a different machine with update and upgrade it started showing up (no restart needed):
sudo apt-get -y update
sudo apt-get -y upgrade
In other cases just restarting nautilus made the trick:
killall nautilus
I even had to just start nautilus from command line to get it to work:

Sunday, October 11, 2015

trying to overwrite ... which is also in package ... Sub-process /usr/bin/dpkg returned an error code (1)

dpkg: error processing archive /var/cache/apt/archives/libffi-dev_3.1~rc1+r3.0.13-12_amd64.deb (--unpack):
 trying to overwrite '/usr/share/info/', which is also in package xrdp 0.9.0+master
Processing triggers for man-db ( ...
Processing triggers for doc-base (0.10.5) ...
Processing triggers for install-info (5.2.0.dfsg.1-2) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/libffi-dev_3.1~rc1+r3.0.13-12_amd64.deb

Thursday, October 08, 2015

Solution for mysql Warning: Using a password on the command line interface can be insecure

Mysql or mysqldump "Warning: Using a password on the command line interface can be insecure" should not be IMO in the stderr. The stderr is for errors and not for warnings. The correct way to handle these situations in the shell should be using a different handler (should I propose stdwarn or stdwarning?) which of course we do not currently have available.

As I have stated in Stackoverflow, the recommended way to solve this issue penalizes the ones that do the right thing to protect the ones that do the wrong thing. If the password is stored inside a script file it will not show up with ps or in any log. Putting the credentials in an external file does help the ones that would cron a command using the plain text password instead of variables which, but why helping those when they are doing the incorrect thing? In the meantime scripts that have been running for years now fail and we need to modify them just because this warning comes up in the stderr.

Since we are stuck with using the external credentials file here is a quick hack to please mysql commands. Basically we create the file on the fly:

Saturday, October 03, 2015

Ubuntu on Toshiba Satellite

It took me a while to install Ubuntu on a Toshiba Satellite originally shipping Windows 7. To completely wipe out Windows and use Ubuntu instead I followed the below steps.
  1. Turn off
  2. Insert Ubuntu DVD. In my case USB boot up wouldn't work
  3. Turn on keeping F2 key pressed (No Fn, just F2)). The BIOS/UEFI firmware screen shows up
  4. From Advanced/System Configuration select the "CSM boot" option
  5. From Main/Boot order put DVD/USB on top (before HDD)
  6. Save changes and exit
  7. Ubuntu DVD should take over allowing to wipe out everything from the hard disk and installing the new OS. If you run into problems you can try installing first using the "UEFI boot" option however you will still need to switch to "CSM boot" and reinstall Ubuntu because otherwise the OS won't come up but instead you will see the message "Reboot and Select Proper Boot Device"
  8. Linux rocks