~
~
:wq

Sunday, 6 November 2011

Unity's "about:config" doesn't work in Ubuntu 11.10 Oneirc Ocelot

Custumization of Unity in Ubuntu 11.10; about:config doesn't work

spanish version - all english posts

Unity probably due to a misguided Ubuntu's "zero-config" policy cannot be customized by the end user. At least by default.

Theroetically by pressing alt-F2 and typing in the laucher "about:config" the configuration/personalization utility of Unity should appear... but although the icon of the configuration utility shows up, nothing happens at all. Neither even a notice that the config utility is not working. A minimal configuration tool is not installed by default. Incredible!

To make the configuration utility work you must install CCSM (The «compiz config settings manager»):

apt-get install compizconfig-settings-manager

Once that package is installed, the "about:config" thing will work. It's pretty sad that Ubuntu doesn't allow the end user to personalize the desktop (or doesn't seriously take into account that possibility); but it is at least as sad, that when the user tries to launch the "hidden" config utility there is not a minimal warning saying that the user should install CCSM to make it work.

To check the few (really few) options that the CCSM configuration tool allows, I recommend to read the following link; but once you have opened the utility you will notice that there's not much to customize:

http://askubuntu.com/questions/29553/how-can-i-configure-unity

However it seems that things will change in the near future:

http://www.omgubuntu.co.uk/2011/11/ubuntu-desktop-designers-clarify-on-configurability/

Unity "about:config" no funciona en Ubuntu 11.10 Oneiric Ocelot

Personalización de Unity en Ubuntu 11.10; about:config no funciona

english version - all spanish posts

Unity debido probablemente a la política mal entendida de "zero-config" de Ubuntu no se puede modificar y personalizar por defecto.

Teóricamente pulsando alt-F2 y escribiendo en el lanzador "about:config" debería lanzarse la utilidad de configuración de Unity... pero aunque aparece el icono de la utilidad de configuración, al hacer click sobre este no pasa nada. Ni un aviso indicando que la utilidad de configuración no se puede ejecutar. ¡Sí, parece mentira! pero la herramienta de configuración no está instalada por defecto.

Para que funcione hay que instalar CCSM (compiz config settings manager):

apt-get install compizconfig-settings-manager

Una vez instalado funcionará "about:config". Es bastante triste que no permitan que el usuario realice modificaciones mínimas en su escritorio, pero lo es mucho más que ni siquiera cuando se ejecuta "about:config" aparezca un aviso indicando que para que funcione hay que instalar CCSM.

Para ver las pocas (realmente pocas) opciones de configuración que permite CCSM os recomiendo ver el siguiente enlace aunque una vez hayáis abierto la utilidad veréis que tampoco hay mucho que personalizar:

http://askubuntu.com/questions/29553/how-can-i-configure-unity

De cualquier modo parece que las cosas cambiarán en un futuro próximo:

http://www.omgubuntu.co.uk/2011/11/ubuntu-desktop-designers-clarify-on-configurability/

Monday, 17 October 2011

Deshabilitar la cuenta de invitado en Ubuntu 11.10 (Oneiric Ocelot)

english version - all spanish posts

¿cómo quitar el acceso de invitado en ubuntu 11.10?
Ubuntu a partir de la versión 11.10 (Oneiric Ocelot) usa como display manager por defecto lightDM. Es bastante más atractivo que el viejo GDM pero incorpora "de serie" una sesión de invitado sin ningún tipo de restricción por contraseña. Es una decisión de los desarrolladores de Ubuntu cuanto menos cuestionable (¿cúal es su utilidad? ¿no se preocupan por la seguridad? ¿se están pasando con la facilidad de uso? ...). En fin. Para deshabilitar el login del invitado podemos ecitar el fichero de configuración de lightgdm que se encuentra en /etc/lightdm/lightdm.conf. bastará con añadir la opción allow-guest=false. Tras el cambio el fichero de configuración debería parecerse a esto:
~$ cat /etc/lightdm/lightdm.conf

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
allow-guest=false
Para aplicar el cambio reiniciamos el demonio lightgdm:
sudo restart lightdm
Eso es todo. Podéis acceder a una descripción detallada de muchos (sino todos) de los parámetros que admite el fichero de configuración de lightdm (lightdm.conf) en los directorios de documentación en /usr/share/doc/lightdm/lightdm.conf. Pongo una copia aquí del fichero para facilitar su consulta:
#
# General configuration
#
# start-default-seat = True to always start one seat if none are defined in the configuration
# greeter-user = User to run greeter as
# minimum-display-number = Minimum display number to use for X servers
# minimum-vt = First VT to run displays on
# user-authority-in-system-dir = True if session authority should be in the system location
# guest-account-script = Script to be run to setup guest account
# log-directory = Directory to log information to
# run-directory = Directory to put running state in
# cache-directory = Directory to cache to
# xsessions-directory = Directory to find X sessions
# xgreeters-directory = Directory to find X greeters
#
[LightDM]
#start-default-seat=true
#greeter-user=lightdm
#minimum-display-number=0
#minimum-vt=7
#user-authority-in-system-dir=false
#guest-account-script=guest-account
#log-directory=/var/log/lightdm
#run-directory=/var/run/lightdm
#cache-directory=/var/cache/lightdm
#xsessions-directory=/usr/share/xsessions
#xgreeters-directory=/usr/share/xgreeters

#
# Seat defaults
#
# xserver-command = X server command to run
# xserver-layout = Layout to pass to X server
# xserver-config = Config file to pass to X server
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
# xdmcp-port = XDMCP UDP/IP port to communicate on
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
# greeter-session = Session to load for greeter
# greeter-hide-users = True to hide the user list
# user-session = Session to load for users
# allow-guest = True if guest login is allowed
# guest-session = Session to load for guests (overrides user-session)
# session-wrapper = Wrapper script to run session with
# display-setup-script = Script to run when starting a greeter session (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)
# autologin-guest = True to log in as guest by default
# autologin-user = User to log in with by default (overrides autologin-guest)
# autologin-user-timeout = Number of seconds to wait before loading default user
# autologin-session = Session to load for automatic login (overrides user-session)
# exit-on-failure = True if the daemon should exit if this seat fails
#
[SeatDefaults]
#xserver-command=X
#xserver-layout=
#xserver-config=
#xserver-allow-tcp=false
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
#greeter-session=example-gtk-gnome
#greeter-hide-users=false
#user-session=default
#allow-guest=true
#guest-session=UNIMPLEMENTED
#session-wrapper=lightdm-session
#display-setup-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=
#autologin-user-timeout=0
#autologin-session=UNIMPLEMENTED
#exit-on-failure=false

#
# Seat configuration
#
# Each seat must start with "Seat:".
# Uses settings from [SeatDefaults], any of these can be overriden by setting them in this section.
#
#[Seat:0]

#
# XDMCP Server configuration
#
# enabled = True if XDMCP connections should be allowed
# port = UDP/IP port to listen for connections on
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
#
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn.  Alternatively
# it can be a word and the first 7 characters are used as the key.
#
[XDMCPServer]
#enabled=false
#port=177
#key=

#
# VNC Server configuration
#
# enabled = True if VNC connections should be allowed
# port = TCP/IP port to listen for connections on
#
[VNCServer]
#enabled=false
#port=5900

Sunday, 16 October 2011

Disable guest session in Ubuntu 11.10 (oneiric ocelot)

spanish version - all english posts

How to disable the guest account in Ubuntu 11.10?
Ubuntu 11.10 uses lightDM as the default display manager. Certainly it looks cooler than the old GDM, but by default it comes (in the ubuntu package) with a guest session enabled which is at least an arguable decision from many points of view (utility, security, etc). To disable that guest login account option edit the lightdm's config file /etc/lightdm/lightdm.conf and put on it the parameter allow-guest=false. After that the configuration file should look like:
~$ cat /etc/lightdm/lightdm.conf

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
allow-guest=false
To achieve the changes restart the lightdm daemon:
sudo restart lightdm
That's it. You have a detailed description of all (many) the options that can be used in the configuration file lightdm.conf at /usr/share/doc/lightdm/lightdm.conf. Let me copy it here to make easier for you to consult them:
#
# General configuration
#
# start-default-seat = True to always start one seat if none are defined in the configuration
# greeter-user = User to run greeter as
# minimum-display-number = Minimum display number to use for X servers
# minimum-vt = First VT to run displays on
# user-authority-in-system-dir = True if session authority should be in the system location
# guest-account-script = Script to be run to setup guest account
# log-directory = Directory to log information to
# run-directory = Directory to put running state in
# cache-directory = Directory to cache to
# xsessions-directory = Directory to find X sessions
# xgreeters-directory = Directory to find X greeters
#
[LightDM]
#start-default-seat=true
#greeter-user=lightdm
#minimum-display-number=0
#minimum-vt=7
#user-authority-in-system-dir=false
#guest-account-script=guest-account
#log-directory=/var/log/lightdm
#run-directory=/var/run/lightdm
#cache-directory=/var/cache/lightdm
#xsessions-directory=/usr/share/xsessions
#xgreeters-directory=/usr/share/xgreeters

#
# Seat defaults
#
# xserver-command = X server command to run
# xserver-layout = Layout to pass to X server
# xserver-config = Config file to pass to X server
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
# xdmcp-port = XDMCP UDP/IP port to communicate on
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
# greeter-session = Session to load for greeter
# greeter-hide-users = True to hide the user list
# user-session = Session to load for users
# allow-guest = True if guest login is allowed
# guest-session = Session to load for guests (overrides user-session)
# session-wrapper = Wrapper script to run session with
# display-setup-script = Script to run when starting a greeter session (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)
# autologin-guest = True to log in as guest by default
# autologin-user = User to log in with by default (overrides autologin-guest)
# autologin-user-timeout = Number of seconds to wait before loading default user
# autologin-session = Session to load for automatic login (overrides user-session)
# exit-on-failure = True if the daemon should exit if this seat fails
#
[SeatDefaults]
#xserver-command=X
#xserver-layout=
#xserver-config=
#xserver-allow-tcp=false
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
#greeter-session=example-gtk-gnome
#greeter-hide-users=false
#user-session=default
#allow-guest=true
#guest-session=UNIMPLEMENTED
#session-wrapper=lightdm-session
#display-setup-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=
#autologin-user-timeout=0
#autologin-session=UNIMPLEMENTED
#exit-on-failure=false

#
# Seat configuration
#
# Each seat must start with "Seat:".
# Uses settings from [SeatDefaults], any of these can be overriden by setting them in this section.
#
#[Seat:0]

#
# XDMCP Server configuration
#
# enabled = True if XDMCP connections should be allowed
# port = UDP/IP port to listen for connections on
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
#
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn.  Alternatively
# it can be a word and the first 7 characters are used as the key.
#
[XDMCPServer]
#enabled=false
#port=177
#key=

#
# VNC Server configuration
#
# enabled = True if VNC connections should be allowed
# port = TCP/IP port to listen for connections on
#
[VNCServer]
#enabled=false
#port=5900

Wednesday, 12 October 2011

I sign it too!

X11 - No words :-)
This applies to almost every aspect of GNU/Linux nowadays

Sunday, 17 April 2011

Set UUID on reiserfs partitions (fun with bash)

spanish version - all english posts

I've just realized that the reiserfs partitions of an old PC are not associated with their corresponding UUID in /etc/fstab. I usually use UUIDs in fstab to avoid problems when adding/removing disks.

This particular PC has several partitions with reiserfs filesystem. Many years ago I preferentially used reiserfs instead of ext2 for obvious reasons. With the advent of ext3 I stopped using the reiser filesystem on new installations. But my old PCs remained with reiserfs. That happened (and remained) over the time with non-system partitions (home, chroot, etc...)

Out of curiosity I've tried to find out how old these partitions are, but I have not been able (perhaps a seasoned forensic guru can help me ... debugreiserfs does not show this information). The oldest files I can see have access dates of 2004 but I'm sure the partitions are much older .... enough rambling!

Turning back to the UUID issue. The reiser partitions are not associated with a corresponding UUID:

root@oldandbeloveddesktop:~# debugreiserfs /dev/sda7 | grep UUID
debugreiserfs 3.6.21 (2009 www.namesys.com)

UUID: 00000000-0000-0000-0000-000000000000
root@oldandbeloveddesktop:~# blkid /dev/sda7
/dev/sda7: TYPE="reiserfs"

So we'll have to generate the UUIDs and assign them to their corresponding reiserfs partitions.

The fun part: We will do it in a single command:

root@oldandbeloveddesktop:~# mount -t reiserfs | while read part; do umount ${part%% *}; reiserfstune --uuid $(uuidgen -r) ${part%% *}; mount ${part%% *} ; done

That's it, we have assigned an UUID to each reiserfs partition. We can verify it using blkid:

root@oldandbeloveddesktop:~# blkid | grep reiserfs
/dev/sda7: TYPE="reiserfs" UUID="3cfa0f14-c35b-49fc-82a8-ff3e6e225af8"
/dev/sda10: TYPE="reiserfs" UUID="76255e20-92b1-4352-a604-6b371eb5ace0"
/dev/sda11: TYPE="reiserfs" UUID="06c74789-d403-408a-898f-b8e8880d3d3a"

We can now edit their corresponding fstab entries. It's the turn for sed and some more fun. Just run:

root@oldandbeloveddesktop:/etc# for part in $(mount -t reiserfs); do sed -i "/^\/dev.*reiser/ s@^${part%% }@#original ${part%% }\n$(blkid ${part%% }|awk '{print $NF}') @" /etc/fstab; done
root@oldandbeloveddesktop:/etc# mount -a -o remount

And that's all folks!

As this post is getting very short, lets fill it with a step by step explanation of the process.

The first command that helped us to assign a UUID to each partition reiserfs is summarized in the following steps.

  1. using "mount -t reiserfs" we get the list of the reiserfs partitions in use.

  2. the output will be passed to "bash's while" which will iterate each line of output assinging each outputed line to the "part" variable.

  3. Using bash parameter expansion we take only the partition device, which graphically can be reperesented as:

    root@oldandbeloveddesktop:~# part="/dev/sda7 /home reiserfs defaults 0 2"
    root@oldandbeloveddesktop:~# echo ${part%% *}
    /dev/sda7
    
  4. for each partition:

    4.1) unmount the partition with "umount"

    4.2) generate a random uuid with uuidgen:

    uuidgen -r
    

    4.3) and assign it to the partition using reiserfstune command.

    4.4) remount the partition.

The second command, which edits "/etc/fstab" entries replacing each /dev/sdXY string with its corresponding UUID, is detailed in the following steps:

  1. as the first command we use "mount -t reiserfs" to get the list of reiserfs partitions (mounted) in the system.

  2. as before, we pass each line from the output to ''$part'' using bash's "while". Remember that ''${part%% *}'' will correspond to each of the partitions in the format '/dev/sdXY'.

  3. For each reiserfs partition we execute sed infile editin the /etc/fstab file. The sed command can be divided into:

    3.1) a first part where you select only the lines of the reiserfs partitions. Those with the format:

    /dev/...............reiser............
    

    3.2) on the previous selection sed will just edit the field "/dev/sdXY". 3.3) and sed will replace it with two lines: a comment header (just to remember which was the original partition's name), and the corresponding fstab's entry with the UUID.

    3.3.1) I get the UUID value with "blkid" keeping just the UUID value, which corresponds to the last field in the output if we divide it into spaces (awk NF). For example if you originally had lines with the format:

        /dev/sda10 /chroot reiserfs defaults 0 2
    
    they will be replaced with::
        #original /dev/sda10
        UUID="76255e20-92b1-4352-a604-6b371eb5ace0"  /chroot reiserfs defaults 0 2
    

Well, that's all. The objective has been achieved: We have assigned a UUID for each of the reiserfs partitions, and we have had some fun time playing with the shell.

Establecer el UUID a particiones reiserfs. Jugando con bash

english version - all spanish posts

Acabo de darme cuenta que en un viejo PC las particiones en el fstab no están asociadas al correspondiente UUID. Normalmente suelo asociarlas ya que así evito cualquier problema al añadir/quitar discos.

Este PC en concreto tiene la mayoría de las particiones de los usuarios (distintos /home/XXXX) con reiserfs. Hace muchos años usaba reiserfs de manera preferente a ext2 por razones obvias. Con la llegada de ext3 dejé de usar el sistema de ficheros reiser.

Por curiosidad he tratado de averiguar la antigüedad de estas particiones pero no he sido capaz (quizá algún avezado forense me pueda ayudar... debugreiserfs no muestra esa información). Los ficheros mas antiguos tiene fechas de acceso del 2004 pero estoy seguro que las particiones son anteriores....

Volviendo al tema del UUID. Las particiones reiser no llevan asociado el UUID:

root@oldandbeloveddesktop:~# debugreiserfs /dev/sda7 | grep UUID
debugreiserfs 3.6.21 (2009 www.namesys.com)

UUID: 00000000-0000-0000-0000-000000000000
root@oldandbeloveddesktop:~# blkid /dev/sda7
/dev/sda7: TYPE="reiserfs"

Por lo que habrá que generar el UUID y asignárselo a las particiones reiserfs. Lo haremos en un solo comando:

root@oldandbeloveddesktop:~# mount -t reiserfs | while read part; do umount ${part%% *}; reiserfstune --uuid $(uuidgen -r) ${part%% *}; mount ${part%% *} ; done

Eso es todo, ya hemos asignado un uuid a cada una de las particiones reiserfs. Podemos verificarlo mediante blkid:

root@oldandbeloveddesktop:~# blkid | grep reiserfs
/dev/sda7: TYPE="reiserfs" UUID="3cfa0f14-c35b-49fc-82a8-ff3e6e225af8"
/dev/sda10: TYPE="reiserfs" UUID="76255e20-92b1-4352-a604-6b371eb5ace0"
/dev/sda11: TYPE="reiserfs" UUID="06c74789-d403-408a-898f-b8e8880d3d3a"

Como colofón podemos editar el fstab mediante sed para reemplazar las entradas tipo /dev/sdXY por su correspondiente UUID. Bastará ejecutar:

root@oldandbeloveddesktop:/etc# for part in $(mount -t reiserfs); do sed -i "/^\/dev.*reiser/ s@^${part%% }@#original ${part%% }\n$(blkid ${part%% }|awk '{print $NF}') @" /etc/fstab; done
root@oldandbeloveddesktop:/etc# mount -a -o remount

Y esto es todo amigos!

Como el post se me ha quedado muy corto voy a explicar de manera detallada el proceso.

El primer comando que nos servía para asignar un UUID a cada partición reiserfs se resume en los siguientes pasos.

  1. mediante mount -t reiserfs listamos las particiones reiserfs

  2. el output se lo pasamos al "while" de bash quien iterará cada línea de la salida del anterior comando asignándosela a la variable "part".

  3. Mediante la expansión de parámetros de bash obtenemos sólo el dispositivo de la partición; o lo que gráficamente es:

    root@oldandbeloveddesktop:~# part="/dev/sda7 /home reiserfs defaults 0 2"
    root@oldandbeloveddesktop:~# echo ${part%% *}
    /dev/sda7
    
  4. para cada una de las particiones:

    4.1) desmontamos la partición mediante umount

    4.2) obtenemos un uuid aleatorio con uuidgen:

    uuidgen -r
    

    4.3) y se lo asignamos con reiserfstune.

    4.4) volvemos a montar la partición.

El segundo comando, que edita el fichero /etc/fstab reemplazando las entradas tipo /dev/sdXY por su correspondiente UUID, se detalla en los siguientes pasos:

  1. como en el primer comando usamos "mount -t reiserfs" para obtener el listado de las particiones reiserfs que tenemos (montadas) en el sistema.

  2. al igual que antes el output se lo pasamos a while asignando a $part cada línea. Recordemos que ''${part %% *}'' corresponderá a cada uno de las particiones en el formato '/dev/sdXY'.

  3. Para cada partición reiserfs ejecutaremos sed sobre /etc/fstab. El comando sed se divide en:

    3.1) una primera parte en la que seleccionamos las líneas de las particiones reiserfs, es decir con formato:

    /dev/...............reiser............
    

    3.2) sobre la selección anterior editaremos el campo /dev/sdXY 3.3) y lo reemplazaremos por un header que recuerde cual era el nombre original y la entrada fstab con el correspondiente UUID.

    3.3.1) el UUID lo obtendremos con blkid quedándonos únicamente con el valor UUID="foo" que corresponde al último campo del output si lo dividimos en espacios (awk). Por ejemplo si originalmente la línea correspondía a:

        /dev/sda10 /chroot reiserfs defaults 0 2
    
    quedará como:
        #original /dev/sda10
        UUID="76255e20-92b1-4352-a604-6b371eb5ace0"  /chroot reiserfs defaults 0 2
    

Ahora, si, esto es todo. El objetivo ha sido conseguido. Hemos asignado un UUID a cada partición reiserfs y nos hemos divertido un rato con la shell.