Posts in "linux"

Using a fingerprint-reader on Thinkpad with Linux

I had the problem that just using fprintd on my system as an authentication-method lead me to a state where I always had to input my fingerprint or fail three times until I could finally type my password. In the pam.d-config-files not fprintd should be used but fingerprint-gui. That works then also for the TTYs and when you have registered several fingers, you can use them all and not only your right index-finger for authentication. There is an Arch-How To for this: https://wiki.archlinux.org/index.php/Fingerprint-gui

Installing Oracle JDK in Mint

When I installed the Android Developer Studio and started it, I got the message that OpenJDK has performance issues and that one should install the JDK/JRE by Oracle. Oracle offers only tar-balls and rpms, thus I needed to find a way to install it. Thanks to Google the solution wasn’t far away but for making it easier findable for me, I post the way I did it in the end here as well in a more generalized way.

Download the JDK from Oracle, then start by removing OpenJDK:

sudo apt-get update && apt-get remove “openjdk”

Then go to your downloads-directory and untar the tar.gz (tar -xzvf jdk-$version)

Create a folder in /opt for the jdk:

sudo mkdir -p /opt/java

Move the JDK to the folder:

sudo mv ~/Downloads/jdk$version /opt/java/

Make the JRE and JDK the default sudo update-alternatives –install “/usr/bin/java” “java” “/opt/java/jdk$version/bin/java” 1

sudo update-alternatives –set java /opt/java/jdk§version/bin/java

sudo update-alternatives –install “/usr/bin/javac” “javac” “/opt/java/jdk$version/bin/javac” 1

sudo update-alternatives –set javac /opt/java/jdk§version/bin/javac

Switching from OS X to Linux

After my switch from iOS to Android, I switched now from OS X to Linux. I wrote already about my reasons for switching. I switched in 2004 from Linux to OS X because my laptop got stolen and I needed a new one. My requirements were a unix-style operating system where I have nothing to do to make it work and a small laptop with great battery runtime. The iBook 4G 12" was the best in that regard back then. Last year I tried my luck with running Linux for 30 days and talked about it in some podcast-episodes of mine. The short version: running Linux from a USB-stick on a MacBook Air is not a very bright idea to get to know if Linux is any good. It works somehow, but not well.

But in the last couple of months or maybe it is a process which went already for a year or longer, I moved more and more of my workflow to open source-tools that are also available on Linux. The last things that were a problem were my iPhone, OmniFocus and 1Password. Since I switched now to Android, the iPhone is no problem anymore. Because the OmniFocus-client I tried on Android wasn’t good enough, but the todotxt-client <a href=“https://play.google.com/store/apps/details?id=nl.mpcjanssen.todotxtholo"Simpletask (Cloudless) was really good, I switched my todo-workflow over to todo.txt. So the next hurdle was gone. And then I found out that you can run 1Password 4 in wine with working browser-extensions. So somehow the most important parts should work. I thought several times about switching to Linux but thought that I actually like my MacBook Air and have no real issues with OS X, so there is no good enough reason for it. But then one of the laptops in our household is on the verge of dying and a new Apple-computer is just too expensive right now. So I decided to go for a used Thinkpad X201. I added a 250GB SSD, got me a docking station and will get a 9-cell-battery in the near future. That is still cheaper than a used MacBook Air and far cheaper than a new laptop.

This blog post is about my experiences with getting the laptop up and running to a state that I want to and can work with. You will find some advice, links and nice software I found.

Installing Linux and first software

I started out with installing Mint 17. Why Mint? Well it is partly the fault of @tante. I asked him what I sould use: Ubuntu, Mint, Arch or Gentoo and his anser was Mint. Arch and Gentoo are closer to the bleeding edge and need more maintenance and Ubuntu is often a bad fork according to him. And what I read in the past it seems that Ubuntu goes more and more its own ways and therefore might get shunned from the community. The latter one is just my own concern. Installing Mint on the X201 was a breeze. It installed and every piece of hardware in the laptop worked out of the box. When I put the laptop into the docking station, everything continued to work and even using a secondary display over the display port worked. My secondary display is an old TFT-TV which I got only correctly to work with OS X with the help of SwitchResX and fiddling around. With Mint, it worked out of the box. So far so good.

Installing software was mainly no problem. Steam was installed fast and it didn’t need long until I could play my first games of VVVVVV, Super Hexagon, Super Meat Boy and Shadowrun Returns on my Linux-machine. In comparison to the past, I could suddenly play the games I want to play problem free on Linux. What a blast.

