Category: Debian

Fix Spotify incompatible libc after update on Debian GNU/Linux

Hello,

I recently updated my Debian desktop machine with Fluxbox as Window manager and noticed a Spotify update that actually broke my Spotify installation. You will get a error like this when you start Spotify from the commandline.

spotify: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by spotify)
spotify: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/spotify/spotify-client/Data/libcef.so)
spotify: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by /opt/spotify/spotify-client/Data/libcef.so)

I was looking for a solutions where I didn’t need to downgrade my libc version or re-install another version.
I found a interesting post on the Debian forums that solved the issue.

1. Download libc6_2.19-7_amd64.deb and patchelf_0.8-2_amd64.deb. You can find them here.

https://packages.debian.org/fi/sid/amd64/libc6/download
http://packages.ubuntu.com/cs/utopic/amd64/patchelf/download

I also have two mirrored deb files here:
libc6_2.19-7_amd64
patchelf_0.8-2_amd64

2. Create a bash script named install-spotify-libc.sh with the following content.

#!/bin/bash

LIBC_DIR=/usr/local/bin/spotify-libc

if [ $# != 2 ]; then
    echo "Usage: `basename $0` libc.deb patchelf.deb" >&2
    exit 1
fi

LIBC_DEB=$1
PATCHELF_DEB=$2
PATCHELF_DIR=`mktemp -d --tmpdir patchelf.XXXXXXXX`

LIBS="$LIBC_DIR/lib/x86_64-linux-gnu"
LDSO="$LIBS/ld-linux-x86-64.so.2"
PATCHELF="$PATCHELF_DIR/usr/bin/patchelf"

mkdir -p "$LIBC_DIR"
dpkg -x "$LIBC_DEB" "$LIBC_DIR"
dpkg -x "$PATCHELF_DEB" "$PATCHELF_DIR"

"$LDSO" --library-path "$LIBS" "$PATCHELF" --set-interpreter "$LDSO" /opt/spotify/spotify-client/spotify
"$LDSO" --library-path "$LIBS" "$PATCHELF" --set-interpreter "$LDSO" /opt/spotify/spotify-client/Data/SpotifyHelper

"$LDSO" --library-path "$LIBS" "$PATCHELF" --set-rpath "\$ORIGIN:\$ORIGIN/Data:$LIBS" /opt/spotify/spotify-client/spotify
"$LDSO" --library-path "$LIBS" "$PATCHELF" --set-rpath "\$ORIGIN:$LIBS" /opt/spotify/spotify-client/Data/SpotifyHelper

"$LDSO" --library-path "$LIBS" "$PATCHELF" --set-rpath "$LIBS" /opt/spotify/spotify-client/Data/libcef.so
"$LDSO" --library-path "$LIBS" "$PATCHELF" --set-rpath "$LIBS" /opt/spotify/spotify-client/Data/libffmpegsumo.so

rm -rf "$PATCHELF_DIR"

Give it execute permission.

chmod +x install-spotify-libc.sh

3. Run the script as root with the deb packages as arguments.

sudo ./install-spotify-libc.sh libc6_2.19-7_amd64.deb patchelf_0.8-2_amd64.deb

4. Start Spotify and it should work.

Thanks to cchip for this fixed posted in the Debian forums (this post).
You can read the whole thread here.

/Trigger

How to compile and use Shallot on Debian GNU Linux

Hello,

Here is a simple guide on how to compile and use Shallot on Debian GNU Linux.
The same procedure should work on any Linux distribution.

Shallot is used to generate an Tor .onion address that includes a specific word.
This is done by generating a private key until a match is found for the hashed hostname.

Longer words can be extremely CPU and time consuming, see the “performance” section in the README below!
https://github.com/katmagic/Shallot

1. Make sure you have gcc, make and libssl-dev

apt-get install gcc make libssl-dev

2. Download Shallot

wget https://github.com/katmagic/Shallot/archive/master.zip

3. Unzip master.zip

unzip master.zip
cd Shallot-master/

If you don’t have “unzip”, install it.

apt-get install unzip

4. Configure and compile

./configure
make

5. Test Shallot

./shallot ^test

You should get a result similar to this (but with a unique pattern after your “test” word).

----------------------------------------------------------------
Found matching domain after 763166 tries: testx2oljxiewtpy.onion
----------------------------------------------------------------
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDXJ7O5qDT9Frzn5QoetkQHHvHBJ1JKoHWfyxV3+eWGgKp5fPMs
E499NLphTxJjDPWl858bvgoEdfiAAq3u68HxWX41shhxgM3Asx6zd/OVyj0lhfTh
pPUuMoefbn4CyWpRS7B1Fr+UCBMiRlrhHtcHJTvniSNXh25fopBfho5MGwIDDVu9
AoGAY3aIhEr+EFAEzfUkV3ATtD6xMQK3hmFBMap30xdFoajs3xYspJ8oLXuu/0JP
nLb85o/S1KOoZSt1MS5UD+HnmEdgM1IoaKhgk6ZYBUaopmQmtECFq6SvyvhR5Zk0
dvbx8DHWtBeKtZQBCAn6qzf0WR4RTnu+L8PH+7lrlcvrM9UCQQDzdVaNfY28WPcJ
uuTPHFFsGmoNtMJ6Bnw6LrvILE+KSndCq8si/0mIyQr+XOzw1e4x/tSX91K+Y71G
8hDHR5ehAkEA4j0btrLdxFmPg7Q6WAGDogYfOTeeSJl7o9J9ogu1hcdFFjBnYkfx
FvyvR6ORW6VOgChu5GXeNdcnI7hvkqgaOwJBALdfExFfFRduGRlevB0Y2LUDtqMC
rjMSghqdJDjXlI+LwdEkF8THPiZK0y4YJVyMlCVUwl/0fcCHtOj7KVj2btUCQBlj
TamV1iUztK3suKxP7BajWTtSQTexP7TYYjqsxAN3KLQrEDNw5Mn1KcLJ273rbHCH
FAqYgTWpghryhR+KgNcCQCiL4hIxbc/jm/GqMR8Ir5KiIl39JJIvr49wpC7v9rHz
G5SIRtUdQ0PaZy7EnalSvleM0Xf9tzZIZ8Be+v3rTDA=
-----END RSA PRIVATE KEY-----

Now you can go ahead and use it on your Tor server.
Hope this was of any use to you.

/Trigger

Keywords: how to custom onion address tutorial

How to fix Nagios “error: Could not stat() command file” on Debian GNU Linux

Hello,

If you are recieving this problem in Nagios it’s probably because of faulty permissions
or erroneous Nagios configuration.

1. Make sure the following is set in the Nagios configuration in /etc/nagios3/nagios.cfg

nano /etc/nagios3/nagios.cfg
# EXTERNAL COMMAND OPTION
# Values: 0 = disable commands, 1 = enable commands
check_external_commands=1

# EXTERNAL COMMAND FILE
command_file=/var/lib/nagios3/rw/nagios.cmd
</code>

Also make sure the /var/lib/nagios3/rw/nagios.cmd file does exist.

file /var/lib/nagios3/rw/nagios.cmd
/var/lib/nagios3/rw/nagios.cmd: fifo (named pipe)

2. Make sure your Nagios user has the permissions to execute the commands, check in /etc/nagios3/cgi.cfg

nano /etc/nagios3/cgi.cfg
# SYSTEM/PROCESS COMMAND ACCESS
authorized_for_system_commands=nagiosadmin

# GLOBAL HOST/SERVICE COMMAND ACCESS
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

Default is the nagiosadmin user

3. Make sure the www-data user (the user running Apache) is in the Nagios user group.

id www-data

Output:

uid=33(www-data) gid=33(www-data) groups=33(www-data)

Adding the www-data user to the Nagios group.

usermod -a -G nagios www-data
</code>

Check again.

id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data),106(nagios)

