Libre Things

CV Diaspora
fr

Tag - Ubuntu

Entries feed - Comments feed

Tuesday 30 November 2010

Clementine: a good music player

I discovered Clementine some time ago.

There is not any package for Ubuntu or Debian, but the official site gives you a .deb for your favorite Ubuntu version. And you'll also find Mac OS X and Windows versions...

A small click on the good .deb file for your Ubuntu distro and it should install.

I tested tons of players (Amarok, Rythmbox, old XMMS, Exaile, Listen, Totem...).

Clementine is based on Amarok, it's far simpler and integrates very well in Gnome desktop using Qt4 librairies.

I'm happy to know this software and I recommend it to you.

Tuesday 21 September 2010

Amarok problem under Ubuntu Lucid

If Amarok doesn't work on Ubuntu Lucid. Playing any song fails.

Simple solution: install apt://libxine1-ffmpeg

sudo aptitude install libxine1-ffmpeg

Possibly restart Amarok.

Source :

Monday 5 July 2010

Change NetHack tiles (xnethack)

NetHack: one of the best games ever.

I find xnethack default tileset rather ugly. Under Debian/Ubuntu (nethack-x11 package), the tileset file must be in XPM format. It's configuration is in the /etc/X11/app-defaults/NetHack file with the default xpm: /usr/share/pixmaps/nethack/x11tiles.

The file must be in XPM format, with a limited size and different color number, otherwise Nethack loading time explodes (several minutes).

Here is how to change it on Debian / Ubuntu:

  1. Example: on http://www.multifoliate.com/nh/, get the chozo32b.zip file (link: NetHack 3.4.2 (32x32) (modified by me)). Extract it to get chozo32b.bmp.
  2. Open it with Gimp, cut it to 1280x864 (to delete the black at the bottom). You can then convert it to 256 colors, then save it as XPM. It works but it's ugly.
  3. To get a better result, save it to PNG.
  4. Install imagemagick package, then convert -depth 5 chozo32b.png chozo5.png
  5. Open chozo5.png with Gimp. Then save it to XPM format.
  6. Edit /etc/X11/app-defaults/NetHack and replace /usr/share/pixmaps/nethack/x11tiles with the path to chozo5.xpm.
  7. Then, reload X ressources: xrdb -merge /etc/X11/app-defaults/NetHack
  8. Start your favorite game: xnethack

The final gzipped file: chozo5.xpm.gz

Notes:

  • convert always saves xpms in 256 colors. I don't know why.
  • head image.xpm gives you the first lines of the XPM file, with number of different colors.
  • Abigada tileset is by default in NetHack iPhone version.

Links:

Sunday 20 June 2010

Windows XP broken after Ubuntu Lucid upgrade

A friend of mine has a PC with Windows XP / Ubuntu in dual boot. After the Lucid upgrade, Windox fails to boot (strange lines on the screen after Grub...).

TestDisk saved us:

sudo aptitude install testdisk
sudo testdisk
  1. Choose [ Create ] Create a new log file
  2. Choose windows physical disk, then [Proceed ]
  3. Choose [ Continue ] Continue even if there are hidden data
  4. Choose [Intel ] Intel/PC partition
  5. [ Advanced ] Filesystem Utils
  6. On Windows XP partition, boot sector is generally bad or non identical to backup sector (Sectors are not identical.).
  7. Choose [ Backup BS ] to copy the backup sector to the master sector.
  8. After that, quit, reboot and test.

Sources:

Thursday 3 June 2010

3D performance problems with KMS

With the last Ubuntu Lucid 10.04 come a new graphical module: KMS or Kernel-based Mode-Setting.

If you have performance problems in some games like Quake 3 or TCE / Enemy Territory, try to disable KMS. The problem can also be with the mouse pointer (slowness, lag, delay or inacuracy).

Grub 2

Add nomodeset in /etc/default/grub then issue the command update-grub.

vi /etc/default/grub
GRUB_CMDLINE_LINUX="nomodeset"
update-grub

Grub 1

Add nomodeset at the end of the # kopt line, then issue command update-grub.

vi /boot/grub/menu.lst
# kopt=root=/dev/sda1 ro nomodeset
update-grub

Someone also told me that disabling KMS solved his Firefox javascript speed problem in Yahoo Mail.

Thursday 20 May 2010

Brasero Bug Copying Audio CD in Ubuntu Lucid

Audio CD copy is actually not possible with Brasero on Ubuntu Lucid. All details in the bug report.

As a workaround, you must install cdrdao version 1.2.3, which is not yet available as a package.

