Debian Stretch 9 issue with vim: copy and paste

20 06 2017

In Debian Stetch 9 there is a new behaviour in vim, the copy and paste with the mouse is unusual and don’t work as the previous versions did.

For fix that, in the file /usr/share/vim/vim80/defaults.vim comment the lines:

" if has('mouse')
" set mouse=a
" endif

Enable autologin in Debian with Systemd

19 05 2017

For allow autologin in a Debian system with systemd (very usefull with testing virtual machines):

Create dir:
mkdir /etc/systemd/system/getty@tty1.service.d/

Create file /etc/systemd/system/getty@tty1.service.d/override.conf with the following content:
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM

More info:

Boot Debian system with EFI Stub kernel

31 08 2016

I try to explain the process of install a Debian system with UEFI and use the EFI Stub property for load the kernel and the ram disk directly from the EFI system firmware, leaving aside “grub-efi” and scratching some seconds at boot time.

– Be sure that UEFI is enabled in your system booting firmware.

– Install Debian following the normal way until the partitioning step.

– UEFI require the following partitioning points:

* Around "500MB" of space
* Bootable flag on
* Partition type "EFI System Partition"

You can select automatic partitioning, and the Debian Installation process will create it automatically or doing the partitioning by hand using the indicated values.

Don’t create this partition under software RAID or LVM, the UEFI won’t read the files under that.

– End with the installation and reboot. If it went correctly, you have a polish running system, booted with grub-uefi, with the UEFI partition mounted under /boot/efi:

/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)

– Now is time to change the boot process into a EFI Stub, copy the kernel and the ram disk into the UEFI partition:

# cp /vmlinuz /initrd.img /boot/efi/EFI/debian/

– Look for your root filesystem UUID (in this example is sda2, the place were the linux is installed):

# blkid /dev/sda2
/dev/sda2: UUID="955548bd-9c77-4893-8633-3a5e7966dfc9" TYPE="ext4" PARTUUID="4cd59271-18a2-4d00-a65a-a106ee030a1a"

– And create an entry into the UEFI firmware for the linux EFIStub (replace the UUID number with your particular reference):

# efibootmgr -c -g -L "Debian (EFI stub)" -l '\EFI\debian\vmlinuz' -u "root=UUID=955548bd-9c77-4893-8633-3a5e7966dfc9 ro quiet rootfstype=ext4 add_efi_memmap initrd=\\EFI\\debian\\initrd.img"

– Check the UEFI information, the new entry is at the bottom:

# efibootmgr -v
BootCurrent: 0004
BootOrder: 0005,0004,0000,0001,0002,0003
Boot0000* EFI Virtual disk (0.0)
Boot0001* EFI VMware Virtual IDE CDROM Drive (IDE 1:0)
Boot0002* EFI Network
Boot0003* EFI Internal Shell (Unsupported option)
Boot0004* debian
Boot0005* Debian (EFI stub)
root@uefi:/boot/efi/EFI/debian# efibootmgr -v
BootCurrent: 0004
BootOrder: 0005,0004,0000,0001,0002,0003
Boot0000* EFI Virtual disk (0.0) ACPI(a0341d0,0)PCI(15,0)PCI(0,0)SCSI(0,0)
Boot0001* EFI VMware Virtual IDE CDROM Drive (IDE 1:0) ACPI(a0341d0,0)PCI(7,1)ATAPI(1,0,0)
Boot0002* EFI Network ACPI(a0341d0,0)PCI(16,0)PCI(0,0)MAC(MAC(005056948a0a,1)
Boot0003* EFI Internal Shell (Unsupported option) MM(b,e1a3000,e42ffff)FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
Boot0004* debian HD(1,800,ee000,4f3b579c-10cb-44ca-b845-475b2409eaf7)File(\EFI\debian\grubx64.efi)
Boot0005* Debian (EFI stub) HD(1,800,ee000,4f3b579c-10cb-44ca-b845-475b2409eaf7)File(\EFI\debian\vmlinuz)r.o.o.t.=.U.U.I.D.=. .r.o. .q.u.i.e.t. .r.o.o.t.f.s.t.y.p.e.=.e.x.t.4. .a.d.d._.e.f.i._.m.e.m.m.a.p. .i.n.i.t.r.d.=.\.E.F.I.\.d.e.b.i.a.n.\.i.n.i.t.r.d...i.m.g.
Boot0007* Debian HD(1,800,ee000,4f3b579c-10cb-44ca-b845-475b2409eaf7)File(\EFI\debian\grubx64.efi

– Look close to the information reported, the BootOrder have the new entry listed first, in the next boot the system will take it:

BootCurrent: 0004
BootOrder: 0005,0004,0000,0001,0002,0003

– Now, reboot and check the BootCurrent again:

BootCurrent: 0005
BootOrder: 0005,0004,0000,0001,0002,0003

– Basically it’s done. But for update the kernel and the ram disk automatically when an upgraded is installed, or removed, create the following files and make them executable:

# cat > /etc/kernel/postinst.d/zz-update-efistub << EOF
echo "Updating EFI boot files..."
cp /vmlinuz /initrd.img /boot/efi/EFI/debian/

# chmod +x /etc/kernel/postinst.d/zz-update-efistub# cp /etc/kernel/postinst.d/zz-update-efistub /etc/kernel/postrm.d/zz-update-efistub

As a note, is it possible to substitute this script with systemd units. Look into the Arch linux wiki for more info.

– Thats all.



— But if you have some problems:

– If you need to revert the chage, for example, to keep boot0004 first again, execute:

# efibootmgr -o 0004,0005,0000,0001,0002,0003

– If you lost the Debian entry created at installation time, recrete it with this:

# efibootmgr -c -g -L "Debian" -l '\EFI\debian\grubx64.efi'

– If you have problems with EFI variables, be sure that you have installed “efivar” and “efivars” kernel module loaded (modproble efivars).


More info:

Fix dns problem with OpenVPN in Debian 8 Jessie

29 04 2015

If the openvpn connection don’t assign automatically the DNS setting from the servers, you need to put the script in the correct place.

After installing openvpn:
cp /etc/openvpn/update-resolv-conf /usr/share/openvpn/
chmod ugo+x /usr/share/openvpn/update-resolv-conf

That’s all. Connect again and review your resolv.conf

Install official vmware-view-client in Debian 8 Jessie

28 04 2015

As 2017, this document is deprecated, please, follow the method indicated here:


For x64 systems aren’t available the official pacakge of Vmware View Client. The only solution is make the trick with an old Ubuntu version package and the multiarch support of Debian.

First, add the x86 multiarch support:
dpkg --add-architecture i386
apt-get update

Install Gdebi for an easy dependency resolution:
apt-get install gdebi
Download libssl and vmware-view-client from Ubuntu site or from my github account:
wget ''
wget ''
wget ''
wget ''

Install the packages and accept dependencies:
gdebi libssl0.9.8_0.9.8o-7ubuntu3.1_i386.deb
gdebi vmware-view-client_2.2.0-0ubuntu0.12.04_i386.deb

If all was ok, the new VMware View Client is available under your desktop menu.

Running / Installing old ATI Radeon HD 2000/3000/4000 series graphic card in Debian Jessie

26 04 2015

Debian Jessie (specifically the version of Xorg that it have) don’t have support for the ATI propietary driver that manage Radeon HD 2000/3000/4000 series. As it says in the official wiki “is not available for Debian 8 “Jessie”, as upstream has not updated the driver for newer Xorg releases (726500).”.

For that reason, if you have an old Radeon HD 2000/3000/4000 graphic card, you can only use open source driver xserver-xorg-video-radeon wich is a reliable way to keep your computer running with the new Debian release.

In my case this is this particular graphic card:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV710/M92 [Mobility Radeon HD 4330/4350/4550]

After the default installation, the system don’t boot up with the correct resolution because the kernel need to read some propietary binary firmware. You need to follow this steps for keep it running nicely:

1.- Add the non-free repositories to “/etc/apt/sources.list”:
deb jessie main contrib non-free
deb-src jessie main contrib non-free

2-a.- Update apt and install the following package if your systems is older than Debian Stretch:
apt-get update
apt-get install firmware-linux-nonfree

2-b.- Update apt and install the following package if your systems is newer or equal than Debian Stretch:
apt-get update
apt-get install firmware-amd-graphics

3. Reboot your computer and enjoy!


Interesting are the power states, check this page for more information and the tool radcard, maybe you can save some battery life of improve the cooling. Check the power state with the following command:
# radcard get
power_dpm_state: battery
power_dpm_force_performance_level: low

# radcard set high && radcard set perfomance
power_dpm_state: performance
power_dpm_force_performance_level: high
# cat /sys/kernel/debug/dri/0/radeon_pm_info
uvd vclk: 0 dclk: 0
power level 2 sclk: 45000 mclk: 50000 vddc: 1100

# radcard set low && radcard set battery
power_dpm_state: battery
power_dpm_force_performance_level: low
# cat /sys/kernel/debug/dri/0/radeon_pm_info
uvd vclk: 0 dclk: 0
power level 0 sclk: 30000 mclk: 40000 vddc: 1100

Instalar JSigpac en linux – 2014

4 08 2014

Estos son los pasos para instalar JSigpac en Linux, en concreto en Debian Wheezy:

1.- Descagar la versión estable de Java Runtime Enviroment para linux (x64 o x86 según nuestra arquitectura) y copiar el archivo en (si no existe, crear el directorio):

2.- Descomprimir el archivo:
# tar -xzvf jre-7u65-linux-x64.tar.gz

3.- Comprobar que funciona:
# /opt/java/jre1.7.0_65/bin/java -version

4.- Descargar la versión de Java Advanced Imaging Binary Builds (el binario para JRE llamado jai-1_1_3-lib-linux-amd64-jre.bin, ojo, hay más archivos para distintas cosas, mirar bien que tiene que acabar en «…jre.bin» y tiene que ser el indicado a nuestra arquitectura) de y mover el archivo dentro de «/usr/java/jre1.7.0_65/» (si se tiene instalado java de paquete el directorio es /usr/lib/jvm/default-java/jre):
# wget '' # mv jai-1_1_3-lib-linux-amd64-jre.bin /opt/java/jre1.7.0_65/# cd /opt/java/jre1.7.0_65/

5.- Cambiar los permisos al fichero:
# chmod ugo+x jai-1_1_3-lib-linux-amd64-jre.bin

6.- Instalar la libreria:
# ./jai-1_1_3-lib-linux-amd64-jre.binAceptar la licencia y si todo el proceso sale bien, veremos un mensaje indicando que se han copiado copiado las librerias y ya podemos usar jre con jai. Se nota mucho el uso de jai en la velocidad de proceso de las imágenes.

7.- Asignar las variables para poder utilizar java sin poner la ruta completa:
# ln -s /opt/java/jre1.7.0_65/ /usr/local/javaJAVA_HOME=/usr/local/java/

8.- Descargar el código de la aplicación jsigpac En enlace aparece al final de la página «Fuentes jSIGPAC» y lo descomprimimos en «/opt/jsigpac/», crear el directorio si no existe.

8.- Crear la variable «$CLASSPATH» con las referencias al sitio donde se ha descomprimido jsigpac, en la web pone que hay que tener las referencias a jai, pero habiendo descargado el binario para jre y habiendolo instalado bien, este paso no es necesario, sólo hay que poner la ruta del programa para poderlo ejecutar desde cualquier sitio:
# CLASSPATH="/opt/jsigpac/jSIGPAC:."# export CLASSPATH

10.- Para que se asignen de manera automática estas variables la próxima vez, incluir las siguientes líneas al final del archivo:
# echo 'export JAVA_HOME=/usr/local/java/' >> ~/.bashrc# echo 'export PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin' >> ~/.bashrc# echo 'export CLASSPATH="/opt/jsigpac/jSIGPAC:."' >> ~/.bashrc# source ~/.bashrc

11.- Probar que funciona:
# cd /tmp# java -Xmx1000m -Xms1000m JSigpac -d -SIBX -mORTO -h30 -x440400 -y4474438 -A4000 -r2 -fMadrid# java -Xmx1000m -Xms1000m JSigpac -e -fMadrid -efil9 -ecol8 -J100