You are here: CrunchBang → Archives → November '07
Thursday, November 29th, 2007
I really like the Lomo photo effect and I'd love to own a real Lomo camera — I just don't take enough pictures to warrant the purchase. Luckily the Lomo effect can be digitally emulated using a GIMP filter, and the results aren't too bad. See the before and after examples below:
Dragonfly [photo by peeper]

Butterfly [photo by Kevin Saff]

I can haz Lomoz filter [photo by Adelle Roux]

Get the filter
The GIMP filter that I used on the above images was originally written by Francois Le Lay. It has since been updated by Donncha O Caoimh to work with GIMP 2.4 [installed by default on Ubuntu 7.10.] The script is released under GPL.
You can download the script from directly from: http://crunchbang.org/misc/gimplomo.scm
Place the script in your "~/.gimp-2.4/scripts/" directory.
Alternatively, if you're an Ubuntu user you'll probably find it quicker to use the terminal:
1. Open a terminal and enter the following command to download the filter:
wget http://crunchbang.org/misc/gimplomo.scm
2. Move the filter to the correct directory with this command:
mv gimplomo.scm ~/.gimp-2.4/scripts/gimplomo.scm
Usage
Run or restart GIMP, open an image file to work on and select: "Filters -> Light and Shadow -> Lomo...".
Wednesday, November 28th, 2007
Tom Dryer offers some good advice to novice Linux users concerning the execution of malicious terminal commands/shell scripts:
Don't run a command if you don't understand what it is doing and don't run commands from untrusted people or places. Check with someone you trust if you are not sure, or check out the command's manual page.
Tom's advice is sound, but I fear he's shouting into the wind. I read the same Ubuntu forum announcement as Tom and while I've always been aware of the issue, it's worrying to read about it on such a high-traffic site as Ubuntu Forums — more so considering the site is heavily used for system support/help requests.
I find it funny that some Linux advocates proudly shout about the fact that Linux is near enough immune to virus attacks, yet rarely mention the negative aspects of running such a powerful system. Some of the malicious commands mentioned in the announcement are far more destructive than your average Windows virus.
The most worrying aspect to all this is the potential future implications for Linux on the Desktop. If When Linux finally gains real market share, then this type of maliciousness could really explode on the community [quite literally.]
Not a solution, just an idea
There isn't an immediate solution to this problem, there may never be a solution. However, I have come up with an idea that might help Ubuntu Forums to combat it:
The idea would involve Ubuntu Forum users [those wishing to post code or instructions] applying for a "seal of approval". The application would be looked at by a board/council and a seal issued when the applicant had shown enough evidence to warrant receiving it. Applicants could also submit testimonials from other forum members to backup their application.
Once a seal is approved it would be prominently displayed as an image link within the users profile bar. Clicking on the image would send the visitor to a notice page informing them that the message had been posted by an approved user.
All forum users should be made aware of the seal and its meaning. This could be done on registration for new users and via an announcement for existing members.
I'd be interested to know what people think of this. Please feel free to post a comment saying why it's either good or bad idea. Any technical suggestions about how it would work would also be welcome :)
Tuesday, November 27th, 2007
Searching Flickr for images licensed under Creative Commons is painfully slow and frustrating. For every new query you have to visit the advanced search page and select the appropriate check boxes before hitting the search button. I've been using Flickr in this way quite a bit lately and so I wanted to find an easier way to achieve this task.
I turned to Google and found this Greasemonkey hack. It looks good and does what I want, however I don't use Greasemonkey and I'm not about to start using it anytime soon. So I ended up creating a quick bookmarklet to do the job instead — I don't know why I didn't do this in the first place, it only took seconds?!
Flickr CC Search
You can install the bookmarklet by dragging it your Firefox "Bookmarks" toolbar.
Monday, November 26th, 2007
From the Ubuntu developers list:
Personal Package Archives are now out of beta and available to all Launchpad users and teams. Find out more in our quick-start guide at https://help.launchpad.net/PPAQuickStart
This is great news. I love it when a service/software comes out of beta, it leaves me with a greater sense of confidence. I've been using my Launchpad PPA for a couple of months now and it's been a real help by introducing me to the process of uploading packages to a remote repository. I recommend PPAs to anyone wanting to experiment with packaging for Ubuntu. There's a PPA introduction class at 15.00 UTC on Wednesday 28th November in #ubuntu-classroom.
Saturday, November 24th, 2007
When I first designed this site I was completely [maybe not completely, but near enough] happy with it. I liked the overall look and I was pleased with the way it worked. I had no plans to redesign the site and I was sure the design would last for the foreseeable future. Then just a few months later I realised that the design was actually quite restrictive — limiting my options to extend the site.
So I've done a quick redesign, dropping the monochromatic style for a less retina-burning mix of neutral grays. I've also made some adjustments to the type styles by incorporating the typography CSS from the Blueprint CSS framework. All-in-all I'm much happier with this version. Hopefully this design really will last for the foreseeable future.
For future reference [and for anyone who missed it] here are some screengrabs of the previous design:

