Translate

jueves, 5 de abril de 2018

Black screen in VNC SSH tunneled session after closing SSH connection.
SSH closes X11 clients from VNC session (Fixed / Solved ) /
Pantalla negra en sesión de VNC conectada mediante túnel de SSH.
Al cerrar el SSH se cierran clientes de X11 de la sesión del vncserver ( Solucionado / resuelto )


After disconnecting from a SSH connection, the x-clients from the vncserver session were killed from the memory.
After checking the logs of the vncserver ( .vnc/<hostname>:VNCDISPLAY.log ) , I found a message that stated that the file /tmp/.X11-unix should be owned by root. Indeed, for an uknown reason it was owned by other user (in my case was owned by cron).

So I just fixed it with:

chown root:root  /tmp/.X11-unix


And no more 'black screens' in VNC session. Hope this helps somone else.


Traducción:

Después de desconectarse de una conexión SSH, los x-clients de la sesión vncserver se eliminaron de la memoria.

Después de verificar los registros de vncserver (.vnc/<hostname>: VNCDISPLAY.log), encontré un mensaje que indicaba que el archivo /tmp/.X11-unix debería ser propiedad de root. 

De hecho, por alguna razón desconocida era propiedad de otro usuario (en mi caso, de cron).

Así que lo solucioné simplemente con:

chown root: root /tmp/.X11-unix


Y no más 'pantallas negras' en la sesión de VNC. Espero que esto ayude a alguien más.

lunes, 2 de abril de 2018

Desactivación/Activación de Touchpad Mouse por script

Algunas computadoras, como cierto tipo de laptops, no muestran una combinación de teclas para activar/desactivar el Touchpad o Mouse integrado en el teclado.
Para arreglar esto se puede crear un script llamado "toggletouch" en ~/bin que contenga lo siguiente:

toggletouch
#!/bin/bash
#Toggle touchpad activa/desactiva el Touchpad o Mouse integrado al teclado
#Identificamos touchpad:
id=$( xinput | grep -i touch | cut -f2 -d'=' | sed -r 's|([^0-9]*)([0-9][0-9]*)(.*)|\2|g' )
#echo "Touchpad con id=|$id|"

enabled=$( xinput --list-props $id | grep "Device Enabled" | cut -f2 -d':' | sed -r 's|([^0-9]*)([0-9][0-9]*)(.*)|\2|g' )
#echo "enabled=$enabled"
#Poner el usuario/home correctos :
user=$( whoami ); home=$HOME

dfile="$HOME/Desktop/ToggleTouchPad.desktop"
#dpanel="$HOME/.gnome2/panel2.d/default/launchers/toggletouch.desktop"

if [ "$enabled" == "0" ]; then
  echo "Habilitando Touchpad"
  xinput --enable $id
  sed -i 's|touchPadOff.svg|touchPadOn.svg|g' $dfile ; touch $dfile
  ln -fs ~/bin/touchPadOn.svg ~/bin/touchPad.svg
else
  echo "Deshabilitando Touchpad"
  xinput --disable $id
  sed -i 's|touchPadOn.svg|touchPadOff.svg|g' $dfile ; touch $dfile
  ln -fs ~/bin/touchPadOff.svg ~/bin/touchPad.svg
fi
  touch $dfile



Los archivos  touchPadOff.svg y touchPadOn.svg son para el launcher que crearemos en ~/Desktop. El contenido de estos archivos es:

touchPadOff.svg
<svg height='200' width='200'  fill="#000000" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path fill="#000000" d="M76.9,58.3l14.8,14.8V25c0-4.6-3.7-8.3-8.3-8.3H35.3l8.3,8.3h39.7v33.3H76.9z"></path><path fill="#000000" d="M9.6,13.4l3.9,3.9c-3,1.2-5.2,4.2-5.2,7.7v50c0,4.6,3.7,8.3,8.3,8.3h62.9l7.1,7.1l5.3-5.3L14.9,8.1L9.6,13.4  z M71.2,75h-17v-8.3h8.7L71.2,75z M16.7,25h4.5l33.3,33.3H16.7V25z M16.7,66.7h29.2V75H16.7V66.7z"></path></svg>
 



 touchPadOn.svg
<svg height='200' width='200'  fill="#000000" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path fill="#000000" d="M83.3,16.7H16.7c-4.6,0-8.3,3.7-8.3,8.3v50c0,4.6,3.7,8.3,8.3,8.3h66.7c4.6,0,8.3-3.7,8.3-8.3V25  C91.7,20.4,87.9,16.7,83.3,16.7z M45.8,75H16.7v-8.3h29.2V75z M83.3,75H54.2v-8.3h29.2V75z M83.3,58.3H16.7V25h66.7V58.3z"></path></svg>



Y por último el launcher que se llamará ToggleTouchPad.desktop, lo pondremos en ~/Desktop y contendrá lo siguiente:

ToggleTouchPad.desktop
#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Toggle Touchpad
Exec=/home/mmendez/bin/toggletouch
Comment=Touch pad toggle
Icon=/home/mmendez/bin/touchPadOff.svg


Al hacer click en el launcher, el script toggletouch automáticamente cambiará el icono del launcher.

Probado en Linux CentOS 6.9