5. Check the permissions for the nagios.cmd file like this

ls -l /var/lib/nagios3/rw/nagios.cmd 
prw-rw---- 1 nagios nagios 0 Jun 24 11:39 /var/lib/nagios3/rw/nagios.cmd

And then make sure there is execute permission for groups on the /var/lib/nagios3/rw directory.

ls -l /var/lib/nagios3/
total 132
-rw-r--r-- 1 nagios nagios      572 Jun 13 08:14 host-perfdata.out
-rw------- 1 nagios www-data 115362 Jun 24 11:18 retention.dat
drwx------ 2 nagios www-data   4096 Jun 24 11:18 rw
-rw-r--r-- 1 nagios nagios     2162 Jun 13 08:16 service-perfdata.out
drwxr-x--- 3 nagios nagios     4096 Jun 11 23:15 spool

Add execute permissions for group like this.

chmod g+x /var/lib/nagios3/rw/
ls -l /var/lib/nagios3/
total 132
-rw-r--r-- 1 nagios nagios      572 Jun 13 08:14 host-perfdata.out
-rw------- 1 nagios www-data 115362 Jun 24 11:18 retention.dat
drwx--x--- 2 nagios www-data   4096 Jun 24 11:18 rw
-rw-r--r-- 1 nagios nagios     2162 Jun 13 08:16 service-perfdata.out
drwxr-x--- 3 nagios nagios     4096 Jun 11 23:15 spool