Thursday, November 22nd, 2007
I've been thinking about trying to get my PPA packages included in the Ubuntu Universe repositories. To this end, I've started researching the MOTU process. Daniel Holbach was kind enough to leave me a link to the correct page on the Ubuntu wiki [UbuntuDevelopment/NewPackages] for my new gimp-brushes package. Christer Edwards and Jorge O. Castro have also been supportive and encouraging over email — thank you :)
Inspired by the encouragement, I've managed to read through the information and yesterday I uploaded my first package to REVU. I'm now waiting for the fallout reviewers to comment and hopefully provide some guidance/constructive criticism.
So anyway, on the slim chance that any of the MOTU team read this, please take a look at my first REVU package. And remember, go easy on me, I'm a noob at this packaging lark.
Wednesday, November 21st, 2007
A quote from A List Apart article, "Understanding Web Design":
Web design is not book design, it is not poster design, it is not illustration, and the highest achievements of those disciplines are not what web design aims for. Although websites can be delivery systems for games and videos, and although those delivery systems can be lovely to look at, such sites are exemplars of game design and video storytelling, not of web design. So what is web design?
Web design is the creation of digital environments that facilitate and encourage human activity; reflect or adapt to individual voices and content; and change gracefully over time while always retaining their identity.
Talking of web design, I'm currently toying with the idea of changing a few things around here. I'm not thinking about anything major, just a few tweaks to the CSS for better spacing and maybe the introduction of some colour!?
Talking of CSS, Jeff Croft created a bit of a hullabaloo over the topic of CSS frameworks last week. The comments generated by the post are probably more interesting than the post itself. Jeff was kind of surprised by the reaction:
Wow. Less than 24 hours after my last post, there have been nearly 100 comments posted, and I've seemingly managed to piss off half the Internet.
Personally, I think the tone of Jeff's post had a lot to do with it. Stating, "I wrote the book on this topic" was probably a bit too much, an ALA article [although important] is hardly a book!
Anyhow, I'm not a huge fan of frameworks, but I did manage to take a look at the BluePrint CSS framework. It's a good collection of CSS techniques by numerous contributors. The typography styles are especially good and well worth checking out — I think I'm going to try and incorporate parts of it into my little redesign.
Monday, November 19th, 2007
I'm not sure about this [I could be wrong], but I seem to remember Feisty would automagically make available any fonts whenever I installed them in my personal fonts directory. Gutsy doesn't seem to do this, at least not on any of my systems.
I've been using the following terminal command to update the font cache manually:
fc-cache -rv
My first thought was that I'd managed to knacker something whilst playing with some new font packages. However, I've now noticed the same on multiple Gutsy installations and I'm beginning to doubt whether Feisty really did do what I think it did. Has anyone else noticed this?
Sunday, November 18th, 2007
I thought that it might be a good idea to start posting a few of my scripts; it'll be handy to have them on my site for future reference. Also, I learn a lot by reading example scripts — I guess others might be able to learn from mine.
I wrote the following Bash script to perform a backup of a remote MySQL database. The script first connects via SSH and performs a MySQL dump, saving the results to file. It then connects via SFTP and downloads the file. Once the file has been downloaded, it restores the database to my local MySQL server.
It's quite simple Bash script and it should be fairly straightforward to follow.
#!/bin/sh
# Settings
#############################
REMOTEHOST="example.com"
REMOTEBACKUPDIR="backup/sql"
SQLHOST="localhost"
SQLDB="database_name"
SQLUSER="username"
SQLPASS="password"
SQLFILE="database_name.sql"
LOCALBACKUPDIR="backup/sql"
#############################
# Start main
echo "* Connecting via SSH..."
ssh $REMOTEHOST <<**
echo "* Performing SQL dump..."
if [ -d $REMOTEBACKUPDIR ]; then
cd $REMOTEBACKUPDIR
else
mkdir $REMOTEBACKUPDIR
cd $REMOTEBACKUPDIR
fi
mysqldump -h $SQLHOST --user="$SQLUSER" --password="$SQLPASS" $SQLDB > $SQLFILE
echo "* Closing SSH connection..."
exit
**
cd ~
if [ -d $LOCALBACKUPDIR ]; then
cd $LOCALBACKUPDIR
else
mkdir $LOCALBACKUPDIR
cd $LOCALBACKUPDIR
fi
echo "* Connecting via SFTP..."
sftp $REMOTEHOST <<**
cd $REMOTEBACKUPDIR
get $SQLFILE
exit
**
echo "* Restoring SQL dump to local server..."
mysql --user "$SQLUSER" --password="$SQLPASS" $SQLDB < $SQLFILE
echo "* SQL backup complete."
cd ~
exit 0
Notes
- For automation purposes, this script assumes that SSH and SFTP have been configured for automatic login. See "Creating Private/Public SSH Keys"
- It also assumes there is a mirrored MySQL server and user account running on the local machine.
- The script can be automated using Crontab.
- Lacks any error handling and/or logging!?
- I've worked with some commercial hosting providers who do not grant table locking privileges to their MySQL users — table locking can be bypassed by adding the "
--skip-lock-tables" option to the "mysqldump" command. Use with caution.
Saturday, November 17th, 2007
I love playing around with GIMP, it's a fantastic piece of software. I use it to design websites and web graphics. I have to admit that it took me a while to really get used to using it. I was used to using Adobe Photoshop and Macromedia Fireworks. GIMP in comparison to these seemed archaic and not too user friendly. I can see now that this is not the case and I'm glad that I persevered and continued to use GIMP. GIMP is now my friend.
Anyhow, by default GIMP comes with a rather limited set of brushes. There's a package available from the Ubuntu repositories to install some extra brushes, however this is also a little limited. To this end, I've created a new package containing over 150 additional brushes for GIMP.
Example GIMP brushes included in the package
Solid square brushes, ideal for leaders, dotted leaders and headers [best used with Pen tool]:

Various pixel shape brushes, again ideal for decorative leaders etc [best used with Pen tool]:

Miscellaneous shaped brushes for decorative use [best used with Brush tool]:

Barcode brushes, not overly useful but a personal favourite :)

Star and snowflake brushes, ideal for creating those Christmas greeting cards [best used with Brush tool]:

Get the Brushes
I've made the brushes available through a number of sources. Firstly you can get the .deb package directly from my PPA on Launchpad: http://launchpadlibrarian.net/10450525/gimp-brushes_0.0.1~ppa1_all.deb
The .tar.gz archive file is also available here: http://launchpadlibrarian.net/10450317/gimp-brushes_0.0.1~ppa1.tar.gz
Or to install via apt simply follow the instructions below [only tested with Gutsy]:
1. Open your apt sources.list file for editing with the following terminal command:
gksudo gedit /etc/apt/sources.list
2. Add the following two lines to the bottom of the file:
deb http://ppa.launchpad.net/corenominal/ubuntu gutsy main
deb-src http://ppa.launchpad.net/corenominal/ubuntu gutsy main
3. Close gedit and issue the following terminal command to update apt:
sudo apt-get update
4. Still in the terminal, enter the following command to install the package:
sudo apt-get install gimp-brushes
5. Enjoy your new GIMP brushes!
License
The brushes are licensed under GPL. Please feel free to modify, repackage and redistribute — it would be good if people created packages native to their Linux distros.
More posts for November 2007