KDE5 and Gravatars using bash only

my face at the bottom of the K menu
my face at the bottom of the K menu

In KDE, if you want to use an image as your user avatar you have to save it as a 64×64 png file and name it .face.icon inside your home directory. But what will you do if you want to use your Gravatar? You’ll have to go to, login with your email and password, download your image, convert it to png format if it’s not already a png, and save it as .face.icon inside your home directory.. this is quite the boring process, but thankfully, the nice guys at Automattic have created an API which allows everyone to retrieve a gravatar image using a simple anonymous GET request.

The BASH way

In order to retrieve our gravatar image, we’ll need an email address to be ashed using md5, then we’ll be able to use wget (or whatever program you want to use) and download the image.

We’ll have to specify the format of the image and the size as well, but the API can deliver everything for us exactly the way we want it. Here’s the code:

wget$(echo -n "" | md5sum |cut -d " " -f 1).png?s=64 -O .face.icon

looks confusing? Let me explain:

We said that the Gravatar API requires the email address to be ashed using md5, so in this portion $(echo -n "" | md5sum |cut -d " " -f 1) this is exactly what we did, we gave our email to md5sum which is part of the coreutils package in every linux distro, and we piped it with cut to grab just the ash string without the sum explanation. we used a subshell “$()” to execute the command and return it’s value in the main shell where we called wget with the -O option to specify the output file name. Using the subshell, this is the url that wget used:

which is the format that the gravatar API is expecting to receive, specifying also the file type and the size of the image with the parameter s=64. Neat uh?!

That’s it, now if you open the K menu you’ll see your face, same thing will happen when you lock your screen or login into your KDE desktop.

As usual, if you have any questions feel free to drop me a line in the comments section below. 😉


Yesterday I was looking at my newborn server and I was thinking of a way to use it even when I’m not actively using it, and immediately, something flashed into my mind.. Distributed Computing.

Let me explain it briefly, distributed computing works by installing a small piece of software on your pc and use it to connect to a large network of computers just like yours, all those computers are instructed to work on different bits (or units) of the same project, which usually involves huge mathematical calculations, which turns into huge computational power needs.

There are a lot of projects using distributed computing, and some of them rely on Boinc, the Berkley Open Infrastructure for Network Computing. Boinc is also the name of the software that will allow your computer to take part in the distributed network we explained before, and it works by using the CPU or the GPU on your computer when you’re not using them.

The first thing you want to do is install the Boinc software, you can download it in a variety of flavors, I’ve created a slackware64 package for current to be run on a headless system, so it won’t have a gui but only command line tools, just install it the usual way and you’re ready to go.

After installation create a directory for Boinc to use it, this will be the Data directory, and create a file named cc_config.xml inside of it. At this page you’ll find the various possible settings for the client.

Next you want to join a project, head over to Boinc Projects page and select one that sounds interesting to you, since we don’t have a gui we’ll have to create an account first, from there the project will instruct us on how to create a file in the Data directory and after that we’ll be able to launch boinc_client.

I’ve launched mine like this:

boinc_client --daemon --dir /home/danix/.boinc/ --no_gpus

Where .boinc inside my home directory is the Data directory, I’ve also instructed boinc to run as a daemon and not to use gpus (since I don’t have one on the server).

If you want to control the behaviour of the daemon once is running you can open a terminal and use tail to read the log files that it creates inside the Data directory. You’ll find a stdoutdae.txt for standard output and a stderrdae.txt for error output. I’m keeping an eye on the stdoutdae.txt file like this:

tail -f /home/danix/.boinc/stdoutdae.txt

this way you’ll be informed about whatever happens with your daemon.

I hope you’ll find this information useful, as usual if you have any questions feel free to ask in the comments below.


Hello everyone, I’ve been quiet for a while because I was secretly working on my lan to bring back to life my old server, Trantor.

Named after the planet, set in Asimov’s universe, to be the capital of the Empire, ruling all over the galaxy, placed as close to the center of the galaxy as it could possibly be for it to be inhabitable by human beings, Trantor consisted of an enormous metropolis covering the whole surface of the planet, where all of its inhabitants tasks were to administer the whole Galactic Empire.

