Missing your "Shared Folders" after upgrading Ubuntu?

July 30th, 2008
Yeah, I miss them, too...

Since version 8.04 (Hardy Heron) the Ubuntu folks decided to take down the Shared Folders item from the Administration menu. Of course, you can still right-click on specific folders and go to the Sharing Options, or go to the Properties and then to the Share tab, however, it's still good to be able to view all the folders that you share at a glance.

The good news is that, the Shared Folders Manager is still with us, we just have to run it manually, though. Just press Alt-F2 and execute the shares-admin command, and there you have it.

I would like to say "Thanks" to Mohamed for giving me the idea for this post.

How to upload JAR files in Wordpress

July 30th, 2008
Yesterday I tried to upload a Java JAR file in my WordPress-based website, and I was this given this funny error message: "File type does not meet security guidelines. Try another."

The reason for that is that WordPress does not recognize the .jar extension as a known file type. And here is what you have to do to fix this (you are possibly going to need administrator's rights to follow the instructions):

Go into your WordPress installation directory and then go down to the wp-includes directory. In there you should be able to see a file by the name functions.php. Open this file in a text editor.

Use your editor's searching facility to find the text "function wp_check_filetype" (yes, *without* the double quotes, and, yes, *including* the space character between "function" and "wp_check_filetype"). You should be able to see a portion of the file that looks like this:

functions-1.png

Add the following line of code as seen in the screenshot below:

functions-2.png

The save the file and you are done! You will be now able to upload as many JAR files as you wish without annoying error messages!

Candiru: a Dactyl clone in Java

July 28th, 2008
This is my first attempt in writing a Java game for mobile devices. I wanted to take advantage of my new cell phone's touchscreen, so I decided to write a simple game that imitates Dactyl, a game I had seen in a friend's iPhone once. Here is a screen shot of my variant:

a screenshot of the Candiru game



And here is another crispier screen shot taken directly from the emulator:

candiru-screenshot-emulator.png



And here you can see a demonstration of the game running in my cell phone:



As you may notice, the game consist of a grid of bombs (the size of the grid is customizable). Then the bombs, one by one and in random order start to activate (they go red colored). The player has to point on every activated bomb in order to defuse it before it goes off (the speed of bomb activation as well as how fast the bombs go off are also customizable). The goal is to defuse as many bombs as you can.

Personally I find this game highly addictive, and I believe you can spot very interesting combinations in the Settings section to try on. It's highly likely that the game will look better in 240-pixel wide displays. However, I have only tested the game in my own cell phone, thus, your contribution on beta testing will much appreciated!

Here is the download link:

Have fun!

(The name Candiru is totally irrelevant with the game's objective. I was striving to find a name and then I remembered that earlier this morning I had been reading some stuff about Candirus, which are actually parasitic fish in the Amazon river; check it out some time.)

Sound problem on Hardy Heron

May 31st, 2008
After the upgrade to Hardy Heron you may have noticed a problem in your sound. Specifically, you may notice that you cannot simultaneously listen to both Youtube video and other audio applications. You have to close the one or the other, for the sound to come up.

The problem is caused because since Hardy Heron the PulseAudio is used by default as an audio server, and flash exhibits a faulty behavior because of that.

To fix the problem is as simple as typing:



sudo apt-get install libflashsupport



Then close all application that play audio, including web browsers, like FireFox; make sure that you close all browser windows, or yet better do it from File → Quit.

Restart the PulseAudio server:



sudo /etc/init.d/pulseaudio restart



and you're done.

Smoke-Free Banner

May 23rd, 2008
I just came up with a small PHP script that generates a simple "smoke free" banner that you can freely use in your website, or signature, or whatever.

Based on the information that you provide, the banner displays the number of days you have been smoke-free, the number of cigarettes you avoided and the amount of money you saved. For example, this is my smoke-free banner:




You can create your personal smoke-free banner here.

The idea is actually stolen from the "Smoke-Free QuitMeter Banner" originally created by "Josh Houghtelin of burnmytime.com & Erin S. Leadbetter", and you can find it here. The main difference is that QuitMeter generates a static image of your smoke-quitting statistics, while mine is generated on the fly (thus, the numbers will automatically be updated every time someone sees your banner).

what to do if Kino fails to import video files

May 13th, 2008
If you are trying to import non-DV files (such as AVI or OGG) into Kino, but you are only getting an error message, probably that's becuase you're missing ffmpeg, a program that is used by Kino to convert video file from non-DV formats to DV.

To fix this you only have to type:

# sudo apt-get install ffmpeg

The most likely is that you don't even have to restart Kino, just go ahead and just load the file, it should be working by now.

ubuntu: arrow keys make mouse pointer to move around

May 10th, 2008
Today I discovered a nice feature in Ubuntu which allows you to move the mouse pointer using your numpad's arrow keys. You can even click using the middle '5' button.

However, this can be very annoying if you want to play a game or something, not only because you will have a mouse pointer running around the screen, but also because this feature actually steals the keyboard events, and possibly will cause your program to work improperly.

You can easily disable this feature by going to System → Preferences → Keyboard. Then go to the Mouse Keys tab. You will see a checkbox labeled as Allow to control the pointer using the keyboard. All you have to do is to make sure that you have this box unchecked. It should look like this:

disable-keyboard-mouse.png

GNOME Terminal ignores font rendering settings

May 5th, 2008
In the latest Ubuntu release, Hardy Heron, a bug in the GNOME Terminal causes the program to ignore the system's font rendering settings and instead uses its own.

I don't really know how to fix this in a proper manner, but I found something which is rather a work around on this problem, than a real solution.

You should try the following:

# cd /etc/fonts/conf.d
# sudo mv 10-no-sub-pixel.conf 10-no-sub-pixel.conf.1


The above command takes the 10-no-sub-pixel.conf out of the game. I prefer to rename the file than completely remove it, in case I want to get it back when the bug is fixed.

Restart your X Windows and try to open GNOME Terminal, which should be using your system-wide settings this time.

ubuntu: HP LaserJet 1018 is found but does not print

May 5th, 2008
Symptom:
You plugged in your printer. Ubuntu recognized it and displayed a message that your printer is ready for use. Then you send something for printing. Cups says that the job is being processed and eventually removed from the printing queue. However, you never see your printout coming. Your printer stays silent and idle all the time.

Diagnosis:
Some printers (including LaserJet 1018) are shipped with an incomplete firmware. These printers expect a working firmware to be sent from the operating system. However, due to licensing issues and restrictions the driver that comes with Ubuntu for this printer (foo2zjs) does not contain a firmware. Thus, the printer is essentially unusable.

Cure:
You will have to download the foo2zjs source code and build it yourself. You will also have to get yourself an appropriate firmware file. And that will fix it.

Here is the exact commands you have to type to get everything done:

wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
tar zxf foo2zjs.tar.gz
cd foo2zjs
sudo make uninstall
make
./getweb 1018
sudo make install
sudo make install-hotplug


The same procedure can be followed for all printers that are supported by the foo2zjs driver. The models currently supported are:

  • Minolta/QMS magicolor 2300 DL

  • Minolta/QMS magicolor 2200 DL

  • Konica Minolta magicolor 2430 DL

  • Minolta Color PageWorks/Pro L

  • HP LaserJet 1022

  • HP LaserJet 1020

  • HP LaserJet 1018

  • HP LaserJet 1005

  • HP LaserJet 1000

ubuntu: how to disable window snapping

May 4th, 2008
The wobbling window effect is by far my favorite one from the plethora of compiz-fusion plugins. However, the window snap effect can be a bit of annoying sometimes and personally I prefer to disable it.

You may have tried to disable this feature by disabling the "Snapping Windows" plugin, but without the desired effect. Well, this is what you have to do: Start CompizConfig Settings Manager, go to System → Preferences → Advanced Desktop Effects Settings. The find the Wobbly Windows plugin (which should be enabled) and click on it to go to the plugin's setting screen. From the General tab, make sure you disable Snap windows and uncheck Snap Inverted. You should disable them both. It should look something like this:

disable-window-snap.png


And now you will be able to enjoy your wobbly windows without the annoying snapping.