6. Now all you have to do is to restart Apache (and possibly Nagios too) and it should be working with external commands.

service apache2 restart
service nagios3 restart

/Trigger

How to monitor VMware ESXi using Nagios

Hello,

Final result

I wanted to monitor my VMware ESXi host using my Nagios monitor and used the check_vmware_api perl plugin for Nagios.
You can find the check_vmware_api perl script here.

In order to run this plugin you will need the VMware vSphere SDK for Perl, you will need to have it on the Nagios server.
I have written a pretty decent walkthrough guide on how to install this specifically for this plugin here.

1. First off we download the check_vmware_api from the link provided above (here).
Download it and place it in your nagios plugins folder, I’m using the name check_esx since it’s more comfortable.

cp check_vmware_api /usr/lib/nagios/plugins/check_esx
chmod +x /usr/lib/nagios/plugins/check_esx

2. Before we continue and define our Nagios command we should try it out, let’s do a basic test on CPU usage.

cd /usr/lib/nagios/plugins/
./check_esx -H 127.0.0.1 -u nagios -p test123 -l cpu -s usage -w 90 -c 95

Above is a simple check, here you specify the IP of the VMware host, username and password for the user to be used.
You can also specify when it should warn and when it should be considered critical.

What I did was create an additional user named nagios for the authentication (see below).
You should get a result similar to this:

CHECK_ESX OK - cpu usage=3.19 % | cpu_usage=3.19%;90;95

