Archive for December, 2008

Ubuntu: Show Directory Names in Bash

26/12/2008

This is a very short tip.

I made a small shell script to delete and create a link to my localhost htdocs directory. That way, I never have to move my projects around, I just keep them in separate directories under one main directory.

The problem comes when I forget important things: such as directory names. Instead of just typing ls /projects, I want the script to tell me the options I have.

And so, this little code is born, by not giving the script any arguments:

#!/bin/bash
	if [ -z $1 ]
	then
		echo "No valid user was provided!"
		echo "Possible users:"
		declare -a FOO
		let count=0
		let count2=0
		for d in $( find /projects -maxdepth 1 -type d -printf "%f " ); do
			if [ $count2 -gt 0 ]
			then
				FOO[$count]=$d
			fi
			((count++))
			((count2++))
		done
		echo ${FOO[@]}
	fi

Note: I did it this way because otherwise you get “projects” in the list of results.

Advertisements

Ubuntu: Intrepid Ibex “breaks” the random wallpaper script

14/12/2008

I posted the random wallpaper script a couple of months ago, and some time after that I upgraded my system from Hardy to Intrepid, and found out the script wasn’t working.

Since it was not something important to me, it took me a while to start searching for a solution.

The problem is not a bug, it’s a change made to gconf.

Fortunately, someone was able to find a workaround to those changes. It only involves creating a shell script, setting it to start every time you log in (it will create a file called .Xdbus in your home path), and then you modify your crontable so that the .Xdbus file is called before your script.

Once you log back in, you should see the wallpaper being changed again! :D

Ubuntu: Get VisualBoyAdvance fully working with Wine

10/12/2008

If you miss VisualBoyAdvance’s cheats systems (GameShark, CodeBreaker/ActionReplay, and the memory editor) and you really don’t want to use Linux-based ports because they lack this feature, you’re in luck!

Let’s see the versions:

Wine (development version): 1.1.10
VisualBoyAdvance: 1.8.0-beta3 (more…)