US English language in Debian with proper weekdays and numbers

Our friends over there in the US like to have their own measurement systems, and they don’t stop there. They also like to start the week on Sundays. I hear this has religious reasons.

This leads to problems when you generally want to set up your Debian systems with plain old English (US) locales but need proper measurement units in your programs. One of the solutions here is the magical file /etc/default/locale. Here’s a screenshot of what amazing feats this can accomplish:

Screenshot_2016-07-15_12-39-44.png

My weeks start on Monday (as they should!) and I get European paper formats, Swiss date and time formats, but still have my precious English error messages. No one wants German nerdspeak, it’s gibberish! “Sendewarteschlangenlänge”? What does that even mean?

The beauty of the locale system is that you can mix and match any of these. You can have Portuguese weekdays with English error messages, Swedish currency and US paper formats.

First you have to generate all the locales you’d like to use (as root):

dpkg-reconfigure locales

Then just put whatever combination you like in /etc/default/locales and log out and back in again. Here’s an example:

LANG=en_US.UTF-8
LC_NUMERIC=de_CH.UTF-8
LC_TIME=de_CH.UTF-8
LC_COLLATE=de_CH.UTF-8
LC_MONETARY=de_CH.UTF-8
LC_PAPER=de_CH.UTF-8
LC_MEASUREMENT=de_CH.UTF-8
LC_ADDRESS=de_CH.UTF-8
LANGUAGE="en_US:en"

The system gets US English spelling and language, but the rest is in German (Switzerland). So we Swiss Franc as currency, ‘ as a thousands separator, etc. And this works both in pure console sessions and in most desktop environments.

Be careful, though. Some desktop environments (like Plasma) allow you to override these settings in your desktop session.

Did your mouse turn all weird in Debian and now you suck at Quake?

Update: This issue is largely resolved nowadays because modern desktop environments include configuration tools for libinput and its acceleration profiles.

If you have a recent Debian testing release, you might have noticed that your mouse now behaves very differently. For me, I noticed it when my aiming turned wobbly in Quake. Quake has extremely tight controls and shouldn’t feel as if you’re playing a 2016 console FPS with jelly dildos in place of fingers. So I was a bit surprised when it suddenly did. Also, I couldn’t reliably hit e.g. a close button on a window.

Continue reading “Did your mouse turn all weird in Debian and now you suck at Quake?”

To defend the free web, you must save Mozilla

TL;DR: Mozilla is largely dependent on Yahoo! We must make sure it is funded by individuals’ donations and a diverse roster of companies to keep it independent, to fight Google’s increasing browser dominance and to ensure our privacy. We must also let Mozilla know what we expect from them.

Read on to hear my reasoning.

Continue reading “To defend the free web, you must save Mozilla”

Decentraleyes: An additional defense against large companies analyzing you

I recently found out about the Decentraleyes add-on for Firefox. To understand why Decentraleyes is a good idea and why it can help you protect your privacy, here’s what’s been happening so far:

  1. Web developers all over the world have started using the same libraries of Free Software code to solve the same common problems. This is good.
  2. Web developers thought it would be a good idea to host this code on CDNs (distributed content delivery networks). This makes pages load faster and takes the (financial) burden of hosting them off the web developers. This is also good.
  3. Large companies like Google, Microsoft and Facebook – who make money by analyzing and recording your behavior in order to sell private details about you to other companies – have started offering such library hosting for free. This is bad.

Because every time you visit a website that refers to such a hosted library, and that’s hundreds of thousands or millions of websites, you give away your intentions to the company hosting the library. You tell Google where you’ve been on the Internet, and by pinging them every time you open any number of websites, they can track where you’re going, whether you’re using your phone, your tablet or your computer, when your preferred time for web surfing is, etc.

There is a reason these companies offer this hosting for “free”. It’s because you are the product, this data about you is aggregated and resold to advertisers. What’s worse, those companies can at any time introduce malicious code into your browser by changing the libraries they offer. Your browser will not be able to tell whether it is running a manipulated version of the code.

Because we won’t be able to convince web developers to do the right thing and either create a non-profit organization to securely host all these libraries or host the libraries on the websites themselves, you can only take matters into your own hands. Decentraleyes does this for you, by downloading all those libraries to your own computer and rerouting any request that would ordinarily go to a shared library server to your computer instead. It takes no configuration, you just need to install the Firefox add-on and that’s it.

This alone won’t be enough to win back your privacy, but it’s one building block. A free bonus is that pages that would normally use a CDN now load faster if you have this extension.

