2010-01-09 23:09

Under Arch Linux, your network cards are sometimes named differently between two reboot. Configuring your network connection is hard if you don’t know if you card will be called eth0 or eth1.

A file /etc/udev/rules.d/75-persistent-net-generator.rules.optional can be used to tell udev to generate persistent network rules.

It’s very simple:

mv /etc/udev/rules.d/75-persistent-net-generator.rules.optional /etc/udev/rules.d/75-persistent-net-generator.rules

Reboot your system. A /etc/udev/rules.d/70-persistent-net.rules file has been generated. Now you can disable the generator:

mv /etc/udev/rules.d/75-persistent-net-generator.rules /etc/udev/rules.d/75-persistent-net-generator.rules.optional

Link:

2010-01-09 23:09 · Tags: , ,
2010-01-06 23:41

Before doing anything: backup your sensible data!

To extend a partition and it’s filesystem, you have to:

  1. Extend the partition
  2. Extend the filesystem

To shrink a partition and it’s filesystem, you have to:

  1. Shrink the filesystem
  2. Shrink the partition

For an ext3 partition, simply use parted:

parted /dev/sdx
print
resize N

Parted doesn’t support ext4 (yet?). For an ext4 partition or if parted refuses to resize your ext3 partition (Error: File system has an incompatible feature enabled.), use resize2fs:

To extend:

cfdisk /dev/sdx
# delete the partition and create it again with the desired size
resize2fs /dev/sdxY

Without giving any size, resize2fs extends the filesystem to the partition’s size.

To shrink, it’s almost as simple:

# example if you want a 10G partition
# resize filesystem with a size smaller than the desired size
resize2fs /dev/sdxY 9G
cfdisk /dev/sdx
# delete the partition and create it again with the desired size
# (a little bigger than the filesystem!!)
# then launch resize2fs again
resize2fs /dev/sdxY

Doing so we get the good partition size without loosing any space.

Notes:

  • If your partition is over LVM, you can use the lvresize or lvextend or lvreduce commands to resize the partition, instead of deleting/creating the partition with cfdisk.
  • The method also works for other filesystems like NTFS. For NTFS, you will use the ntfsresize command, or parted if it works.

Links :

2010-01-06 23:41 · Tags: , , , , , , , ,
2010-01-03 21:28

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 :

2010-01-03 21:28 · Tags: , , , ,
2010-01-02 14:43

Looking for a simple and lightweight terminal, I found urxvt.

xvt and rxvt don’t support Unicode characters. You have to use urxvt :

aptitude install rxvt-unicode

Not that I find xterm too slow for my use. My “geek curiosity” took over. I don’t like terminal tabs but instead open plenty of different terminal windows. urxvt could certainly do the job.

Then you can customize urxvt using the ~/.Xdefaults file :

vi ~/.Xdefaults
Rxvt*scrollBar: False
Rxvt*background: black
Rxvt*foreground: white
Rxvt*geometry: 110x35

The geometry I use allow me to open 4 terminal windows in my screen.

Note: you can also put parameters in ~/.Xresources but you’ll have to restart X or use the xrdb -merge ~/.Xresources command to load parameters.

I also suggest you the use of a keyboard shortcut to start your terminals. In Gnome :

  1. Set your default terminal in System > Preferences > Prefered Applications
  2. Then in System > Preferences > Keyboard Shortcuts, set the Start Terminal entry. I use Alt+X.

References :

2010-01-02 14:43 · Tags: , , ,
2009-12-10 21:30

To disable a plugin in Dotclear 2.1.6 without the administration interface, it’s very simple. Just create an empty _disabled file in the plugin directory :

touch plugins/myplugin/_disabled

To enable it again? Just remove the file.

Reférence :

  • vi inc/core/class.dc.modules.php
2009-12-10 21:30 · Tags:
2009-12-10 21:09

Problem:

I want to create a server-www alias that connects me to the SSH server and change the directory to /var/www/ right after the connection.

There it is :

ssh -t server 'cd /var/www && $SHELL'

And for the alias, add this in your ~/.bashrc:

alias server-www="ssh -t server 'cd /var/www && $SHELL'"
server-www # test it !

References :

2009-12-10 21:09 · Tags: ,
2009-12-10 20:36

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.
2009-12-10 20:36 · Tags: , , , ,