geekices

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.

geekices

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/freetype2.sh 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! 🙂