Another way to fix tearing and vsync issues using the Nvidia driver

Nvidia’s proprietary driver is notorious for having a lot of tearing and vsync issues. Even if you use their control panel to enable vsync, more often than not it will have no effect. I’ve seen this on a GTX 560, on a 650 Ti, 660 Ti, 860M. Previously I tried using compton to fix this issue, but compton sometimes makes e.g. video display sluggish or seems to add some delay and irregular framerate to games. This won’t work, since for games I want a constant framerate, and drops below 25 or so are unacceptable.

That’s when I found out about about the ForceCompositionPipeline option for the proprietary Nvidia driver. It can be used like this to enable it temporarily from the command line:

nvidia-settings --assign CurrentMetaMode="DVI-I-1: nvidia-auto-select { ForceCompositionPipeline = On }"

Or made permanent in xorg.conf:

Section "Screen"
    …
    Option         "metamodes" "DVI-I-1: nvidia-auto-select { ForceCompositionPipeline = On }"
EndSection

You’ll have to use something like xrandr to figure out the name of the output (in this example, DVI-I-1). Thank you, Mark Volker Dickmann, for this hint.

For news junkies who want to stay organized and happy: NewsBlur and TinyTinyRSS

In 2013, the famous online ad reseller Google shut down their Google Reader service. If you ask me, and I do have an arsehole as well as an opinion, it was to drive people towards their less customizable, not standards-based News product that they can pepper with ads. But there are other RSS clients and news readers, and of all of those I’ve spent almost two years with TinyTinyRSS and now a month with NewsBlur.

My heart is split in two between these: Andrew and Samuel are both interesting, and it’s fascinating to see how different from each other their visions are.

NewsBlur

NewsBlur is the brainchild of Samuel Clay. He didn’t just invent an RSS reader, he came up with a completely new visual style with warm, cofee-like colors and large, friendly interface elements. Hell, the logo is a stylized sun and if you sign up for a premium account, you get to feed his dog Shiloh, that’s how much good feeling is going on here.

newsblur

Each site also gets its own custom color bars to the left of it, based on its favicon. This doesn’t do much for things like YouTube, since all your YouTube channels will just have a red bar, but seeing The Register’s very black vulture favicon and equally black bars does set the mood. Some sites turn instantly recognizable from afar thanks to this, like DeviantArt with its trademark green or Phoronix with its, err, also trademark green. This helps pick things apart if you are ever viewing a list of all your news combined.

newsblur1

If you don’t like how things are displayed, the customization options, pictured above, are immense. You can also opt to view stories not in their summary RSS form but in the original, as they appear on the original website. But Samuel’s vision doesn’t stop at the visual style.

The service is set up so that you can share your favorite news with people. You can import your Twitter or Facebook friends, or you can skip all the social networking stuff and just follow people directly on NewsBlur itself. Then you get to see what news stories they share and can interact.

This news regurgitation goes one step further yet, NewsBlur gives you an optional BlurBlog, a page where your shared stories are published in a blog format so that even people without NewsBlur can follow them. Maybe someone even subscribes to that using TinyTinyRSS! Haha, wow, so funny. My BlurBlog is over there, by the way.

Another killer feature is that premium subscribers get is very fast updates for all the sites in their feeds, up to 10x a day. This is noticeable, once you have a decent list of feeds you can almost see their unread counters increase as you watch.

NewsBlur does something with machine learning, apparently you can let it know which articles you like and it will find more of the same, but I haven’t tried so I can’t comment.

There is a client for Android which works extremely well both on tablet and on mobile. Get it on F-Droid, it’s just called “NewsBlur”. I found especially the syncing very robust, I even slapped one touchscreen device with each hand like a spasming orangutan while watching NewsBlur in the browser and both devices’ interactions were replicated properly.

You can see that I’m gushing and totally happy with this. Of course I signed up for the ridiculously cheap premium account (US$24 a year at the time of writing). Take my cash and turn it into beautiful source code (and dog food), please!

If you don’t want any of this premium crap and would like to host NewsBlur yourself, of course it is Free Software. Go get the source.

TinyTinyRSS

TinyTinyRSS by Andrew Dolgov looks a little stark, a little utilitarian in comparison. But this isn’t bad, it allows you to focus on the content, and that’s the idea here, right?

original Screenshot stolen from Lifehacker Australia.

