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

Thursday, September 10, 2015

do-release-upgrade returning Checking for a new Ubuntu release No new release found

Not even trying to get to the development release was working:
Checking for a new Ubuntu release No new release found
Reason being:
$ cat /etc/update-manager/release-upgrades
# Default behavior for the release upgrader.

# Default prompting behavior, valid options:
#  never  - Never check for a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the release that immediately succeeds the currently-running
#           release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that this option should not be
#           used if the currently-running release is not itself an LTS
#           release, since in that case the upgrader won't be able to
#           determine if a newer release is available.

Just replace never by normal or lts according to your needs.

Ubuntu 12.04 update fails with Unable to find expected entry 'utilities-1.4/binary-amd64/Packages'

We got the below error:
W: Failed to fetch Unable to find expected entry 'utilities-1.4/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file) E: Some index files failed to download. They have been ignored, or old ones used instead.
To resolve it we had to install mysql-apt-config selecting the option "apply"
sudo apt-get install mysql-apt-config

Wednesday, August 05, 2015

Use 'set -x' in docker multiline statements

Some people new to Docker are also new to bash which is a must-have skill for *nix sysadmin. Perhaps the most important statement in bash 'set -x' should be used in multiline statements to understand where exactly the whole RUN command is failing. The classical example involves entering a directory and issuing there several commands. Without 'set -x' you will be lost about why and in some cases even what specific command failed. Example:
RUN set -x \
      cd /tmp \

Wednesday, June 17, 2015

Scatter Diagrams from any two columns in Excel 2010

In Excel 2010 to plot a scatter diagram out of two columns that appear in any position and any order follow this steps:

  1. Click on an empty cell; select Menu | Insert | Scatter | Select first
  2. Right click on the chart area: click “Select Data” | Add legend entries (series) | Pick X and Y values | Pick a name for the series for example “Comparison of size and rental cost of apartments” or in general “Comparison of X and Y" | click OK
  3. From "Chart Tools | Design | Chart Layout" pick the first one (layout 1) which adds the axis labels
  4. Remove the label on the right which contains the name of the series. This is redundant as the title already states the same
  5. Click on each axis title labels to select it, then click again inside it to change it to the real name of Y and X