====== Debian Tips ====== ===== Safely change a kernel boot option ===== When changing specific kernel boot option in grub, you might want to keep this even after a kernel upgrade (which rebuild the grub configuration). So you'll have to go to ''/boot/grub/menu.lst'' and find the ''kopt'' comment in this file : # kopt=root=/dev/sda1 ro This line specific what kernel options should be set by Debian when updating grub configuration. ===== Change default text editor ===== Run ''update-alternatives'' : # update-alternatives --config editors ===== Revert Debian upgrade ===== When upgrading, you might like to revert back to a specified moment in time. Reverting upgrade seems stupid, but ISO Certification ask to have a defined process for that. So here we are : Modify ''/etc/apt/sources.list'' and set (for 19 November 2007, here): deb http://snapshot.debian.net/archive/2007/11/19/debian stable main non-free contrib deb http://snapshot.debian.net/archive/2007/11/19/debian-security stable/updates main non-free contrib Then in ''/etc/apt/preferences'' : Package: * Pin: release a=stable Pin-Priority: 1001 And finally you just need to ''apt-get update && apt-get dist-upgrade'' ! See [[http://lists.debian.org/debian-user-french/2007/12/msg00529.html]] ===== Install Xvfb ===== [[wp>Xvfb|Xvfb]] is virtual X11 Server that works only in memory. time:/# aptitude install xvfb xdm Then edit ''/etc/X11/xdm/Xservers'' and change the line : :0 local /usr/bin/X vt7 -dpi 100 -nolisten tcp to :0 local /usr/bin/Xvfb -dpi 100 -screen 1024x768x16 Finally start XDM : /etc/init.d/xdm start This will create a virtual X server at the size defined by ''screen'' option. Useful when forwarding via SSH ! ===== Install Flash Player ===== To install Flash Player : Go to [[http://http.us.debian.org/debian/pool/contrib/f/flashplugin-nonfree/]], select the ''.deb'' corresponding to what you want and download : time:/# wget http://http.us.debian.org/debian/pool/contrib/f/flashplugin-nonfree/flashplugin-nonfree_9.0.115.0.1_i386.deb Then with ''dpkg'', install : time:/# dpkg -i flashplugin-nonfree_9.0.115.0.1_i386.deb ===== Stop kernel message on console ===== time:/# echo "0" > /proc/sys/kernel/printk ===== Convert filename encoding ===== If you have moved files from a system using ISO-8859-1 encoding to UTF-8, you might have filename looking like ''Norme_int�gration.pdf''. There's a good tool : ''convmv''. #aptitude install convmv Then just read the manual : [[http://www.j3e.de/linux/convmv/man/]] ===== Hibernate from Gnome menu reboot instead of shutdown ===== This was done on Debian **[[http://www.us.debian.org/releases/testing/|Lenny]]** On a //HP DC7800p//, I had problem with hibernation from Gnome menu (''System'' -> ''Shut Down ...'' -> ''Hibernate''). Indeed my computer rebooted instead of powering off, to correct this behavior I just created the file ''/etc/pm/config.d/shutdown'' with ''HIBERNATE_MODE=shutdown'' ! More info with ''man pm-hibernate''. ===== Dynamic MMap ran out of room ===== I had problem with ''aptitude''. When I did ''aptitude update'', I got something like "Dynamic MMap ran out of room". So here is the solution I used to correct : [[http://vdachev.net/blog/2006/11/13/apt-get-e-dynamic-mmap-ran-out-of-room/]]. The value given may be not enough, I needed to enlarge this value to make it works.