TinyTinyRSS is something you host yourself on your webserver, there is no hosted service or one of those crazy cloud things. It requires PHP and either MySQL or PostgreSQL, with PostgreSQL being preferred. I found setup to be quite easy and I was surprised by the quality of the upgrade process, in over two years not a single upgrade ever caused any issues. It feels like a tank, and I mean that in the good sense.

If you’re looking for a solution to host yourself that works on a broad range of web servers, even on some very cheap shared hosting solutions, and that you could potentially even use with your circle of friends or coworkers to make use of the news sharing service, TinyTinyRSS will do the job.

There are mobile clients for Android and Meego/Sailfish OS. Android even has two! One written by Andrew himself, which he makes money from, and one written by Nils Braden. I will not place a link to Google Play, not because I don’t want Andrew to make money, but because I don’t want Google to make money 🙂 Nah, just kidding, here’s Andrew’s client on Google Play and Nils’ client on Google Play. The Sailfish/Meego client comes to you courtesy of cnlpete.

I’ve used both clients on phones and tablets and I can’t say which one I prefer. They are quite similar in feature set and of course Nils’ client being Free Software may skew you that way.

Whether you want to host things yourself or have them hosted, share with the world or just with your friends, whether you’re on Android, Sailfish OS or your desktop, these are extremely competent Free Software news readers just for you.

Ebook market still broken

In the last 8 years or so, I’ve regularly looked at the ebook market to figure out if they’ve fixed it yet. In 2015 I can say: no, they haven’t. But there is a new star on the horizon, at least.

Let’s start with a harmless example: Out of the five sci-fi ebooks that Kobo recommends for 2014, they refuse to sell you three. They claim that the books are not available in your country, Switzerland in my case. However, if you check out the competition, you notice that even newcomers to the ebook market like Thalia/Orell Füssli have the ebooks. What’s even worse, Amazon will not hestitate to sell all those five books to you for Kindle.

So here we have Kobo, a company that claims to make premium ebook readers and offer one of the largest ebook collections in the world, unable to fulfill something that both their biggest competitor and complete newbies at this game can do. This shouldn’t be that way — if one company can offer an ebook in one territory, all the others should be able to do that, too.

On the DRM front, things are still broken as well. By far most ebooks are sold with DRM. Fortunately, some countries allow you to remove that DRM from your books, and I can only thank Apprentice Alf again for all his effort in making DRM cracking tools easy to use.

The broken state of the market means that:

  1. Amazon remains the supreme ironfisted ruler of all that is ebooks. Nothing can  compete with them right now. They appear to be able to even get around publishers’ territorial disputes, and their prices and selection are still better than the competition’s. At the same time, they cheat a dozen countries by not paying their taxes and they treat their employees like cattle, but that’s another story.
  2. You can achieve a similar selection to Amazon’s if you’re prepared to hunt through two dozen independent ebook stores for the title you want, and pay a little more for it. It will probably come as an Adobe DRM-encrypted ePUB file. Prepare to crack the DRM. If you’re in a country that doesn’t allow that, you’re fucked.
  3. Publishers and book stores still haven’t managed to find a strategy to kill Amazon, but there is movement on the front. The Deutsche Telekom and a series of German and Italian book store chains are trying with their Tolino alliance, and Tolino has everything it needs to turn into some real competition. The Tolino Cloud that syncs books you uploaded yourself plus books you bought from any Tolino alliance member to all your Tolino devices could be a killer feature.

I don’t know what could be the best interim solution until the market is fixed. Probably buying a Tolino Vision 2 and hunting for books all over, then cracking them and shoving them into your Tolino Cloud Reader so they get synced. You can even buy books from Amazon, crack them and convert them to ePUB using Calibre.

To help your hunting, here are some of my current favorite ebook stores, some even without DRM:

Maybe that helps! See you in two years for an update on the situation.

Presenting the EurKEYboard: A mechanical keyboard for Europeans and coders

For several months, I’ve been using Steffen Brüntjen’s EurKEY keyboard layout. That layout combines a general US feel with special characters for many western European languages.

That’s fantastic for programmers. You get easy access to keyboard shortcuts that would otherwise be impossible or in weird locations — try typing Alt-` on a Swiss-German keyboard for example, you’ll find it’s impossible.

When it comes to braces, most keyboard layouts in Europe are a nightmare. Some require shifting, some require alt-shift to get to the braces and quotes you need several hundred times a day as a programmer. EurKEY instead makes all  manner of braces available with one keystroke, just like on a US keyboard. This makes it much more relaxing to type, whether on the shell, in an editor or in some heavyweight IDE.

Translators are happy as well. Once they’ve memorized the positions of the special characters they can do three-way translation between e.g. Icelandic, Spanish and German without ever switching the layout or memorizing new finger chords.

The only downside? I always wanted to peek at something to see where the special characters are, and looking at a printout of the layout became tedious. So why not create a EurKEYboard in hardware, with all the glyphs printed right on it, and upgrade my plastic piece of crap to a lovely mechanical keyboard in the same step?

This is how I came to be the proud owner of the world’s first EurKEYboard. Behold:

IMG_1292

That be still fresh in its packaging, yo.

You can have a closer look at the workmanship and some of the glyphs:

IMG_1293

And here’s the other side, with the important braces:

IMG_1294

Sorry about the shitty photography.

Now, I’m sure that if you’re European, a translator, a programmer or all of the above, you want to have one of these. In our usual, greedy world I’d be saying, “hand me US$200 and you can have one.” But because I believe in sharing, I’m instead saying “hand US$150 to wasdkeyboards.com and you can have one. Or ten.”

I’m releasing my keyboard layout for printing on their keyboards, it’s on GitHub. Just make sure to open the layout in Inkscape, enable any layers you want (you can put a Windows icon where my Debian swirl is, for example), then convert each layer to a path and boom, there you go, printable layout.

After that, proceed to wasdkeyboards.com, choose a custom Mechanical Keyboard V2, color all the keys the way you want them and attach the SVG of your custom layout. A few days later, the mailman will ring with a EurKEYboard for you. I’ve included two alpha layers as well, one with Mozilla’s Fira Sans font for the main keys, the other with Adobe’s Source Pro Sans.

An input method for Chinese in KDE 4

If you need Chinese character input in KDE (typing in pinyin and then selecting the correct word), it’s quite simple on Debian GNU/Linux:

apt-get install task-chinese-s-kde-desktop fcitx-pinyin

That’s all there is to it. Afterwards you should be able to start fcitx in KDE and you get a new icon in your system tray. Go there to configure your input methods. By default, ctrl-space will switch to another input method, if you don’t have anything else installed, that will be pinyin input. Ctrl-space again will take you back to one of your previous input methods.

This is what it looks like in Konsole:

ni_hao_konsole

Nice and clean.

A secure, free alternative to WhatsApp that is fully under your control

Update: Nowadays, better look into a Matrix homeserver.

With Facebook’s acquisition of WhatsApp, many people are turning to alternatives such as Threema or MyEnigma. But these alternatives, while offering better security than WhatsApp, are still based on proprietary technology and controlled by a single company. Also, they have somve privacy issues:

  • Threema requires that you have the Google apps installed on your Android phone. This is nonsense, since you can buy the .apk file directly from Threema, but cannot use it unless you have the Google apps, and in that case you could have bought it through Google Play as well.
  • Threema uses Google Cloud Messaging for notifications. That means Google still knows about your chat activity.
  • Threema and myEngima are both closed source, so you cannot be sure what they actually do. You also cannot get them through F-Droid or other app stores that carry Free Software.
  • myEngima seems to not be available through any other means than through Google Play. Update: This is wrong, myEngima customer support gave me a direct URL to the .apk file. I just don’t know if they use Google Cloud Messaging, they didn’t respond to that.

If you want to avoid these problems, you can, thanks to Free Software. You can offer your friends and family your own solution for chatting, and as a free bonus, this stuff comes with full desktop support, not just mobile. So you can transparently chat with your friends either from a mobile device, your tablet, your laptop or your desktop, and you have the full source code of all the components involved.

Did I mention it’s encrypted end to end and very simple to use? No? It’s that, too.

All you need to do is:

  1. Set up your own XMPP server. I can recommend Prosody. It’s very easy to set up and has Debian packages available.
  2. Make your friends install ChatSecure. On Android, this is also available from F-Droid. Inside Apple’s golden cage, it’s only available from Apple’s store I guess. It might be on Cydia, but I don’t know of a way to check.
  3. Create accounts for your friends on your XMPP server. Enable the ‘muc’ module if you want to allow group chat via conferences.
  4. Make everybody connect. As an extra bonus, make everybody exchange fingerprints so you can have secure end-to-end messaging.

You might want to consider restricting connections to SSL-only so all possible channels are encrypted.

If you don’t have hardware you control yourself, Prosody is very resource-friendly and runs fine even on very small virtual servers you can rent somewhere. There are services like gandi.net that are reasonably protective of your privacy.

Let me know how this works out for you.