Sunday, December 28, 2014

Monitor fans on HP Proliant ML150 G3 running Debian Lenny Linux

(This blog is in reference to a Debian Lenny AMD64 system)
hp-health is the package that is supposed to provide access to the fan status on HP Proliant servers.  It is not easy to install hp-health on Debian Lenny.  The ISO can be located by searching the HP website.

On my system the existence of 2 files for UPS monitoring software Winpower causes ldconfig error messages:
  • /usr/lib/libjspTru64Alpha.so
  • /usr/lib/libjspAixPpc.so
 - you can try to temporarily move the files during installation/removal of hp-health, but this didn't help due to the following errors.

Having VMware Server 2 installed confuses the hp-health init script (/etc/init.d/hp-health), which is designed to have different behaviour for ESX servers.  Applying an exit workaround in the procedure causes the script to appear to behave correctly, but the daemon fails to start.

Uninstallation of hp-health is also fraught with difficulty. It is necessary to alter the exit code on the init script just to get the script to continue with removal.  The script will fail to remove /opt/hp/hp-health (and will attempt to remove /opt !).  If you need to manually change the installation status you will need to edit /var/lib/dpkg/status to remove the hp-health section.


After doing all the work above it was found that ipmitool could easily be installed:
apt-get install ipmitool
modprobe ipmi_msghandler
modprobe ipmi_devintf
modprobe ipmi_si
 And the fan RPM's are shown with:
ipmitool sdr type fan
(it takes a few seconds to probe).

Wednesday, August 13, 2014

Automate PDF printing from batch file command line

Adobe Reader is not suitable for printing PDF files using a batch file because it remains open after the print is done and there is no simple, safe & reliable mechanism to close it.  Instead use Ghostscript commandline as shown below:

gswin32c -dPrinted -dBATCH -dNOPAUSE -dNOSAFER -q -dNumCopies=1 "C:\test.pdf"

*Must be a recent version of Ghostscript, e.g. 9.x

Sunday, August 3, 2014

GParted does not start in LXQt

Symptom: Clicking on GParted launcher has no effect. Log /var/log/messages shows:
The value for environment variable TERM contains suscipious content ...
The cause was having set the TERM variable using LXQt Session Settings, Default Applications, Terminal Emulation to /usr/bin/lxterm.  Changing back to xterm and logging out-in fixed the issue.

Sunday, June 15, 2014

Compiling a specific commit from Git

cd /usr/local/src
git clone [ProjectX]
cd [ProjectX]
git checkout [commit checksum from Github]

mkdir build
cd build
cmake ..
make
sudo make install


To return to the master version:
...
git checkout master
...

Sunday, May 25, 2014

Install LXQt on Sabayon 14

This is a quick guide to installing LXQt desktop (current version LXQt 0.7.0) on Gentoo based Sabayon Linux (current release 14.06).


Firstly, remove razor-qt to avoid file collisions.

Use Layman to add the Qt overlay:
layman -a qt
Use Emerge to attempt to install lxqt-meta:
emerge -av lxqt-base/lxqt-meta
If it fails copy the text below regarding keywords, and paste into
/etc/portage/package.accept_keywords
Attempt to install again:
emerge -av lxqt-base/lxqt-meta
If it fails copy the text below warning the about unmask, paste into
/etc/portage/portage.unmask/99-lxqt.package.unmask
Attempt to install again:
emerge -av lxqt-base/lxqt-meta
If it fails on lxqt-panel download from source and manually compile and install:

 mkdir /usr/src/lxqt-panel
 cd /usr/src/lxqt-panel 
  wget http://lxqt.org/downloads/lxqt/0.7.0/lxqt-panel-0.7.0.tar.gz
 tar xvf lxqt-panel-0.7.0.tar.gz
 cd lxqt-panel
 mkdir build
 cd build
 cmake ..
 make
 sudo make install

If other packages from lxqt-meta have not installed, you may install them individually using Emerge, e.g.:
emerge -av  lxqt-base/lxqt-session
You should now be able to select LXQt from the login screen.

Wednesday, April 30, 2014

Private Debian secure apt repository

Secure apt was introduced in Debian 3 (Sarge) in 2005.  Secure apt requires crypto signing (PGP) of the Release file, not the deb packages.  Without secure apt installation of packages will prompt for verification before installation.

Trivial apt repositories use a simple flat file structure, but do not support "secure apt".  Hence, in order to set up an apt repository that does not prompt for verification of package updates such as a Personal Package Archive (PPA) it is necessary to configure a non-trivial apt repository.

The non-trivial repository file structure must contain:
debian
 + dists
     + { archive, e.g. stable } /Release, Release.gpg(package release info)
         + { component, e.g. main }
             + { architecture, e.g binary-amd64 } /Packages, Packages.gz, Release(architecture release info)
             + source / (if empty, source packages will not be available)
 + pool /*.deb (Packages)


To set up crypto ability on the server install and run gpg. RSA key required, 4096 bytes recommended, if a blank password is used you will not be prompted for a password to sign the Release file.


Notes:
*The package Release file *must* contain a line for "Suite: "
**Create the Packages files *before* creating the package Release file.


To create a package list Release file use an application like apt-ftparchive. Note that the files listed in the Release file must be relative to the debian/dists/{archive} directory. E.g.:
 cd /var/www/debian/dists/stable
 echo "Suite: stable" > Release
 apt-ftparchive release . >> Release

One example method of how to sign the Release file:
 cd /var/www/debian/stable
 gpg --default-key "My key name" -abs -o Release.gpg Release  

To use the repository on a client add a line to /etc/apt/sources.list.d/custom.list:
 deb http://{server}/debian/  {archive}  {component}

To remove the verification prompt on the client export the key from the server, transfer to the client and install to apt:
Server: gpg --armor --export "My key name" > myserver.gpg.key
Client: apt-key add myserver.gpg.key



Friday, April 25, 2014

Flash Player with QtWeb

QtWeb 3.8.5 on Linux uses the following location to load the Flash Player plugin:
/usr/lib64/nsbrowser/plugins/libflashplayer.so
The file should be marked as executable.
Note, according to Qt Project documentation QtWebKit will also search other paths - for details see:
http://qt-project.org/doc/qt-4.8/qtwebkit.html#netscape-plugin-support

Because QtWeb is 32-bit this can conflict with other web browsers installed on 64-bit Linux.  To avoid this issue put the libflashplayer.so file in another location such as:
/usr/local/lib32/qtweb/plugins/libflashplayer.so
Then edit the desktop file to use an Exec line such as:
Exec=env MOZ_PLUGIN_PATH=":/usr/local/lib32/qtweb/plugins" /usr/local/bin/QtWeb
 - this will apply the environment variable only to the process where QtWeb is launched.


To see other files and locations that QtWeb is trying to access you can use strace:
strace -e open QtWeb
or to grep a specific keyword (e.g. plugin):
strace -e open QtWeb 2>&1 grep -i plugin

Saturday, January 11, 2014

Enable NTP in Sabayon

To enable NTP time synchronization in Sabayon linux:

1. Install ntp package.
2. Customize configuration if required: /etc/ntp.conf
2. As root enable the service in systemd:
systemctl enable ntpd.service
3. Start the service:
systemctl start ntpd.service

It takes several minutes for the service to adjust the time. If the clock is skewed by more than 17 minutes then use the following command to perform a manual time sync:
ntpdate 0.gentoo.pool.ntp.org
To verify the NTP daemon is running:
ps -lA|grep ntp