To install it, you can use CheckInstall which is a bit cleaner than the old make install:

tar -xjvf cdrdao-1.2.3.tar.bz2
cd cdrdao-1.2.3/
./configure
make
sudo checkinstall make install

Note: the make command can fail because of missing dev packages you'll have to install.

CheckInstall builds and installs a nice Debian package.

You can also use cdrdao directly. ps axf shows us the command Brasero is using:

cdrdao read-cd --device /dev/sr0 --read-raw --datafile /home/dooblem/brasero.toc.bin -v 2 /home/dooblem/brasero.toc

Here we go!

Links :

Audio CD Backup/Archive

It's not possible to backup an audio CD as an iso image. This format is for data CDs.

You should use cdrdao.

Example:

cdrdao read-cd --read-raw --datafile FILE_NAME.bin --device /dev/cdrom --driver generic-mmc-raw FILE_NAME.toc

Under Ubuntu, you can use Brasero with "CD copy" mode. ps axf shows us the command Brasero is using:

cdrdao read-cd --device /dev/sr0 --read-raw --datafile /home/dooblem/brasero.toc.bin -v 2 /home/dooblem/brasero.toc

Note: there is a Brasero Bug in Ubuntu Lucid with cdrdao.

Links:

Tuesday 26 January 2010

Launch Nautilus as a super user

Under Ubuntu, or any distribution using Gnome, you can do almost anything without using the command line.

To configure some things, you still have to edit a configuration file. To configure your desktop, a lot of online documentation still requires you to to edit /etc config files.

To help non linux experts, you can try the nautilus-gksu package. It permits you to edit any file as administrator with a simple right-click on the file.

Personnaly, I prefer launching Nautilus as root, as it allows more than simple file edition power (permission change, deleting...).

I create a launcher for this task, a bit like the Administrator Terminal in Applications > System Tools:

  1. Right-click on the panel > Add to panel, Custom Application Launcher.
  2. Name: Nautilus superuser
  3. Command: gksu nautilus

Et voila.

Configure user directories (Download, Documents, Images, Music, Vidéos)

In some modern distributions like Ubuntu, there are preconfigured user directories like Desktop, Download, Documents, Images, Music, Vidéos.

ubuntu_user_dirs.png

You can remove some of the directories you don't use, or rename some of them.

If you change their name, you can set their new place in your ~/.config/user-dirs.dirs file:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Bureau"
XDG_DOWNLOAD_DIR="$HOME/telech"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/public"
XDG_DOCUMENTS_DIR="$HOME/docs"
XDG_MUSIC_DIR="$HOME/zic"
XDG_PICTURES_DIR="$HOME/images"
XDG_VIDEOS_DIR="$HOME/cine"

Then restarting Nautilus should be sufficient. Otherwise restart your Gnome session.

References:

Sunday 10 January 2010

[Ubuntu Karmic] Disable USplash

When Ubuntu starts, the USplash screen hides you the Linux boot and commands. If you're a geek spirit, you'll prefer those "cabalistic writings". Here is how to disable USplash without removing the usplash and usplash-theme-ubuntu packages (because package ubuntu-desktop depends on them).

usplash_karmic.png

Disable USplash, then rebuild initramfs:

sudo vi /usr/share/initramfs-tools/conf-hooks.d/usplash
USPLASH=n
sudo update-initramfs -u

Links:

See also:

[Ubuntu Karmic] Disable XSplash

XSplash is new in Ubuntu Karmic. If you don't like this ugly screen like me, here is how to disable it.

xsplash_karmic.png

The dpkg -l | grep xsplash command tells you that two package are responsible for this horrible screen: xsplash and ubuntu-xsplash-artwork. To remove them, you also have to remove the ubuntu-desktop package. That is not recommended if you don't want to miss something in the next Ubuntu upgrade.

Here it is:

sudo rm /etc/dbus-1/system.d/xsplash.conf
sudo touch /etc/dbus-1/system.d/xsplash.conf

We remove the file and create an empty one. Why ? Because if we just delete the file it will be created back again during the next update. If you create an empty file in place, the next update will ask you what to do with the file.

Et voila, restart and enjoy the "visual peace".

Link:

See also:

Sunday 3 January 2010

Thinkpad fingerprint reader under Ubuntu Karmic

Here is how to configure easily your Thinkpad fingerprint reader under Ubuntu Karmic, using ThinkFinger.

Install the thinkfinger-tools (for acquiring/verifying) and libpam-thinkfinger (for PAM integration):