Here is a quick guide on how to add a VMware user.

  • Go to Inventory -> Local Users & Groups
  • Rightclick -> Add -> Fill in login, username and password
  • Go to Inventory -> Permissions
  • Rightclick -> Add Permission
  • You then select your newly created “nagios” user and assign it as Administrator (it’s required by VMware to be allowed to query for all the values)
  • 4. Continuing on, now we need to define Nagios commands for checking CPU, memory etc.
    I add the following to my /etc/nagios3/resource.cfg file to store the password for the VMware user, this way I dont have type it in several times.

    nano /etc/nagios3/resource.cfg
    

    Make sure there isn’t already a USER3 and USER4 declaration.
    Note that the variables must be defined like USERx else it won’t work (where x is a number)

    $USER3$=nagios
    $USER4$=test123
    

    I then continue on declaring the command in /etc/nagios3/commands.cfg

    nano /etc/nagios3/commands.cfg
    
    define command{
    command_name check_esx_cpu
    command_line /usr/bin/perl $USER1$/check_esx -H $HOSTADDRESS$ -u $USER3$ -p $USER4$ -l cpu -s usage -w $ARG1$ -c $ARG2$
    }
    
    define command{
    command_name check_esx_mem
    command_line /usr/bin/perl $USER1$/check_esx -H $HOSTADDRESS$ -u $USER3$ -p $USER4$ -l mem -s usage -w $ARG1$ -c $ARG2$
    }
    
    define command{
    command_name check_esx_net
    command_line /usr/bin/perl $USER1$/check_esx -H $HOSTADDRESS$ -u $USER3$ -p $USER4$ -l net -s usage -w $ARG1$ -c $ARG2$
    }
    
    define command{
    command_name check_esx_status
    command_line /usr/bin/perl $USER1$/check_esx -H $HOSTADDRESS$ -u $USER3$ -p $USER4$ -l runtime -s status
    }
    
    define command{
    command_name check_esx_ioread
    command_line /usr/bin/perl $USER1$/check_esx -H $HOSTADDRESS$ -u $USER3$ -p $USER4$ -l io -s read -w $ARG1$ -c $ARG2$
    }
    
    define command{
    command_name check_esx_iowrite
    command_line /usr/bin/perl $USER1$/check_esx -H $HOSTADDRESS$ -u $USER3$ -p $USER4$ -l io -s write -w $ARG1$ -c $ARG2$
    }
    

    Here you can see I’m specifying the USERx variable, make sure it’s correct

    I then add the service checks to the VMware host configuration in Nagios.
    A pretty much complete Nagios host configuration would look similar to this.

    define host{
            use                     generic-host
            host_name               vmware01
            alias                   vmware01.test.com
            address                 127.0.0.1
            notes                   VMware 01
            }
    
    define service{
            use                             generic-service
            host_name                       vmware01
            service_description             PING
            check_command                   check_ping!100.0,20%!500.0,60%
            }
    
    define service{
            use                             generic-service
            host_name                       vmware01
            service_description             VMware CPU
            check_command                   check_esx_cpu!80!90
    }
    
    define service{
            use                             generic-service
            host_name                       vmware01
            service_description             VMware Memory
            check_command                   check_esx_mem!80!90
    }
    
    define service{
            use                             generic-service
            host_name                       vmware01
            service_description             VMWare Network
            check_command                   check_esx_net!102400!204800
    }
    
    define service{
            use                             generic-service
            host_name                       vmware01
            service_description             VMWare Status
            check_command                   check_esx_status
    }
    
    define service{
            use                             generic-service
            host_name                       vmware01
            service_description             VMWare IO Read
            check_command                   check_esx_ioread!40!90
    }
    
    define service{
            use                             generic-service
            host_name                       vmware01
            service_description             VMWare IO Write
            check_command                   check_esx_iowrite!40!90
    }
    

    Then just restart your Nagios and your services should start popping up.

    service nagios3 restart
    

    Feel free to comment with questions or corrections
    /Trigger

    How to install VMware vSphere SDK on Debian GNU Linux

    Hello,

    I wanted to setup Nagios monitoring for my VMware host and found this nifty little Perl plugin check_vmware_api (you can find it here).

    In order to run this plugin you will need the VMware vSphere SDK for Perl.
    You can search for it on VMware’s download page here.

    I searched for “vsphere sdk” and choose the first result VMware vSphere SDK for Perl 5.5 and downloaded the x64 Linux version.
    The problem here is that it’s not originally for Debian but for Ubuntu so we’ll have to do some adjustments later on.

    1. We need to make sure we have the following packages.

    apt-get install build-essential gcc uuid uuid-dev perl libssl-dev perl-doc liburi-perl libxml-libxml-perl libcrypt-ssleay-perl
    

    2. When you have downloaded the vSphere SDK for Perl we need to untar it, do some modifications then install.

    tar xvf VMware-vSphere-Perl-SDK-5.5.0-1384587.x86_64.tar.gz
    cd vmware-vsphere-cli-distrib
    

    3. Do the following changes, open vmware-install.pl in your favored text editor (I’m using nano)

    nano vmware-install.pl
    

    Change this line

    if ( direct_command("cat /etc/*-release | grep -i ubuntu") || direct_command("cat /proc/version | grep -i ubuntu") ) {
    

    to

    if ( direct_command("cat /etc/*-release | grep -i debian") || direct_command("cat /proc/version | grep -i debian") ) {
    

    4. This step is pretty much optional but to prevent recieving some warnings because of undefined exportvariables you can set the following or just ignore this step.

    export http_proxy=
    export ftp_proxy=
    

    5. Now you should be good to go, so go on and execute the installation.

    ./vmware-install.pl
    

    Thanks for reading and please comment if you have any corrections or questions
    /Trigger