Archiv für den Monat: April 2012

Keep your software clock up-to-date with ntpd

Recently I noticed that my system clock tends to run a little fast up to the point where it is 7 to 10 minutes ahead of the actual time. (I now know that hardware clocks in common computers are not very good. If you want to know more click here)

After a little research I found out that I did not use internet time synchronization yet. So I guess the hardware clock on my notebook is not a very accurate device.

Thankfully, there is ntpd, the network time protocol daemon, which synchronizes the software clock of linux systems with available sources on the internet.

After the installation via pacman -S ntp, you first need to select a source for your time signal. Available sources are listed here. Put them into your /etc/ntp.conf file and you’re good to go.

Next stop the hwclock daemon and start ntpd.

sudo /etc/rc.d/hwclock stop
sudo /etc/rc.d/ntpd start

The daemon will then periodically update your system clock.

To start the daemon at boot, add it to your DAEMONS list in /etc/rc.conf and make sure, hwclock is blacklisted.

Resize images directly from nautilus

The more often we need to a certain task, the more direct access we want to have to it. We don’t want to click through 10 sub-menus to create a new folder (that’s why it is right in the context menu of nautilus). When web searches became more and more frequent, browser developers invented the search bar next to the address bar and with the usage of the address bar continuing to decrease the two have been merged in recent versions of most browsers.

I my opinion this „usage frequency/accessibility“ ratio is far too high in common linux distributions (and all windows installations I have worked with for that matter), when it comes to resizing an image. Say you want to share some of your vacation photos with your friends, firing up GIMP and resizing them all manually seems like the worst case, but it really does not get much better in a standard GNOME environment. (This is just from personal experience, if I’m wrong please leave a comment).

GIMP surely does the trick. Also it opens like 5 windows by default. WHY???

A quick terminal command that I have used for a long time is described here. It uses the convert tool from the ImageMagicK package (which is much more powerful than just a simple resizer). To resize an image you just need to run

convert image.jpg -resize 50%

To reduce to size of the image to 50%. You can also convert multiple images at a time, for more details on this click here! I any case, you still have to open a terminal, cd to the right folder and enter the command. As a user who generally uses a GUI (namely nautilus, GNOMEs default file browser) to browse files, this is still too much work.

I have finally found what I was looking for in nautilus-image-manipulator. (formerly nautilus-image-converter). It is a neat little nautilus extension written in python that plugs itself right into the context menu (i.e. the right click menu) in nautilus. Whenever you right click on an image file there is an entry „Resize image“ giving you this:

nautilus-image-manipulator gives you a couple of options on what to do with your images.

The rest is self explanatory, you can choose the exact size, or just give a percentage. Also you can replace the originals or store resized copies. The best thing is, that it works flawlessly with multiple images at the same time.

Arch users can build and install nautilus-image-manipulator from AUR. It has a couple of python specific dependencies, all of which are available through AUR or the pacman repositories.