Tips for optimizing images

Not that long ago, disk space was an expensive commodity: five gigabytes of space for a website could cost you more than €30 per month. Today, you pay that for a whole year and the double or more of disk space. Some hosts even offer “unlimited” storage for a similar monthly price.

Even though disk space has become cheaper, you might be bound to hit the limit of your hosting provider. In order to delay that, you can (and should!) optimize the images you use. This can be done in several ways, but I’m going to document the ones I use.

First, avoid PNG’s unless you need transparency in the image. The format is open, which is great, but the more color information it has the more disk space it tends to use. You can easily confirm this by saving a photo in PNG and JPEG, and then see how much space they take. Chances are the PNG one will use at least two times more disk space than the JPEG one.

Second, if you use GNU/Linux, *BSD or macOS, leverage the jpegoptim utility. This tool does some neat things, like removing the metadata information (EXIF, XMP, etc) and applying lossless optimizations to help you reduce the file size. With the PNG images, you can use optipng to accomplish the same thing. There are also some websites that let you optimize your images (before uploading them to your website), like

This two simple things allowed me to save more than 5GB of disk space for Espalha Factos the first time it was done. It might not sound a lot, but it was around 4,17% of the total disk space.


sncli – Simplenote Command Line Interface

Notes can be a great way to store information for later reference. That’s why I’m always on the look for the “perfect” note-taking app. I use Google Keep for grocery lists and saving random links I want to read but don’t have top priority, because it’s available in most platforms. Yet, for storing notes in a (somewhat) knowledge base format, I hadn’t found a solution.

I’ve tried some apps and services, but they always fell short. One of those services was Simplenote; not because it didn’t have what I needed, but because I hadn’t found a command-line application to interact with the service when I don’t have a graphical session running. Until today.

While randomly browsing the web, I stumbled upon sncli, a command-line interface for Simplenote. The tool is written in Python3, and you only need the interpreter and Pip to install it. The configuration is simple, but the keybinds are awkward. To be honest, they seem to be configurable in the configuration file, located at ‘$HOME/.snclirc’, but I haven’t done that yet.

One of the cool things about this app is it allows you to use your preferred text editor. In my case, that’s micro. I find the keybinds in this text editor simple to use (mostly because they are the same as most text editors with a GUI).

Another nice feature is the ability to flag notes as markdown content. This allows a faster visual identification of them in the notes list. There are other flags, for example to identify which notes haven’t been synced.

Other notable features include regex and Google-like search, versioning, piping (inside sncli) notes content to external command and creating notes on the command-line with a simple pipe (echo “Testing” | sncli -t Test create -).

By the way, this was written in sncli.

geekices, software livre

A few thoughts about IceWM and a theme I made for it

Today I decided to install IceWM in my Arch partition (I’m dual booting with Debian Testing). I haven’t touched this window manager in at least five years, but I had some nice memories of it, so I decided to use it again.

A few hours have passed since I’ve installed it, and I remember why I liked it. It’s very lightweight, using less than 5MB of RAM, and the (text-based) configuration is simple. The documentation is not bad either.

The default theme, however, is not to my liking. It was the one thing that I felt I had to change. So I went to to find a theme and stumbled with erizo. While not exactly what I was looking for, although it looks really nice, it gave me a really good base to start tweaking.

And this is the main reason I’m writing this: to share the theme. I’ve darken a few elements, changed the typeface (I’m using Clear Sans, from Intel, but you can use any other you like) and made a few more small tweaks. The image in this post is a screenshot from the theme I’m sharing.

The theme’s license, like the original, is the GPLv3 (please refer to the COPYING file in the download archive).

Download it


Firefox Quantum rocks!

Firefox got a major speed overhaul in version 55, the current stable version at the time of writing. I’ve used it for a few weeks and the differences are impressive.

In the same environment, it used less RAM (even with 20+ tabs), felt more responsive and started faster. Pretty impressive changes, if you ask me. And some needed ones, because the browser seemed to have a similar appetite for memory as Google Chrome and felt slow using it.

Can this get even better? Yes it can!

Meet Firefox 57. This is the version currently in beta and is part of the Quantum Project, which intends to improve the browser’s performance. Oh boy, and improve it did. The software is faster in almost every way: shorter render times, faster startup and less used RAM. Also, there are a few (more than welcome) changes to the interface, most notably the ability change between one single address and search bar or two separate bars (the current default behavior).

If you haven’t tried it already, go ahead, make your day. You can thank me later. 🙂

By the way, please be advised that some extensions do not work with this version. Luckily, uBlock Origin works.


So long, Void. Hello (again) Debian

I’d been using Void Linux for a few months and I was generally happy with this distribution. The performance is good, it uses a rolling-release model, has a D.I.Y. component to it and helped me learn a bit more about Linux internals. Yet, Debian kept whispering my name in the wind.

Debian was the first Linux distribution I really tested and ended up installing. Or was it Ubuntu? My memory is not what it used to be. But let’s be fair, it doesn’t matter which one was the first: Debian always struck me as a solid operating system, even the Testing branch. And the fact that the repositories are loaded with software helps a bit.

Software availability is an area where Void somewhat lacks. You can always build something from source, a reasonable thing to do if it’s just a software or two. When this number increases, it can be a P.I.T.A. – keeping track of new versions and new dependencies can quickly become a nightmare.

So, although I’m a bit sad because I had a good experience, I removed Void and installed Debian – a.k.a. The Universal Operating System – Testing.


I fucking hate ads and what I did about it

I fucking hate ads. I really do (fucking) hate them. They make the browsing experience far worst than it would be without them, they track the user everywhere (not just ads – winks at Facebook) and they make the mobile platforms much more annoying.

To hide them, I usually have an adblocker installed in the browser and a dedicated one in the phone (provided I have root). Now, I have one more tool: adhosts.

This is not my original work. The original author is levin. I just improved what he wrote and published the changes to a repository on Github, so anyone can use it and/or improve it.

The tool is a simple bash script that downloads some files, merges them and appends the result to your /etc/hosts file. You’ll need bash, curl and an internet connection. And make no mistakes, this will not block all of the ads. An adblocker in the browser is still recommended. This tool is a complement to your existing adblocking arsenal. Download it.

The license is LGPLv3, as the original tool.


How to get good font rendering in Void Linux

This guide assumes you are using Void Linux (you can probably replicate it in other distributions; just check the paths), have Freetype installed and using some sort of Window Manager or Desktop Environment. If you don’t, sudo xi them. After that, fire up a terminal and create a symbolic link, from the following files in /usr/share/fontconfig/conf.avail/, to /etc/fonts/conf.d:

  • 10-hinting-slight.conf
  • 10-scale-bitmap-fonts.conf
  • 10-sub-pixel-rgb.conf
  • 11-lcdfilter-default.conf
  • 20-unhint-small-vera.conf
  • 21-cantarell-hinting.conf
  • 30-metric-aliases.conf
  • 30-urw-aliases.conf
  • 31-cantarell.conf
  • 40-nonlatin.conf
  • 42-luxi-mono.conf
  • 45-latin.conf
  • 49-sansserif.conf
  • 50-user.conf
  • 51-local.conf
  • 57-dejavu-sans-mono.conf
  • 57-dejavu-sans.conf
  • 57-dejavu-serif.conf
  • 60-latin.conf
  • 65-fonts-persian.conf
  • 65-nonlatin.conf
  • 69-unifont.conf
  • 70-no-bitmaps.conf
  • 80-delicious.conf
  • 90-synthetic.conf

In ~/.config/fontconfig/conf.d/, I’ve symlinked these files (again, from /usr/share/fontconfig/conf.avail/):

  • 10-hinting-slight.conf
  • 10-sub-pixel-rgb.conf
  • 50-user.conf (using it to default Helvetica, Arial and Verdana to Clear Sans)
  • 60-latin.conf
  • 70-no-bitmaps.conf

My .Xresources file:

Xft.autohint: 1
Xft.antialias: 1
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xft.lcdfilter: lcddefault

Also, I’ve created the /etc/profile.d/ file with this content:

# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
# version. The available settings are:
# truetype:interpreter-version=35 # Classic mode (default in 2.6)
# truetype:interpreter-version=38 # Infinality mode
# truetype:interpreter-version=40 # Minimal mode (default in 2.7)
# There are more properties that can be set, separated by whitespace. Please
# refer to the FreeType documentation for details.

# Uncomment and configure below
export FREETYPE_PROPERTIES="truetype:interpreter-version=38"

Open the screenshot in fullscreen

Cheers! 🙂


A Stylish extension theme to “fix” the new round Twitter

Twitter introduced a new design to the web and mobile interfaces, making them more round. The changes were received with the expected polarization: some love it, some hate it. Just like sushi, it seems that there are few people in a middle ground stance.

I admit I like the new design, but not everything with it. For starters, I find that the typeface doesn’t fit well with the changes, as some other elements that kept the square look. So, to fix it and to decrease the roundness of some elements, I created a stylish theme for the social network.

Stylish is a browser extension for Firefox, Chrome and some other browsers (any browser based on the previous two will probably allow you to install it), that allows you to create and/or install themes to change some or all of the look of any website.

To install my theme, you just need to access it on website and click on the install button.


Moeditor, o melhor editor Markdown do mundo

Há pouco tempo, talvez 3 meses, achei que tinha de encontrar uma maneira de unificar a forma de escrita de notas rápidas, apontamentos e posts. Essa solução teria que me permitir definir algum tipo de estrutura, ser simples, portátil e, acima de tudo, future proof.

Não precisei de pesquisar muito para redescobrir Markdown.

Para quem não conhece, Markdown é uma linguagem markup criada por John Gruber e Aaron Swartz. O texto é escrito normalmente, como seria se estivessem a usar o bloco de notas ou um editor semelhante, e recorre a um sistema de caracteres super simples para a formatação, pensado na conversão para HTML.

Depois de optar por Markdown, faltava o editor. Mais uma vez teria que ser algo simples, porque a intenção é escrever e não fazer manutenção ou ter que usar o rato/trackpad. Foi assim que descobri o Moeditor, o melhor editor markdown do mundo! 🙂

O Moeditor está disponível para Linux, OS X e Windows. Mais, é software livre [ou opensource, se preferirem]; a licença é a GPLv3. Win Win (salvo seja!).

A aplicação tem as seguintes características:

  • utiliza a versão do GitHub para Markdown;
  • permite personalizar o tamanho e tipo de letra, e a altura da linha;
  • inclui pré-visualização em tempo real, simultânea e alternada;
  • disponível em vários idiomas;
  • vem com temas para destaque de código de algumas linguagens de programação;
  • e suporta expressões matemáticas para TeX.

O Moeditor está disponível no Github. Podem descarregar uma das várias versões disponíveis na página releases, ou clonar o repositório e ir acompanhando as alterações à medida que vão sendo feitas. Se optarem pela segunda, não se esqueçam de instalar as dependências.