The version of vim is something like 300 patches behind in the repositories of Mint, so I had to compile it by myself. That was rather easy by following a guide called Building Vim from Source.

Let the fun begin

And then I started with the not so easy stuff. I wanted carddav-sync for syncing my contacts between my phone, my laptop and owncloud. I needed caldav-sync with calendars from iCloud, I wanted emulation of retro-console- and arcade games, I need Japanese input, I want to use mutt instead of a GUI-mail client, I need 1Password etc.

Syncing Carddav with owncloud

There are two ways I got cardday-syncing to work. But first you need the correct URL from Owncloud. I got the working one from logging into my owncloud, going to contacts and then push in the lower left corner the button for the Carddav-Link (a small globe). Mine looks like:

owncloud.foo.bar/remote.ph…

And after getting that, which was actually the hard part because I couldn’t find it and googled which led to lots of wrong results, it was easy to get it working.

Number one is Evolution. There you can add a new addressbook with your credentials and the link and then it just worked for me. Number two is pycarddav. That worked as well, but I have no idea yet, how to get stuff into it. But at least I can pull my addressbook. I have a cronjob that runs it every 10 minutes. And with pycarddav I have an easy way to get completions for addresses in mutt.

I cannot recommend Thunderbird for syncing with carddav because Thunderbirds sync can only pull one e-mail-address from a carddav-addressbook per user. And if there are multiple addresses, it will choose one randomly.

Syncing calendars from iCloud

My wife is still all Apple and we need shared calendars, so I haven’t have a look yet how owncloud works with multiple users, calendar sharing and I remember only that it wasn’t that easy to get it to sync with OS X and iOS. So we still use iCloud for our calendars. The problematic part was again finding out the right URLs. I used a software from http://icloud.niftyside.com/ which I installed on my Uberspace. It was just unpacking it into a directory of the webserver and visiting the site. Then entering my credentials and I got all the URLs. There is even a URL for carddav, so you might even be able to sync your contacts with iCloud.

I am using again Evolution to sync my calendars. It works fine.

mutt and offlineimap

I had already settings which worked quite well but needed a bit of fixing up. I followed mainly The Ultimate Guide to Mutt to get everything to work. The only real problem I had in the end was getting offlineimap working as a cronjob. I ended up putting my passwords into the .offlineimaprc because I just couldn’t get Gnome Keyring to work with a cronjob and only the pure offlineimap-command worked in a cronjob. When I used for example “offlineimap -q -f INBOX -u quiet”, it didn’t work. Only “offlineimap -u quiet” (or whatever interface you want) works for whatever reason. I added hooks for Mairix in offlineimap and added a keybinding in mutt for doing a fast-sync of the inboxes, when I see on my phone that mail arrived and I am too curious.

Emulation

In the beginning it looked a bit desperate in terms of emulation. I only found command line emulators and had problems getting everything to work. But then I found solutions. a) Nintendo-consoles (NES, SNES, GBC, GBA): Higan which is in the repos of Mint 17. b) Sega-consoles (Master System, Game Gear, Mega Drive/Genesis + CD + 32X): Kega Fusion which I needed to install from the site

For arcade games you can search for MAME and for the rest you might have to use a command line-client.

If you use an XBox360-pad there is a better driver than the built-in one which is called xboxdrv. If you need to map your joypad to keyboard-buttons there is the tool QJoyPad which does it. It is a bit weird to use, but it works.

The rest

The easiest way to get Japanese input working was ibus with anthy. As dictionary software I am using gjiten and installed additionally the wadoku in the edict-format.

For syncing I am using Bittorrent-Sync which has nowadays a nice GUI-tool in Linux as well: Linux Desktop Gui Unofficial Packages For Bittorrent Sync.

I am accustomed to have escape and control on my caps-lock-key. Control for key-combinations, escape when I just press it. This is great when you use vim a lot. For getting this mapping to work, I use xcape. This works only in X, but on my private laptoop I am most of the time in the GUI anyways.

For getting 1Password to work, I have a blog-post for you. If you are a YNAB-user, it works fine in Linux with wine as well.

After testing out several Twitter-clients in Linux, I ended up using the Chrome-app of Tweetdeck which works quite well. For App.net there is Cauldron which works as good as on Windows and OS X.

