Install VMware Horizon Client in Debian 8 Jessie

24 02 2017

Download the linux client from the VMware website:

https://my.vmware.com/en/web/vmware/info/slug/desktop_end_user_computing/vmware_horizon_clients/4_0

The downloaded file is a bash script, execute it from a privileged user:

# bash VMware-Horizon-Client-4.3.0-4710754.x64.bundle

Install dependencies:

# apt-get install libudev-dev libffi-dev libglibmm-2.4-dev

Before finish the install, click into the “Scan” button. If libffi.so.5 is missing and you have libffi.so.6 only (usually in a modern Debian), create a symlink for bypass:

cd /usr/lib/x86_64-linux-gnu && ln -s libffi.so.6 libffi.so.5

Probably, if you execute now the client, it doesn’t start because the following:

$ vmware-view
/usr/lib/vmware/view/bin/vmware-view: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

Solve that creating a simlink:

# cd /lib/x86_64-linux-gnu && ln -s libudev.so.1 libudev.so.0

And run!:

$ vmware-view

Advertisements




Ssh error Too many authentication failures for root

8 02 2017

ssh -o PubkeyAuthentication=no root@host





Install OpenLDAP in Debian 8

21 12 2016

This guide is the best, by far, that covers the installation of a LDAP server and the configuration of the loging of a server through it.

https://www.unixmen.com/install-openldap-in-ubuntu-15-10-and-debian-8/

http://www.unixmen.com/configure-linux-clients-to-authenticate-using-openldap/





Split Haproxy configuration in multiple files working with Systemd

9 12 2016

Splitting Haproxy configuration in multiple files it’s a bit tricky due the Systemd startup behaviour. One workaround who works ok it’s the following:

1.- Split the Haproxy configuration file in multiple files.

1.1.- One file called “00-haproxy.conf” with the basic haproxy conf (in my case global, defaults and listen stats). This must have the 00- at the begining for listed it at first place in the script.

1.2.- One file for each listen section for the different services balanced, “some_name_a.conf”. Each new balanced service will have a new file.

Note: In this case, each balanced service is inside a listen section, not using fronted and backed.

# ls /etc/haproxy/
00-haproxy.conf service1.conf service2.conf

# cat /etc/haproxy/00-haproxy.conf
global
...
defaults
...
listen proxy-stats
...
# cat /etc/haproxy/corebalv1.conf
listen xxx
bind ...
server ...
server ...

2.- Create a small script into “/usr/local/bin/haproxy-multiconf” with this content:

#!/bin/bash
for file in /etc/haproxy/*.conf; do
test -f $file
CNF="$CNF -f $file"
done
echo "CONF='$CNF'" > /etc/haproxy/haproxy-multiconf.lst

3.- Create a new systemd unit for create the conf list before launching the main Haproxy unit.
# cat /etc/systemd/system/haproxy-multiconf.service
[Unit]
Description=HAProxy Load Balancer Multiconf
After=network.target
Before=haproxy.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/haproxy-multiconf
[Install]
WantedBy=multi-user.target

4.- Modify the default systemd unit file of Haproxy:
# cat haproxy.service
[Unit]
Description=HAProxy Load Balancer
After=network.target
Requires=haproxy-multiconf.service
[Service]
EnvironmentFile=/etc/haproxy/haproxy-multiconf.lst
ExecStartPre=/usr/local/sbin/haproxy -c -q $CONF
ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -p /run/haproxy.pid $CONF
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
[Install]
WantedBy=multi-user.target

5.- Refresh systemd and run it:

systemctl daemon-reload
systemctl restart haproxy.service





Run ssh-agent at login and load keys with an alias

27 07 2016

Add the following lines to the “~/.bashrc” for start automatically the ssh-agent service in each login and create and alias for load the keys and write the passphrase:

if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
fi
alias ssh-keys='ssh-add ~/.ssh/name_of_key_one ~/.ssh/name_of_key_two'





Reduciendo un volumen lógico ya montado y creando otro

16 01 2015

Tenemos la siguiente situación. Un sistema linux con un volumen lógico montado en ext4 de gran tamaño, el cual nos sobra mucho almacenamiento y queremos reducirlo, creando otro con el espacio liberado y manteniendo el antiguo con menos espacio.

Los pasos a seguir son los siguientes:
# 1º Reducir el volumen ya montado
# Desmontar punto de montaje, en este caso la home
$ umount /home
# Comprobar sistema de archivos, en este caso se llama lv_home
$ e2fsck -f /dev/mapper/lv_home
# Modificar el tamaño, en este caso 100G
$ resize2fs -p /dev/mapper/lv_home 100G
# Reducir el volumen, ¡importante hacerlo siempre después de reducir el sistema de archivos!
$ lvreduce -L 100G /dev/mapper/lv_home
# Comprobar el sistema de archivos
$ e2fsck -f /dev/mapper/lv_home
# Ajustar el tamaño del sistema de archivos al nuevo lv
$ resize2fs -p /dev/mapper/lv_home
# Comprobar el sistema de archivos
$ e2fsck -f /dev/mapper/lv_home
# Montar y probar
$ mount /home/
$ cd /home/
$ ls # debe entrar sin problemas

# 2º Crear el nuevo volumen con el espacio liberado
# Crear lv en VolGroup (se listan con $vgs)
$ lvcreate -l +100%FREE -n lv_datos VolGroup
# Crear sistema de archivos ext4
$ mkfs.ext4 /dev/mapper/VolGroup-lv_datos
# Crear punto de montaje y montar
$ mkdir /mnt/datos
$ echo '/dev/mapper/VolGroup-lv_datos /mnt/datos ext4 defaults 1 2' >> /etc/fstab
$ mount -a





Comando du listando directorios ocultos

22 12 2014

Para listar directorios ocultos usando el comando du:

# du -sch .[!.]* * |sort -h