Category: Linux/*nix
Monday Mar 10, 2008Visual Basic (almost) on Linux
I've known about Gambas for a while now, but I neglected mentioning it on this blog. Recently this project made it back to the Debian repositories and I was really pleased to see how well it has matured into a full-fledged Visual Basic-like development environment for Linux.
Now, I know that a lot of developers scoff at Basic in general and Visual Basic in particular. But to be honest, it was my first real GUI programming experience on Windows and I was immediately hooked by its simplicity and power until I got into Visual C++ and such. Similarly Linux programming needn't be all about complex shell scripting and C programming. There are *plenty* of options for newbie programmers who just want to get an application developed as quickly and painlessly as possible.
Gambas is not a VB-clone but those who've used VB for any length of time will immediately feel at home with it. Though it has a long way to go, I was able to write a fairly decent GUI application within an hour (and that was slow by my standards). The best thing about it is that it has support for both QT (with or without KDE support) and GTK interfaces, so all you need to do is choose the library you want to use for your final executable and you're set. Besides it has a number of components which tap into the full power of libraries like libXML, ODBC, MySQL, PostgreSQL, OpenGL and so on.
So if you're looking for a simple RAD tool for Linux without having to learn a complex scripting or programming language, give Gambas a try.
Static image gallery generators
Do you have a bunch of images/photos in folders in your hard drive that you just want to quickly turn into an album of navigable web pages? And you don't want the hassle of installing a heavyweight PHP/MySQL driven gallery software on your web host simply to put these pictures online or waste time in individually uploading each image to a hosted service like Flickr or Photobucket? If so, this post is for you.
There are a large number of (extremely simple) command line tools in *nix that will do the job of processing folders of images, producing thumbnails and organizing them in a simple, easily navigable website. The output of these gallery generators can be customized using HTML templates, so if you're not satisfied with the default, basic layout of your gallery, you can easily modify the result. The best part is that such albums are completely platform independent and can be hosted on any web server, being nothing more than static HTML files with images in JPG/PNG/GIF format.
I found plenty of them in Debian's repository and I'll share a few of them here.
- BINS - Seems an interesting option for those interested in multiple albums within a single website.
- galrey - I couldn't find a website for this tool, but the package is available in the Debian repositories.
- Photon - Another simple Python script which produces a static album with thumbnails.
- iGal - Another configurable image gallery generator written in Perl.
- kallery - for those who hate the CLI and prefer a "Wizard" style interface to accomplish tasks, this one is a good choice. This is similar to the above command line tools and produces a static HTML album.
There are plenty of simple command line utilities in Linux/*nix like these for other tasks as well. Feel free to explore!
Obscure blog software you might not be aware of
I thought it would be fun to compile a list of blogging tools that not many people might be aware of. Mind you, most of them are for the hardcore geek-types and all of them are not your run-of-the-mill PHP/MySQL driven CMS type blogging solutions. Most of them publish static, fully self-contained websites, but in a blog format. I think a few of them are also dead projects, not having been updated in years.
But it is interesting to check out. Here are a few I found out (mainly using Debian's package manager).
Blosxom - This is described as a lightweight, yet feature rich blogging tool. Mind you, it's written in Perl, so I guess not many present day bloggers would be comfortable dabbling with CGI scripts and such.
hobix - This one is odd. That's all I can say about that. Check out the website and prepare to be stunned. 
chronicle - This one is described as a tool that will convert a directory of text files into a blog with an RSS feed. Appropriately called a blog compiler.
nanoblogger - This is a blog tool that you use entirely from the UNIX command line. It relies on no database, no GUI, nothing except a few simple UNIX command line tools to generate a complete blog-like static website. It does support plugins which sounds interesting.
tDiary - This one seems to be another online diary generator powered by Ruby. The original site is in Japanese, so I'm linking to the Debian package page.
I've not tried or tested any of these tools, except nanoblogger (very perfunctorily). But I always enjoy discovering such hobbyist software projects that never make it to the mainstream.
Linux games you might not be aware of
A couple of Linux/cross platform SDL games I found in the Debian repository recently were quite entertaining. Not everybody might know about these, but I think they're worth mentioning here.
XMoto - This is a 2d sidescrolling motocross action game with challenging, yet addictive gameplay. Controlling the bike is an exercise in gravity management and balance. Try it and see for yourself. You won't get anywhere if you just keep trying to drive fast. Completing levels can be really, really challenging or frustrating (depending on your viewpoint). It also has a level editor which can be installed separately to add your own challenges.
Abe's Amazing Adventure - This is very similar to the old-school sidescrolling arcade games of the early 90s. Plenty of platform hopping and avoiding enemies here. Simple, yet fun. Shows how much you can do without all the fancy and flashy effects of 3D accelerated graphics.
FooBillard - This is a realistic 3D pool game for Linux. You can play one of 8-ball, 9-ball, Snooker or Carom, but there is no AI implemented as yet, so you have to play for both players. Still, it can be a challenge to aim a shot correctly as it doesn't provide a whole deal of assistance. Has all the table and ball physics you expect from this kind of game.
Getting the HP Pavilion 6314 in-built webcam working on Linux
I have just discovered how to get the in-built webcam on my HP Pavilion laptop (webcam model: Microdia) to work in Linux. Since I haven't found a single clear tutorial on this particular model anywhere on the web (and knowing that such obscure topics do require to be documented), I wanted to write this tutorial and to create a record for my personal future reference as well as for the benefit of others with a similar issue.
This tutorial works with Debian. For other distributions that don't have module-assistant, simple compile the driver source as you would normally do: make, make install and copy the module output file to the directory /lib/modules/2.6.x/ (substitute 2.6.x for your kernel version).
Get the kernel headers
You should first install the kernel headers package. On my system this is currently the package named linux-headers-2.6.22-3. Usually the package is named kernel-headers or linux-headers along with the version number. Choose the correct headers package matching your running kernel.
The command is
apt-get install linux-headers-2.6.22-3
Get the source code for uvcvideo
On Debian this package is named linux-uvc-source. If you cannot find that package simply download the uvc sources from this website: http://linux-uvc.berlios.de/ and compile the driver like you would compile any other application.
On Debian (or Debian-like systems, e.g. Ubuntu) run:
apt-get install linux-uvc-source
This will automatically install module assistant and other necessary tools to simplify compiling and installing this driver.
Install the driver module
Login or su as root and then run the following commands.
m-a prepare m-a a-i linux-uvc
That's it! This will automatically compile and install the kernel module required for this device. Then run modprobe to load the driver:
modprobe uvcvideo
If you didn't get any error messages at this stage, you've successfully installed the driver! Otherwise check whether your compilation failed and why it did. module-assistant works 99.99% of the time on Debian since it automatically takes care of the necessary dependencies.
Now check the video output
To check whether video works, you can use ffmpeg. Install ffmpeg (if you haven't already) using apt-get. Then to test whether recording works via the webcam run something like this:
ffmpeg -f video4linux2 -s pal -i /dev/video0 temp.mpg
It won't show anything while recording, but the blue LED near your webcam's lens show now glow. After you have recorded for a few seconds, quit ffmpeg and play back the temp.mpg file to check the video output. Obviously audio wouldn't have been captured in this case. But I can confirm the the built-in microphone on this laptop also works with ALSA, so you should merely have to specify the audio input parameter in ffmpeg.
That's all. If I have missed out any steps or you have any questions regarding this HOWTO, just feel free to drop a comment here! ![]()