For music I am using Google Music All-Access in combination with the Nuvola Player. With that player I get native integration into the desktop with Google Music, at least as native as it gets with Flash in the app. I get notifications for song changes and can use the media keys of my keyboard.

My GUI-client for todo.txt is DayTasks which is better than the other clients I tested. It is quite nice, when I do not want to use the command line interface of todo.txt.

The only thing which I did not figured out yet is a workflow for creating screencasts for Let’s Plays. There is ScreenStudio but this didn’t really work in an initial test. And from time to time Cinnamon just freezes - everything freezes except the cursor. Restarting X helps but this is not really satisfying. I did not yet find out what the reason might be.

Conclusion

So far I am positively surprised. The hardware worked out of the box and the laptop is really neat. If I wouldn’t have certain demands, I could have started to work directly after the installation of the system. The system is really fast, the fans are not too loud, when I am running tons of stuff, it seems to have lower RAM-needs than OS X and all in all it works and is pleasant to use. I enjoy having the docking station which makes live easier since I do not have to unplug my external HDDs and controllers when I take my laptop with me, but just remove the laptop from the docking station. I wonder if I stay as satisfied with this system, as I do with my Android-phone right now. Would you have told me a couple of months ago that I go from all OS X and iOS to Linux and Android, I would have laughed. But right now, everything works and is fun to use. I wonder what I will think in a couple of months once the novelty has worn off.

1Password 4 in Linux

First: huge thanks to @thatswinnie and @PhilippeLM . Winnie for pointing me to Philippe and Philippe for pointing me to the right forum-entries and his helpful posts to get it to work in Linux with 1Password 4 and Firefox. Supposedly it works with the Chrome-extension, too.

Please take note that this solution is not officially supported by AgileBits and can probably break with any update. But let’s hope that it doesn’t.

So 1Password is a pretty popular password-manager for OS X and there is also a version available for Windows. In addition there are great companion apps for iOS and Android[footnote]I am syncing the different installations with the help of Bittorrent Sync. OTA-sync with my own infrastructure. The iOS-version gets synced via iTunes.[/footnote]. Since I have licenses for all the versions, I wanted to continue to use it on Linux. But how?

First you have to install Wine. There should be a package for it in the package manager of your distribtion. Then start Wine once, so it can configure itself.

Next up, download 1Password for Windows and open the downloaded exe. It should be opened by Wine and start the installer. Just let it do its thing. Then you have to edit the following file ~/.wine/user.reg[footnote]The reg-files are representations of parts of the windows-registry for Wine.[/footnote] for disabling browser validation. Search for [Software\AgileBits\1Password 4] and add beneath it a new entry:

“VerifyCodeSignature”=dword:00000000

Save the file, open 1Password and restart the 1Password Helper. This option is in 1Password in Help - Restart 1Password Helper.

Then you have to download and install the Browser-Add On/extension from AgileBits. Restart your browser and it should work. I had to restart the 1Password Helper once more and after that it worked flawlessly for me.

Update: I have now my real machine and couldn’t get it to work even with this manual. To get the 1Password-extension working I had to open the preferences of 1Password, had to go to the Browsers-tab and check “Unlock on Secure Desktop”. After a restart of Firefox, it worked.

Wörterbücher im Netz und auf dem Rechner

Nach einem Artikel über iPhone-Apps zum Japanisch-Lernen und Artikel zu Wörterbüchern auf dem iPhone, gibt’s nun etwas Material zu Wörterbüchern im Netz, für Mac OS X und Linux. Dies hier soll eine Übersicht bieten. Die meisten Anwendungen, die ich hier erwähne nutze ich selber schon ziemlich lange. Ich erhebe keinen Anspruch auf Vollständigkeit.

 

Online

Wadoku.de: Das Wadoku ist wohl das bekannteste japanisch-deutsche Wörterbuch im Netz sein. Selten trifft man auf fehlende Wörter und findet man doch einmal ein Wort das fehlt, kann man es relativ einfach selbst registrieren. Zum Zeitpunkt des Artikels sprechen sie von ca. 250.000 Einträgen.

 

Japanisch-Deutsches Kanji-Lexikon: Das Japanisch-Deutsche Kanji-Lexikon ist, wie der Name sagt ein Wörterbuch um Kanji herauszusuchen. Meines Wissens nach die einzige Möglichkeit im Netz nach deutschen Übersetzungen von Kanji zu suchen.