“All roads lead to Trantor, and that is where all stars end”

The reason I named my server Trantor is because on the planet was situated the Galactic Library, a place where librarians used to index the entirety of human knowledge by walking up to a different computer terminal every day and resuming where the previous librarian left off, cool uh?!

Continue reading “Trantor is born again”

Wacom Intuos M

I’ve had my Wacom Intuos Pen & Touch Medium for a few years now, I love it, love the ExpressKeys, the pen, everything, I find it very easy to use and it’s actually fun to play with it. The only problem is that I’ve never managed to make it work in Slackware, I was using it only on my Windows 8 box where it was working like a charm, but still, it was kind of a disappointment for me.

So yesterday I decided to try and configure it on my beloved Slackware, at first I connected the USB and I noticed that it was recognized right away, lsmod was showing the wacom module loaded and lsusb was telling me that my model is 056a:0303. I then started googling around to find out how to configure the various keys on the pen and on the tablet itself, and I found out about xsetwacom, a nice little program that ships together with the xf86-video-wacom package and provides a way to configure various parameters for the wacom products, go check their website for details about the software.

There’s also an online tool to help you configure the buttons, but it didn’t work for me, so I went for the manual setup.

Xsetwacom gives you a lot of information regarding your tablet, simply plug the usb and launch the program with the --list devices parameter to see how the tablet is recognized, which devices are created for the touch, pen, eraser and pad itself and a lot more info.

If you run the program without any arguments it’ll give you a help text to understand how to use it:

$ xsetwacom
Usage: xsetwacom [options] [command [arguments...]]
-h, --help - usage
-v, --verbose - verbose output
-V, --version - version info
-d, --display "display" - override default display
-s, --shell - generate shell commands for 'get'
-x, --xconf - generate xorg.conf lines for 'get'

--list devices - display detected devices
--list parameters - display supported parameters
--list modifiers - display supported modifier and specific keys for keystrokes
--set "device name" parameter [values...] - set device parameter by name
--get "device name" parameter [param...] - get current device parameter(s) value by name

This is the output for my tablet:

$ xsetwacom --list devices
Wacom Intuos PT M Pad pad               id: 14  type: PAD       
Wacom Intuos PT M Pen stylus            id: 15  type: STYLUS    
Wacom Intuos PT M Pen eraser            id: 16  type: ERASER    
Wacom Intuos PT M Finger touch          id: 17  type: TOUCH     

As you can see, the output is divided into sections, “Wacom Intuos PT M” is the name of the device, “Pad pad” is what the driver will be loaded for, then we have the id number which changes every time, and lastly we have the type of input medium.

You will notice that the pen is divided in stylus and eraser, two different ids which allow for two different settings for the buttons.

Continue reading to see how to identify and configure the various buttons.


I’ve been thinking about adding my handwritten signature to posts on my blog for a long time, without deciding to write a plugin to do it. Until yesterday, when I started writing my soon-to-be fourth submitted plugin to the WordPress plugins directory.

As usual The first thing I did was looking in the repository for a similar plugin, I was looking for something simple, not bloated with tons of features, all I wanted was to be able to select an image for my user, and set the alignment and size for the displayed image inside the blog post.

Continue reading “add a signature to your blog posts”

My shiny WordPress laptop

As most of you know, I love WordPress, I feel so proud of being part of it and being able to build stuff out of it, and I always look for ways to show off my love for this platform.
One day I decided I wanted a WordPress sticker for my laptop by looking at Mark Jaquith’s blog post and also some posts by Matt Mullenweg on his blog.
One of the things I’ve always wanted to do was to make a laptop sticker with the WordPress logo but I’ve never actually dedicated some time to this thing.

Continue reading “WordPress laptop sticker”

1 March 1973

the Dark Side of the Moon
the Dark Side of the Moon

and if the band you’re in, starts playing a different tune, I’ll see you on the dark side of the moon.