search_for_updates 0.2

This is a small update to my search_for_updates script, which has been lying around. The script allows you to search for updates from Portage without resolving dependencies. Thus, it’s much faster than

emerge -pvu world

The new version lists the best version available for each package that can be updated using the --verbose flag. You can download the new version here: search_for_updates-0.2.

iproute2 Cheatsheet

The iproute2 package offers the ip utility, which is a modern replacement for tools such as ifconfig, route, arp, and more. It allows you to configure addresses, links, routes, and ARP tables. The only problem is that its documentation can be quite confusing. This post is intended to be a task-oriented guide to this utility. It’s far from complete, and I intend to update it from time to time.
Continue reading iproute2 Cheatsheet

Security Vulnerabilities in the Imagin Photo Gallery

Following a friend’s request, I did a short security review of the Imagin photo gallery a couple of weeks ago. I looked at the newest version, v3 beta5, but the vulnerabilities may also apply to older versions. So here they are, from least to most important in my opinion.
Continue reading Security Vulnerabilities in the Imagin Photo Gallery

WordPress Administration over SSL on Lighttpd

In this tutorial, we’ll walk through the steps of enabling SSL (https) for the WordPress admin panel when using Lighttpd as a web server. The tutorial consists of two stages: the first is enabling SSL at the Lighttpd level, and the second is at the WordPress level.


Continue reading WordPress Administration over SSL on Lighttpd

Kernel Configuration and nvidia-drivers

This is more of a note to myself, as I keep forgetting this. The proprietary NVIDIA drivers, provided by x11-drivers/nvidia-drivers, dislike alternatives. They will refuse to build against a kernel with rivafb (CONFIG_FB_RIVA) and nvidiafb (CONFIG_FB_NVIDIA) built in or built as modules. Both can be found (and unset) under:

Device Drivers
-> Graphics support
   -> nVidia Framebuffer Support
   -> nVidia Riva support

Eject Your Kindle and Reconnect under Linux

I am Your User suggested a method to eject your Kindle in Linux. While his method works, you don’t need to specify the partition number. For example:

$ sudo eject /dev/sdd

where /dev/sdd is the device file for the Kindle.

But what if you want to reconnect it without unplugging and replugging the USB cable? You can add the -t switch.

$ sudo eject -t /dev/sdd

Even though it prints the following error:

eject: CD-ROM tray close command failed: Input/output error

it works, and the Kindle reappears in KDE.

Django Backup Script

This is a backup script for Django projects. It’s able to automate backups of both the database and files to a local folder and a remote FTP server. It is somewhat old and has a few limitations, mainly supporting only MySQL and not supporting the new way of specifying databases introduced in Django 1.2.

It’s loosely based on my WordPress backup script and inspired the database settings auto-detection found in the newer WordPress backup script.

Usage is simple:

$ django_backup /path/to/my/proj
$ django_backup --db-only /path/to/my/proj

The latter command only backs up the database.

The script uses a few configuration variables at the top of the script to set the folder where the local backups are kept and the remote FTP server settings. The database settings are extracted directly from the settings.py of the backed-up project.
Continue reading Django Backup Script

Searching for Updates without emerge

The normal way to see which installed packages have available updates on Gentoo is to run

$ emerge -puv world

And then you usually select the packages you really want to update and emerge them. However, this workflow has several downsides:

  1. It’s slow. When Portage checks for updates this way, it fully resolves all the dependencies. This process is unnecessary, as in many cases you aren’t interested in updating all the packages, let alone their dependencies.
  2. It may fail. When Portage fails to resolve the dependencies, it will either complain or completely fail. If it complains, it isn’t really that bad, except for the time used to resolve the unmet dependencies. Sometimes it fails completely (usually when masking is involved) and won’t display any of the available packages, hence leaving the user in the dark (except for some dependency error message).
  3. It displays lots of output. Many times you aren’t interested in seeing the dependencies that will be updated if you emerge every package in the world file. It’s just confusing and distracts you from the interesting updates for packages in the world file.

The following script tries to work around these problems. It works by querying the Portage API for the best version available for each package in the world file. If that version isn’t installed, it reports that there are updates waiting for that package. The script runs faster than emerge -pvu world and only displays the packages from the world file. If you find a package that you want to upgrade, you can emerge it separately to see the required dependencies.

Continue reading Searching for Updates without emerge

Capturing Video and Converting to H.264 using ffmpeg

8-millimeter video tapes seem to be slowly fading into oblivion. In order to save old family videos recorded in this format, I’ve decided to digitize them.

After a quick try with vlc, I understood that it wasn’t the right tool for the task. It crashed with a cryptic error message every time I tried to encode H.264 video, and it seemed that it was best suited for real-time encoding. Doing real-time encoding is sub-optimal, as I can’t achieve high-quality encoding at a reasonable bit rate.

So I looked for another tool and recalled ffmpeg. While ffmpeg provided everything I was looking for – high-quality video encoding using H.264 and stability – it wasn’t an easy start. ffmpeg’s defaults are notoriously ill-chosen. After hours of going through man pages, I’ve managed to capture and convert video tapes into high-quality (encoded) digital video.

Basically, the process involved capturing the raw video into a temporary file and then performing a two-pass encoding using H.264.
Continue reading Capturing Video and Converting to H.264 using ffmpeg