WWWJdic: Das WWWJdic ist ein Interface für mehrere Online-Wörterbücher. Das Bekannteste dürfte hierbei wohl das edict sein. Ein sehr umfangreiches Wörterbuch das Japanisch-Englisch spricht. Es ist auch ein Interface für das Wadoku, wobei es meines Wissens nach nicht so aktuell ist wie das “richtige” Wadoku sondern immer ein etwas älterer Snapshot. Ein weiteres interessante Wörterbuch im WWWJdic ist das enamdict. Wer sich schon mal mit japanischen Namen auseinandersetzen musste, wird wissen wie schwer es ist Lesungen dafür herauszufinden. Das enamdict ist dann das passende Wörterbuch hierfür. Allerdings muss man warnen, dass man bei Namensübersetzungen von Autoren deren Werke man zitieren will, besser noch einmal Google eingehend befragt, da viele Namen mehrere Lesungen besitzen und man sich nie 100% sicher sein kann, wenn man Autorennamen und Lesung nicht nebeneinander stehen gesehen hat. Das WWWJdic hat außerdem auch eine sehr brauchbare Möglichkeit um Kanji nachzusehen. Als Datengrundlage benutzt es das kanjidic.

ALC: Habt ihr mit sozialwissenschaftlichen Texten (z.B. Texte aus der Politik oder Wirtschaft) zu tun werdet ihr des öfteren an die Grenzen von Wadoku und Edict stoßen. Dann ist ALC, ein erweitertes Interface zum Eijirō euer Freund. Es enthält nicht nur den Content des Eijirōs, sondern auch viele Beispielsätze und daher kommt seine Stärke. Viele Wörter wird man nur in Beispielsätzen und deren Übersetzung finden und kann daran sehen wie bestimmte Wörter benutzt werden. Außerdem hat es im Bereich Wirtschaft und Politik noch einiges mehr an Wörtern als die obigen beiden.

Denshi Jisho: Denshi Jisho ist ein weiteres Interface für edict und kanjidic. Allerdings sieht es um einiges hübscher aus als das WWWJdic. Beim kanjidic bietet es ein schönes Ajax-Interface um sich Kanji zusammen zu klicken. Besonders nützlich ist dies auf dem iPhone, da es hierfür ein angepasstes Interface gibt, das schnell und zuverlässig funktioniert.

Kotobank: Seit einiger Zeit gibt es ein freies Japanisch-Japanisch-Wörterbuch im Netz: Kotobank. Es speist sich aus einer ganzen Reihe Wörterbücher und ist eine wirklich feine Sache. Natürlich ist so etwas nur für fortgeschrittene Lerner.

Popjisyo: Popjisyo möchte ich hier nur für eine Funktion erwähnen: seine Bookmarklets. Ein Bookmarklet ist ein Lesezeichen, das Javascript enthält und dann etwas mit der Seite tut auf die man es anwendet. Nutzt man die Bookmarklets von Popjisyo kann man auf einer japanischen Seite über die Wörter fahren und bekommt Lesungen und Übersetzungen. Es gibt sowohl eins für Deutsch als auch für Englisch. Da es ein Bookmarklet ist funktioniert das Ganze browserunabhängig.

Rikaichan: Der einzige Grund warum ich manchmal zum Firefox greife ist Rikaichan. Dies ist ein FF-Plugin, dass an sich das Selbe macht wie Popjisyo aber schneller und zuverlässiger ist. Darüberhinaus kann man auch mehrere Wörterbücher gleichzeitig verwenden für die Übersetzungen. Damit habe ich das umfangreichere Japanisch-Englisch-Wörterbuch, ein japanisch-deutsches und das enamdic zur Verfügung.

Reading Tutor: Der Reading Tutor ist ein Projekt der Tokyo International University. Er ist nützlich beim Lernen von japanischen Texten. Man wirft einen japanischen Text rein und bekommt diesen mit einer Wörterliste raus. Jede Vokabel, die er erkannt hat, ist dann verlinkt und drückt man auf den Link bekommt man rechts in einem Frame die entsprechende Vokabel angezeigt. Zusätzlich wird diese dann einer Vokabelliste hinzugefügt (bei einem Test während des Schreibens dieses Artikels hat diese Funktion allerdings nicht funktioniert). Der Reading Tutor kann Japanisch-Japanisch, Japanisch-Englisch, Japanisch-Deutsch und mehr. Vor Popjisyo und Rikaichan definitiv noch nützlicher gewesen aber zu Übungszwecken immer noch brauchbar.

 

Mac OS X

JEDict: Es gibt für den Mac sicherlich noch mehr Anwendungen als JEDict aber keine hat sich über die Zeit als so nützlich herausgestellt. JEDict ist Shareware und erlaubt in seiner nicht registrierten Variante nur die Benutzung von edict und kanjidic. Registriert man es jedoch ($25 normal/$15 für Schüler und Studenten) kann auch weitere Wörterbücher im edict-Format nutzen. Auf Jim Breen’s Japanese Page gibt es eine Liste mit weiteren Wörterbüchern. U.a. gibt es auch welche mit Spezialvokabular für Jura, Informatik, Buddhismus und mehr. Das Wadoku gibt es hier im edict-Format. JEDict erlaubt es nun offline über alle installierten Wörterbücher gleichzeitig zu suchen. Zusätzlich hat es auch einen Service um nach Wörtern zu suchen und überwacht die Zwischenablage. Kopiert man also ein Wort, brauch man nach dem Wechsel zu JEDict nur noch Enter zu drücken um danach zu suchen. Außerdem kann man nach Kanji suchen in dem man sie zusammenklickt oder auch per rudimentärer Handschrifteingabe. Neue Wörter kann man über ein Userdict hinzufügen.

Jisho: Jisho von Sugoisoft ist eine Shareware, die $17 kostet. Es benutzt das JMDict und kann daher sowohl Englisch als auch Deutsch. Sein Interface ist sehr simpel und erlaubt nur die einfache Suche nach Wörtern. Schaue ich mir seit Jahren immer mal wieder an aber es ist dem obigen JEDict einfach weit unterlegen, da es weder eine ordentliche Kanji-Suche noch die Verwendung mehrerer Wörterbücher erlaubt.

Live Dictionary: Über Twitter wurde ich auf Live Dictionary aufmerksam gemacht. Es verspricht unter Mac OS X das Selbe zu leisten wie Rikaichan, allerdings für Safari. Aus meinen früheren Erfahrungen war es ganz nützlich, nur hatte ich den Mehrwert gegenüber Popjisyo oder Rikaichan nicht wirklich gesehen, wenn man es nur für Japanisch nutzen will. Vor allem, weil es knapp 18€ kostet und die anderen beiden Lösungen kostenfrei zur Verfügung stehen. Gegenüber den anderen beiden Lösungen bietet es allerdings noch eine größere Anzahl weiterer Sprachen an (z.B. Chinesisch, Schwedisch, Türkisch…). Bei meinem erneuten Test vor ein paar Minuten wollte es leider einfach nicht funktionieren, daher kann ich nichts zum aktuellen Stand der Software sagen. Im Forum der Anwendung gibt es auch einen Eintrag wie man die Anwendung für andere Anwendungen (z.B. Mail) benutzen kann.

 

Linux

GJiten: Für Linux ist mir an sich nur GJiten bekannt. Ein sehr einfacher edict-Client, der aber auch das Arbeiten mit mehreren Wörterbüchern unterstützt. Unter FreeBSD habe ich ihn leider nie zum Laufen gebracht.

Tagaini Jisho: Heute bin ich noch über Tagaini Jisho gestolpert. Dieses ist betriebssystemübergreifend und damit mit Windows, Mac OS X und Linux benutzbar. Es scheint das edict und kanjidic zu benutzen. Es soll nicht nur zum Nachschlagen sondern auch zum Lernen verwendet werden. Man kann hierfür Wörter einer Vokabelliste hinzufügen, die durch das Programm abgefragt wird. Allerdings ist es eine ziemlich hässliche Java-Anwendung.

Wadoku-Notify: Wadoku-Notify wurde mir vom Entwickler per Mail zugetragen. Wadoku-Notify kann man sich laut ihm wie ein systemweites Rikaichan vorstellen. Allerdings greift es auf das Wadoku zu und nicht auf das JMDict. Laufen tut das Ganze aktuell unter Linux, Windows und auf dem Nokia N900. Eine OS X-Version ist wohl in Vorbereitung. Der Sourcecode ist auf github zu finden. Getestet habe ich die Anwendung selbst nicht.

Über Ergänzungen, Kommentare und Fragen freue ich mich wie immer :)