sudo aptitude install thinkfinger-tools libpam-thinkfinger

Then you can test acquisition/verification. As a user, issue the commands:

tf-tool --acquire
# swipe 3 times your finger
tf-tool --verify
# swipe your finger, then another finger...

Note: tf-tools should work without being root if the user belongs to the plugdev group.

Then plug the reader to PAM as explained in /usr/share/doc/libpam-thinkfinger/README.Debian:

sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable

Now restart your system and try swiping your finger in place of typing the password. A "Password or swipe finger:" prompt displays to authenticate you at GDM login and when you type "sudo".

Notes:

  • Test several programs in the Administration menu. "swipe finger" is not always showed but should work though.
  • To my knowing, it doesn't work when locking screen (gnome-screensaver).

References :

Monday 14 December 2009

Display Ubuntu boot commands

By default, Ubuntu starts with splash screen in quiet mode without displaying startup actions.

Before Ubuntu Karmic (legacy Grub), you have to edit /boot/grub/menu.lst to remove the quiet words.

Since Ubuntu Karmic (new Grub):

sudo vi /etc/default/grub
# remove "quiet"
sudo update-grub

Link:

See also:

[Ubuntu Karmic] Autostart Empathy

To start Empathy automatically at Ubuntu Karmic startup :

sudo cp /usr/share/applications/empathy.desktop /etc/xdg/autostart/

This automatically adds a new entry in Gnome startup applications.

Sources :

Thursday 10 December 2009

No keyring lock at hibernation

Under Ubuntu, the keyring is automatically locked by default while hibernating. When starting Ubuntu after hibernation, it prompts you for the keyring password.

To disable this lock:

  1. Go in Applications > System Tools > Configuration Editor
  2. Uncheck /apps/gnome-power-manager/lock/gnome_keyring_hibernate

Note: you can also launch the config editor with the gconf-editor command.

Reference:

  • A "lock" search in the configuration editor.

Gnome autologin and unlocking the keyring with a password

When you have enabled automatic login under Gnome/Ubuntu, the window asking your password to unlock the keyring at startup is very annoying ! Network-manager needs it to be able to use the Wifi keys.

If your keyring password is the same as your login password, the keyring is unlocked automatically when you type in your password to log in. This is not possible with autologin.

A solution is to put an empty keyring password. This is bad for security of all your passwords.

The best solution would be to store the wifi keys in the default keyring, and to store all the other passwords in another keyring. Maybe I didn't check correctly, but from what I seen most applications only use the default keyring.

Average solution: put a "foo" password to the default keyring, unlocked at Gnome startup by a script. This is better than an empty password.

Here is my solution:

We change the default keyring password:

  1. Go in Applications > Accessories > Passwords and encryption keys (don't loose 2 hours like me looking for it in System > Preferences, where it should be)
  2. Right click on the default keyring > Change password

We then create the python script with the following code:

vi ~/.lordiam.py
#!/usr/bin/python
import gnomekeyring
#gnomekeyring.lock_sync(None);
gnomekeyring.unlock_sync(None, 'mypassword');

We prevent other user from reading the file:

chmod 700 ~/.lordiam.py

We test it. Expect 0 as return code (the warning is normal):

~/.lordiam.py
echo $?

Now, we add the script at startup in System > Preferences > Startup Applications:

Command: /home/USER/.lordiam.py

Finally, we reboot the PC to test the whole thing.

Notes:

  • The fact that the script is called before network-manager start is a chance. I didn't found how to put a priority on it in the Gnome startup programs.
  • What is the 'login' keyring for ? From what I understand, it is for storing passwords which will be forgotten at session end.
  • For the script, we choose a common name, less remarkable than unlock_keyring.py. We also put the script as hidden file. It is better than nothing.

References:

  • apt-get source libpam-gnome-keyring
  • apt-get source python-gnomekeyring

Wednesday 2 December 2009

USwSusp under Ubuntu Karmic

Userspace Software Suspend is an alternative to the default hibernation method in the Linux kernel. It adds several interesting features like compression, encryption... Compression allows for hibernation with a smaller Swap partition. It also decreases the wake up time of your system!

Here is how to install USwSusp on Ubuntu Karmic. Should also work with a recent Debian.

Install the uswsusp package:

aptitude install uswsusp

You can now hibernate with the s2disk command as root.

To hibernate from Ubuntu menu or by key shortcut, then change the following line in the /etc/pm/config.d/00sleep_module file:

SLEEP_MODULE=uswsusp

And test your hibernation!!

Links: