Mostrando entradas con la etiqueta ubuntu. Mostrar todas las entradas
Mostrando entradas con la etiqueta ubuntu. Mostrar todas las entradas

jueves, 12 de enero de 2017

Add custom resolution to xrandr

Sometimes xrandr does not show one of the resolutions that is accepted by both the graphic card and the connected screen. If that is the case, it is still possible to add manually the required resolutions by using the following steps:

First we need to calculate the VESA Coordinated Video Timing modes for the required resolution. For example, for a monitor 1680x1050 and 60Hz
cvt 1680 1050 60
This will output the following
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
Now we add the specified CVT to xrandr. Using the previous example
sudo xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
This will create a Virtual screen in xrandr. Now it is possible to add this resolution to any of the screens listen in xrandr. For example to add this resolution to VGA1
sudo xrandr --addmode VGA1 1680x1050_60.00
Finally, to assign this resolution to the screen VGA1 we can run
xrandr --output VGA1 --mode 1680x1050_60.00
source : http://askubuntu.com/questions/377937/how-to-set-a-custom-resolution

jueves, 17 de marzo de 2016

SSD usage in Linux

This are some essential points to consider if you want to use an SSD hard drive in a Linux system.


1. Get enough RAM
2. Avoid using SWAP

If you want to use the option of hibernating, then set the swapines to zero. But try to avoid hibernation.

echo -e "vm.swappiness=0" | sudo tee -a /etc/sysctl.conf

3. Disable acces time logging

in your /etc/fstab file add the option "noatime" in every partition of your SSD drive. For example, change every “errors=remount-ro” to “noatime,errors=remount-ro”

4. Run fstrim every day

It will prevent your SSD from slowing down. You can use cron to run this program automatically in the background every day.

echo -e "#\x21/bin/sh\\nfstrim -v /" | sudo tee /etc/cron.daily/trim
sudo chmod +x /etc/cron.daily/trim

5. Monitor your SSD using S.M.A.R.T.

Check once in a while that the Media_Wearout_Indicator value of your SSD is not lower than 10 (it starts with a value of 100).

sudo smartctl -data -A /dev/sda

source: https://www.leaseweb.com/labs/2013/07/5-crucial-optimizations-for-ssd-usage-in-ubuntu-linux/

martes, 2 de septiembre de 2014

Change aptitude upgrade folder

To change the default folder where temporal files are stored when doing an aptitude upgrade just create one folder /apt/partial in some specific place:

 mkdir -p /some/path/apt/partial 

And then modify or create the file /etc/apt/apt.conf and add this line:

 dir::cache::archives "/some/path/apt"; 

source : http://ostico.it/content/linux/aptitude/how-change-default-aptitude-download-directory

miércoles, 26 de febrero de 2014

ALT+TAB not switching windows

Ubuntu 12.04.4 LTS

if the key combination ALT+TAB does not switch windows it may be disable in Compiz.
In order to enable it again try these steps:

# Open CompizConfig setting manager
$ ccsm

Then go to the tab Window management
and check application switcher

miércoles, 26 de septiembre de 2012

Iconos del panel de gnome en movimiento

Ya me ha ocurrido varias veces que el panel superior de gnome; aun teniendo todos los iconos bloqueados; de vez en cuando me los desordenaba. Puede ser que fuera al cambiar la resolución de la pantalla, o al tener un monitor suplementario conectado al portatil.

Por lo que he visto buscando información, este problema fué solucionado en la ultima versión del panel, cuando este fue portado a GTK3, pero no se ha solucionado para las versiones antiguas. Así que he encontrado un script que hizo "bojo42", el qual bloquea el panel entero y lo desbloquea cuando queramos.

Lo suyo es guardar este script en algun lugar (por ejemplo en nuestro home "/home/USER/.gnome2_panel_block_down).
Darle permiso de ejecución.
Añadir en el panel de gnome un lanzador personalizado.
Poner como comando este mismo script.
Una vez hecho esto solo es cuestion de bloquear y desbloquear el panel con un simple click.



#!/bin/sh

### Config
NOTIFY=on #(on/off)
LOCK_TITLE="Panel Lock Down"
LOCK_MSG="Locking the GNOME panel"
UNLOCK_TITLE="Panel Lock Down"
UNLOCK_MSG="Unlocking the GNOME panel"
LOCK_ICON="/usr/share/icons/hicolor/48x48/apps/gdu-encrypted-lock.png"
UNLOCK_ICON="/usr/share/icons/hicolor/48x48/apps/gdu-encrypted-unlock.png"

### Dependency checking
if [ -z "$(which gconftool-2)" ]; then
 if [ -n "$(which gconftool-2)" ]; then
  zenity --warning --text "Error. No binary found for gconftool-2!" --title "Panel Lock Down"
 else
  echo "Panel Lock Down: Error. No binary found for gconftool-2!"
 fi
 exit 1
fi
if [ "$NOTIFY" = "on" ] && [ -z "$(which notify-send)" ]; then
 SCRIPT_LOCATION="$(pwd)/$(basename $0)"
 if [ -n "$(which zenity)" ]; then
  zenity --warning --text "Notifcations failed! Please install the libnotify-bin package or disable notifications in $SCRIPT_LOCATION" --title "Panel Lock Down"
 else
  echo "Panel Lock Down: Notifcations failed! Please install the libnotify-bin package or disable notifications in $SCRIPT_LOCATION"
 fi
 NOTIFY="off"
fi

### Main
if [ "$(gconftool-2 -g /apps/panel/global/locked_down)" = "true" ]; then
 [ "$NOTIFY" = "on" ] && notify-send -i $UNLOCK_ICON "$UNLOCK_TITLE" "$UNLOCK_MSG"
 gconftool-2 -s /apps/panel/global/locked_down --type=bool false
elif [ "$(gconftool-2 -g /apps/panel/global/locked_down)" = "false" ]; then
 [ "$NOTIFY" = "on" ] && notify-send -i $LOCK_ICON "$LOCK_TITLE" "$LOCK_MSG"
 gconftool-2 -s /apps/panel/global/locked_down --type=bool true
else
 if [ -n "$(which zenity)" ]; then
  zenity --warning --text "Error. Undefined state of global panel lock down!" --title "Panel Lock Down"
 else
  echo 'Panel Lock Down: Error. Undefined state of global panel lock down!'
 fi
 exit 1
fi



martes, 5 de junio de 2012

/lib64/libc.so.6: not found - Ubuntu 11.10


Cuando ejecutas matlab desde consola sale un mensaje como este

/usr/local/MATLAB/R2011a/bin/util/oscheck.sh: 605: /lib64/libc.so.6: not found

La solucion es la siguiente.

1. Verificar la instalacion de la libreria correspondiente
$ locate libc.so

/lib/i386-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6
/usr/lib/x86_64-linux-gnu/libc.so

2. Linkear la libreria real a la que necesita matlab

sudo ln -s /lib/x86_64-linux-gnu/libc.so.6 /lib64/libc.so.6

3. Correr matlab y voila!

Fuente: http://solucionesubuntu.blogspot.com/2011/10/lib64libcso6-not-found-ubun...