🌞   🌛

linux

  • There is a flatpack for signal-desktop. Thus it can be also used on Fedora for example

    flatpak --user install --from [flathub.org/repo/apps...](https://flathub.org/repo/appstream/org.signal.Signal.flatpakref)

    You cannot migrate your data from the Chrome-App though.

  • If you need a pdf viewer on your open source-OS (I tested it on Linux and FreeBSD), you should try PDF studio viewer. Very fast and can do stuff like removing layers from the PDF https://www.qoppa.com/pdfstudioviewer/

  • Some plaintext-productivity love with Taskpaper

    I finally got my plaintext-todo-system together. It was a bit cumbersome because I did and could not want to use Dropbox, but it works now. The problem is that some of my machines either run FreeBSD or OpenBSD and all the plaintext-productivity apps on iOS either require Dropbox or iCloud[footnote]To be honest, I do not understand why so many iOS-apps expect a Mac on the desktop. Do so many iOS-owners also own a Mac? I would expect that most actually own a Windows-machine[/footnote]. I have a Nextcloud but the Nextcloud-client on iOS does not really integrate into iOS and nearly no one offers to sync with something else than iCloud or Dropbox on iOS.

    But there is a really good git-client on iOS: Working Copy. And there is a really good markdown-editor, that also has taskpaper-support and integrates with some workarounds with Working Copy: Editorial[footnote]It does not integrate as Textastic but that might come in the future[/footnote].

    The final piece that was missing where some reminders which work somehow automagically. There is a way to create iOS-reminders in Editorial from Taskpaper-files but there I would need to run a workflow in Editorial manually to create them. And I wouldn’t get a mail in the morning with a summary of tasks that are due, overdue etc. But I have now some scripts and cronjobs which create the mail and will send out push notifications via Pushover[footnote]I use Pushover because our Icinga2, the monitoring system we use at work, already uses pushover to send notifications when an alert is coming up.[/footnote].

    How does it work?

    I created a git-repo on my server. And have it checked out on my clients and in the home-directory of my user on the server. When I change something on the clients, I commit and push to the server. On the server there is cronjob in the crontab of my user running every minute to pull the repo. Additionally there is a cronjob running a python-script that checks if a task has an alarm set. If one is set, it will send the task as message to pushover, which sends a push notification to my iPhone. At 4 am in the morning there is an additional cronjob that runs a script that will generate a summary mail and sends it to me via e-mail.

    The scripts expect the following tags, so that they can work:

    • @today or @due[YYYY-MM-DD]
    • @alarm[YYYY-MM-DD HH:MM]

    The basis is the Taskpaper-Parser from github-user kmarchand. My push-script is a derivate from the script[footnote]Please forgive me since I am not very knowledgable in the arts of programming and just hacked around to get a works-for-me-thing[/footnote]:

     

    [code language=“python”] from datetime import datetime, timedelta from collections import namedtuple from dateutil import parser import sys import re import httplib import urllib

    tpfile = sys.argv[1]

    with open(tpfile, ‘rb’) as f: tplines = f.readlines()

    Flagged = namedtuple(‘Flagged’, [‘type’, ‘tasktime’, ‘taskdate’, ‘project’, ‘task’]) flaglist = [] errlist = []

    project = ''

    for line in tplines: try: if ‘@done’ in line: continue if ‘:\n’ in line: project = line.strip()[:-1] if ‘@alarm’ in line: alarmtag = re.search(r'@alarm((.*?))', line).group(1) tasktime = datetime.time(parser.parse(alarmtag)) taskdate = datetime.date(parser.parse(alarmtag)) #print(tasktime) #print(taskdate) flaglist.append( Flagged(‘alarm’, tasktime, taskdate, project, line.strip())) except Exception, e: errlist.append((line, e))

    today = alarm = overdue = duethisweek = startthisweek = None today_date = datetime.date(datetime.now()) today_time = datetime.time(datetime.now()) time_tmp = datetime.now() - timedelta(minutes = 1) today_time_less1min = time_tmp.time()

    for task in flaglist: if task.type == ‘alarm’ and today_date == task.taskdate and today_time > task.tasktime and today_time_less1min < task.tasktime: alarm = True #print ‘\t[%s] %s’ % (task.project, task.task) conn = httplib.HTTPSConnection("api.pushover.net:443") conn.request("POST", "/1/messages.json", urllib.urlencode({ "token": "APP-Token", "user": "User-Token", "message": task.project + " " + task.task, }), { "Content-type": "application/x-www-form-urlencoded" }) conn.getresponse() if not alarm: print ‘\t (none)’ [/code]

    It is simple, it could be probably far more elegant but it works for me™.

    In addition there is a simple shell-script[footnote]I am running it on my FreeBSD-server, thus the path to python is /usr/local/bin/python2 - when you are running Linux the path is probably /usr/bin/python2[/footnote]:

    [code language=“bash”] #!/bin/sh /usr/local/bin/python2 /home/user/python/tpp.py /home/user/taskpaper/Work.taskpaper > /tmp/taskpaper.mail /usr/local/bin/python2 /home/user/python/tpp.py /home/user/taskpaper/Personal.taskpaper >> /tmp/taskpaper.mail mail -s ‘Your Daily Taskpaper Summary’ my@mailaddress.org < /tmp/taskpaper.mail [/code]

    And here is my crontab:

    [code]

            • /bin/sh -c ‘cd ~user/taskpaper && /usr/local/bin/git pull -q origin master’ >> ~/git.log
            • /usr/local/bin/python2 /home/user/bin/tpp_alarms.py /home/user/taskpaper/Work.taskpaper
            • /usr/local/bin/python2 /home/user/bin/tpp_alarms.py /home/user/taskpaper/Personal.taskpaper 0 4 * * * /home/user/bin/taskpaper_mail.sh [/code]

    Since I am running FreeBSD on my server I have to rely on a crontab and cannot use systemd-timers.

    On my computers I am an avid vim-user and I use taskpaper.vim for having syntax highlighting and some additional shortcuts for marking tasks as done or today etc.

    In Editorial I use the Working Copy-workflow.

    It is all very simple and not very elegant. But it works and brings me the funtcionality I was missing from using apps like Todoist or on the “local” level Taskmator. And everything runs on my own machines except the delivery for the push notifications. But the only chance to get there my own solution would be to develop an iOS-app because you can’t get in any other way push notifications to your iOS-device. And if I should switch back to Android at any point, I still can use pushover. I pushover goes down, I hope there are alternatives… ;)

  • Current state: looking into a book about shell scripts and I wonder which she’ll they use. sh or do I need bash? How about other shells?

  • TIL: the Debian-installer calculates in base 10 and fdisk in base 2. Why Debian, why?

  • Recently the quickest fix to solve network problems for me is just to stop and disable NetworkManager…

  • Btw. any ideas which password manager besides LastPass works on iOS, Linux, FreeBSD and OpenBSD (sync with Nextcloud)?

  • Here is a real neat and simple vim-plugin-manager: https://github.com/junegunn/vim-plug

  • F U NetworkManager

  • TIL: Thanks to the commit messages and FreshPorts FreeBSD has actually good change logs which I really miss with Linux distributions

  • I just figured out that I can let xscreensaver play random videos via mplayer. Now my screensaver is a random collection of speed runs :D

  • Switching and Linux, macOS, Android and iOS

    TL;DR: Yay Linux, Nay Android. Let’s stay with Linux but switch back to iOS.

    Recently I am thinking about getting a new computer and phone and whether I should go back to macOS and iOS. I am using Linux and Android for a couple of years now and I am thinking recently about getting new devices. Let’s talk about computers first.

    macOS and Linux

    macOS is a really nice operating system. It is not open source but thanks to homebrw etc a lot of open source-software runs on it and the command line environment works as expected. Besides that you get a lot of commercial software from big and small companies that you either get on Linux or which you just do not get in that quality on other operating systems[footnote]An example would be OmniFocus…or anything else by the OmniGroup. Or OpenEmu which rocks still a lot more than RetroArch or EmulationStation[/footnote]. Additionally you do not need to tinker with them. Most of the time stuff just works.

    But for one I like using open source software even though not everything works always. Just yesterday I tried using the proprietary NVIDIA-driver on Fedora 25 and failed miserably which led me to re-installing the system[footnote]which took like 15 minutes plus installing a bit of extra software and updates…thanks to enough bandwidth that’s not taking long as well.[/footnote] but eventually I will get it to work or the open source-driver might even be working well enough which I actually didn’t test yet. Or podcasting doesn’t work as smooth for me as it does on macOS. But I am getting it to work eventually. And nowadays most of the normal stuff just works. Especially when you are using Ubuntu. 16.04 was a “just works”-experience, even after moving my SSD from a Thinkpad X201 to a Dell T3500 with two NVIDIA-cards and a Xeon. The upgrade to 16.10 worked as well. I guess I wouldn’t have there any problems with podcasting, too. Playing games is possible nowadays as well with Steam etc. My recent problems came from trying to get NVIDIA-drivers to work in Fedora 25 which I like for some reason more than Ubuntu. The only thing that I dislike about Linux is that there is no backup-solution like Time Machine. TM is just awesome. But for most of the other stuff modern Linux-distributions just works. And there is even a simple solution for backups but it is not as good as that for macOS. All in all the pros of Linux, be it that it is open-source or that I can run it on commodity hardware just outweighs the cons of macOS with its high prices and hardware that is not servicable at all anymore.

    iOS and Android

    Android is quite nice in the customizability-department and there is some stuff you can’t do with iOS. For example syncing a single folder in my Dropbox with a single folder on my device, or doing the same with Bittorrent Sync. But nowadays I don’t use capabilities like that really a lot. I like to customize my device though. And buying games for cheap via HumbleBundle is great. And now comes the big “but”. And it is updates. First I owned a Moto X, now an LG G4. Both companies said that they will release updates a short time after Google released the updates. This didn’t happen. In addition Android seems all in all less secure than iOS. I am not even talking about installing apps from outside the Play Store. That’s a matter of using your brain. But the Play Store has from time to time malware and the Stagefright-stuff is frightening. If I am not mistaken I have several public known security bugs on my phone which aren’t patched by LG in a timely manner. That sucks. And the devices by Google cost now as much as iPhones and have an update guarantee of two or three years max. And I cannot install a custom ROM that might get more often updates since that would break my warranty because I would need to unlock the bootloader of my phone. And I already had a warranty case with this phone. I don’t want to risk to unlock my phone and then have a hardware-problem.

    Since I do not need to use a computer nowadays in combination with an iPhone, I don’t see why I shouldn’t get a high quality device with a more secure OS than Android. I don’t buy the 100€-Android-devices anyway. I won’t necessarily buy the newest iPhone but the next phone I want to get is definitely an iPhone. Bye bye Android.

    P.s.: I’d really like to try Ubuntu Phone but I don’t see a cheap way to do it. I don’t want to shell out 100+€ just for trying out a phone-OS which I might not like.

  • Japanese input in Fedora23

    First the fix:

    Set the following in $HOME/.config/imsettings/xinputrc

    export GTK_IM_MODULE=ibus
    export XMODIFIERS=@im=ibus
    export QT_IM_MODULE=ibus
    

    If the folder $HOME/.config/imsettings doesn’t exist, create it first.

    And now a bit of background.

    I switched for a short time to Ubuntu. My reasoning was that I can give better family support but I switched back to Fedora. Ubuntu was so far the worst Linux experience, at least with my existing configurations. But after switching back to Fedora 23 Japanese input didn’t work. Fedora 23 uses ibus as default method. And it tries to do things automagically and in doing that, they totally failed for me.

    There is a script /etc/X11/xinit/xinitrc.d/50-xinput.sh. This script tries to do some magic and works pretty late in the process of starting your GUI when using the default GDM. First it unsets a whole bunch of environment variables and thus will probably anything you set up locally, when you come from another distribution like in $HOME/.xprofile or $HOME/.xinputrc or some other candidate for setting the variables above. Then it looks up if you have $HOME/.config/imsettings/xinputrc. If not, it should create $HOME/.config/imsettings and looks if you have a file $HOME/.xinputrc. If you have it, it gets moved to that folder. And then the file gets sourced and the script is finished.

    The folder creation part is the place where I guess the script failed for me.

    And if that file doesn’t get sourced by the script for whatever reason, the script looks up which LANG-variable you have set and compares it to a hardcoded list. And then sets up environment variables depending on your LANG-variable.

    If you have set en_US.utf8 like me that means that they get set up in a minimal way which leads to not being able to use an IME. And of course the script doesn’t bother logging anything.

    Dear Fedora Project, this is too much magic and can fail. Especially since there are multiple places in $HOME where you can potentially set up the three environment variables, not all recommended but possible. There is .xinputrc, .xinitrc, .xprofile, .profile and even .bashrc. And every tutorial in the net suggests setting it in one of these. Why do you add a new subdirectory in .config? And if stuff doesn’t work because of bugginess, why do you make everything dependent on the set language of the system? Never heard of anyone using English for example as native tongue and then speaks a foreign language? And then apparently you didn’t document that anywhere and do not log anything in the script, so troubleshooting gets really hard. I know those problems of setting up Japanese input in Linux. But I had those problem in the beginnings of 2000 and before. Great job catapulting us back 10 - 20 years, a blast from the past :/

  • More about Fedora

    So, now it is a week with Fedora. I stopped using Gnome and I am using again i3. I learned about copr which offers unofficial repositories that can be easily integrated in your Fedora install via “dnf copr enable repo/name”. That way I got again current versions of vim (Patch 1194, which is like 300 builds ahead of the official Fedora-vim) and tmux. For tmux this means that I can use again the new way to handle a mouse. And there is a repo for hugo, the blogging-engine I use. Copr feels a bit like the AUR but is not as complete as the AUR. I guess you can’t host there repos for software that use patented stuff like handbrake or makemkv. And the built for khal and vdirsyncer is not very current, so I still can’t use that. But the maintainer knows that but doesn’t have the time for rebuilding all the necessary packages. Anyway, copr makes me a happier person :)

    I also got my first contact with the community in the IRC besides lurking. And I got fast answers on my shamingly stupid question without any mentioning of RTFM or some wiki. I could have answered it myself with the manual though…shame on me.

    I get updates nearly daily on my system, which is more often than with Manjaro but not as often as with Arch. In the end this means hopefully more security and stability.

    Btw. after a short chat on Twitter yesterday I looked again into switching to FreeBSD for my laptop but it still seems not ready for my use case. Netflix is still a problem and the proposed solution I found is running Linux or Windows in a VM and using there Chrome…yeah… Skype and Steam seems only available via Wine, no Dropbox afaik, Spideroak might work…it seems to be a further step back from using Linux in terms of available software and compared to running OS X. But maybe I upgrade my CentOS5-servers to FreeBSD instead of CentOS7. But actually I want an environment that is as heterogen as possible since it makes life easier…

  • Fedora23 - First Impressions

    When you read my blog posts, you know that I switched not that long ago from Manjaro, an Arch-based distribution to Arch. And now I switched again - this time to [Fedora]. Even so I was really satisified with Arch. It worked, it was fast and the Arch User Repositories are awesome. I rarely had to google how to install a software. I just had to use a wrapper to search them. And when I googled the first hit was often the Arch Wiki. Right now the Arch Wiki is probably the best documentation for Linux-related software.

    But, yes there is a but, recently I started to look more into securing my system. Following more and more ITSec-people on Twitter, I got a bit paranoid and want to have a securer system. At work most of my servers run CentOS and usually I deactivated SELinux because it always meant annoyances. To be honest I didn’t know a thing about it and so when it made a problem I just deactivated it. I wanted to play with some new software, not learn how to troubleshoot some security system I do not need for my internal systems. Now I started to look into SELinux and the tools for redhat-based systems are really good and SELinux isn’t that hard and my systems get more secure[footnote]I really recommend to watch the talk Security-enhanced Linux for mere mortals. And I actually need it also for my internal systems. If there is a breach, this could make life harder for the intruder.[/footnote].

    So I wanted to have more security for my system. I tried Grsecurity but I couldn’t get Chrome to run and hibernation wouldn’t work either. Then I tried to install SELinux but I failed. And when I asked on the forums and on the mailing list, I got not very satisfying answers and felt like I got hit by the infamous pseudo-elitism of the Arch-community. Henceforth I thought I try a redhat-system. CentOS is a bit too stable for me and I want regularly new packages. So I decided to go Fedora.

    It has a nice installer which worked out of the box. I could use my full encrypted disk and keep my home-directory. After installation I got booted into Gnome which is ok. I like Gnome but I prefer tiling window managers nowadays. When I opened a terminal and typed vim, I got my first surprise. vim wasn’t available but I got offered that it is available in this and that package and if I want to install it. I did and it got installed. Neat. DNF, the package manager of Fedora, is quite nice. I really like that when I remove software dependencies from that software get usually removed as well. What I don’t like is the available software in the repositories. You need extra repos for non-free software (like codecs with patents), I need to google for a way to install software and sometimes it takes quite some time etc. I really miss the AUR. And I didn’t know that a lot of sotware is available for debian-based distros, but not so much for rpm-based distros. Another problem I didn’t expect was that I had now older software than before with Arch and that this could become a problem. I do encrypted backups with Backintime. For the encryption it uses encFS. Well, Arch has encFS 1.7.5, Fedora 23 1.7.4 and that meant that I couldn’t open my backup. I googled but I couldn’t find a way to install it. Maybe if I compiled it from source. I tried Linux Brew but that stopped when there was a dependency that needed XCode. What the…‽

    Then I learned to know about Fedora Rawhide which seems to be some kind of beta-channel for Fedora and is closer to a rolling distribution. But when I wanted to switch to it, I would have lost Handbrake and the repo I am using offers only packages for Fedora 23. Probably it is for the better.

    Another problem I had was with Japanese input. It was a lot of hassle and I thought it is the beginning of the 2000s. According to the internet it should have been easier, but it wasn’t for me. さて、 今日本語を入力できます[footnote]Well, now I can type in Japanese.[/footnote]。

    Other small things are that I switched my login-shell to zsh but all the terminal emulators didn’t respect that and that some packages or the software they provide have strange names. For example the package that provides gvim (graphical vim) is called vim-X11. Or I installed “rxvt-unicode-256color-ml” because I wanted a urxvt with 256color-support. It isn’t started with urxvt like I am accustomed to but with urxvt256c-ml. And I wondered what went wrong when my mutt complained about missing colors. I understand the reason because then you can have standard urxvt also installed, still it is a bit weird imho.

    So far, it doesn’t sound well. But, and here is a but again, there is some stuff I really enjoy. Using SELinux is a breeze. There are great tools that show you that something went wrong and how to fix it. IPtables is installed and pre-configured. There is a graphical tool to configure it further and it makes it really easy, even if you have no knowledge about IPtables. I like DNF as a package manager so far. Easy to use, good search, I like that it also removes unneeded dependencies by default etc. Fedora also uses Gnome-software which is like an App Store for Linux-software. It looks really nice and is easy to use. I will not really need it, since I like the command line but for browsing and finding new software it is nice.

    I will need more time to get to a final conclusion. Thanks to the AUR Arch feels a bit more easier to use for me. But I like that I have now a more secure system. And I can experiment with stuff on my home machine I can later use at my job. Arch is nice for a desktop but I’d never install it on a server. There it will always be CentOS or Debian I guess…or some BSD. Thus for the time being I will stay with Fedora and I wonder how the upgrade to 24 will work out.

    Some more experiences one week later.

  • Switching from Manjaro to Arch

    When switching to Linux over a year ago I decided originally that I use Mint. But when I read about the suggested upgrade path which essentially said that you should re-install on each distribution upgrade, I searched for another solution. And that’s how I found distributions with a rolling release cycle. Most distributions release a major version of their distribution and between those major releases updates usually contain mainly security and bug fixes. With a rolling release you get “all the time” updates and there is no major release. Right now the best known rolling release-distribution is probably Arch[footnote]and in the past Gentoo[/footnote]. But Arch is kind of intimidating since it installs only quite a minimal system and after the installation you just land in a TTY, no graphical user interface at all. In addition it seemed too bleeding edge and has a reputation for being unstable. But it has right now the best documentation in the Linux-world in my opinion[footnote]The documentation of FreeBSD is still better though.[/footnote]. So I searched for an alternative and found Manjaro. Manjaro is based on Arch but with a delay. They take the packages from Arch, test them more and apply additional patches for more stability. So far so good. When I wanted to get newer software I had to switch to more unstable repositories from Manjaro and ended up on unstable which is more or less on the level of Arch stable. I used it for months on end without getting into any trouble. So I decided to switch to Arch since I can start from anew and can have only the software installed I want. Manjaro comes with a lot of software installed to be more comfortable to use.

    The installation was surprisingly easy. I use full disk encryption. After finding a guide it was easy to install. Since I keep /home on a separate volume, I could keep it and needed only to install the base system. The fstab, the file that tells the system which volumes to mount, was not generated in a way that I could boot at first. But after a little bit of fiddling[footnote]I had to move from UUIDs to mapping the LVM-volumes.[/footnote] I could boot. And after that I only had to install the stuff I needed. I used my old config files for Xorg which were already customized for my system. And in a couple of hours I was up and running. Slower than with most Linux-distributions but the system has so far only the software I need.

    But then I noticed something else: The system worked better. Things I couldn’t get to work in the past, I could get to work now. I am using only a window manager (i3) and not a desktop environment. Thus I have to get stuff to work because some comforts are missing in comparison to using KDE, Gnome, Xfce, LXDE or whatever. In the past I had to start pcmanfm to automount the attached USB-hard disks. With Arch I suddenly could get udisks to work as it should work. So automounting happens now on boot and I don’t need to start pcmanfm anymore. In the past I never could get my bluetooth headset to work with my computer. It might connect but directly disconnect or no audio reached the headset etc. I tried a lot but it just didn’nt work. Today I tried it again with Arch. After 10 minutes there was audio coming out of my headset. Some AUR-packages[footnote]AUR stands for Arch User Repository.[/footnote] were problematic or didn’t work at all. Now I have no problems at all so far.

    I will see how stable my system will be and if anything breaks. But so far using Arch is a real improvement over Manjaro. But Manjaro gave me an entry to the world to Arch that eased me into it. Thus I am happy now to using Arch, but I am grateful for projects like Manjaro or Antergos for being an entry-point to distributions like Arch.

  • Would I switch back from Linux to OS X?

    Since I switched from OS X to Linux, one of the questions I get asked now and then is whether I would switch back. Since recently I clearly said that I would switch back to OS X and iOS if my income situation would change that I could afford it again. But recently my opinion is changing. When I get to hear that people are forced to upgrade from 10.6 to a more recent version of OS X because iOS got updated to iOS9. And iOS9 syncs only with a version of iTunes that doesn’t run on OS X 10.6. Thus one user I know had to upgrade and move away from the apps he still used with Rosetta and had to buy newer versions. Another user has an old MacBook that doesn’t run anything newer than 10.6. Thus she would need to abandon her working laptop and get a new one for things like syncing music to her iPhone. Hint: the user won’t get another iPhone. Then there are problems like the user where I couldn’t get Mail.app to work again and moved the user over to MailMate, reports that OS X gets more and more annoying about updating which sounds like Windows to me[footnote]Yes, I know updates are important but for example updating to an 10.X.0 can be problematic.[/footnote], stuff like not allowing an app with video content about IT-security into the AppStore for the AppleTV etc etc.

    In addition I see more and more value in using F/OSS. If I want to I can get the source code and fix a bug myself. I am most of the time not able to, but I have the possibility. And that’s in addition to having software that is free as in beer[footnote]From time to time I donate money to software projects I use a lot.[/footnote]. I also have no real problems with my setup. Even though I am using a rolling distribution, it just works as long as I do not get “creative”. And if I do not like the desktop environment/window manager I am using now, I can try another one[footnote]But i3 is really awesome and I try from time to time stacking/compositing window managers/Desktop environments and return to i3 after a short while.[/footnote]. I have also a bigger choice in hardware, even though it will be hard for you to move me away from X-Series Thinkpads ;) I can buy good serviceable hardware for cheap as used computer, I can build up my own computer from parts or I can buy some high end new shit and nowadays most stuff already works with Linux. A lot has happened in the last 10 years. I can use the same operating software for my servers, my raspberry pi and my own machine. Even though I will use different distributions. Thanks to systemd distributions got more similar in handling them. And that is great. More and more I think that if I could get those 1500€ for a new computer, I might spend it on a Thinkpad X250 and not a MacBook Air/Pro. And don’t let us get started about docking stations. I love mine. It is so awesome to move my laptop around and when I am at home, I connect it to my docking station and it gets connected to two external displays, several hard drives, a DVD-drive[footnote]Which I still need regularly for getting movies cheap or for childrens movies[/footnote] and my ergonomic keyboard and the vertical mouse. With my MacBook Air this was quite cumbersome and involved a chain of USB-Hubs…

    Btw. it is similar now for my Android-phone. My LG G4 is awesome and I really do not see a point why I would want to switch to a current iPhone for loads of more money. Games would be the only reason and because of time constraints I play less and less and I have more than enough games on my pile of shame.

  • Creating systemd timers instead of a personal crontab

    Yesterday I’ve got rid of a to do I had for months in my list: converting my crontab to systemd timers. Once the timers are set they can be controlled via systemctl, log to journald, systemctl –user shows if something failed and systemctl –user list-timers shows a list of your timers, when they ran the last time and when they will run the next time. It is great. But since I am not a pro when it comes to systemd I had a hard time figuring out how I get systemd timers to run for my personal context. For example I am using mutt with isync[footnote]isync is far better than offlineimap. It is faster and uses a less ressources but it is imho harder to configure because it is not as widely used as offlineimap. But the developer is very helpful on the mailing list.[/footnote] and for getting automatically my mails, I run several cron jobs or now timers.

    After a lot of googling and try and error, this is my solution. There is probably a way to do it more elegant and more efficient, but this works for me.

    In ~/.config/systemd/user you have to create two files per job. One file is the service-file, the other one the timer-file. For example myjob.service and myjob.timer.

    myjob.service looks something like this:

    [Unit]
    Description=This is my job I want to run
    
    [Service]
    Type=simple
    ExecStart=/home/user/bin/some_shell_script.sh foo bar
    
    [Install]
    WantedBy=default.target
    

    myjob.timer looks something like this:

    [Unit]
    Description=Run my job every 6 minutes
    RefuseManualStart=no #I can manually start the timer
    RefuseManualStop=no #I can manually stop the timer
    
    [Timer]
    Persistent=false #when it is true systemd stores when the timer was last run and when the machine boots up after a long time, it will automatically catch up onto this timer if it should have run in the meantime
    OnBootSec=80 #how many seconds after the boot should it run the first time
    OnCalendar=*:0/20 #I will explain that later
    Unit=myjob.service
    
    [Install]
    WantedBy=timers.target
    

    OnCalendar takes different arguments which define when the timer runs. You can do stuff like “hourly” or “weekly” or “*:0/20” will run the timer every twenty minutes. The times that can be used by timers are explained in systemd.time(7).

    After you created both files, you should start at first your service to find out, if it will run or fail and you need to debug:

    systemctl --user start myjob.service

    When it runs succesfully:

    systemctl --user start myjob.timer
    systemctl --user enable myjob.timer
    

    The man-pages you want to read regarding timers are systemd.timer(5) and systemd.time(7).

    This is really a quick and dirty-solution and I bet there is a far more elegant way to solve this, but this way I could convert my complete crontab and it is working.

    Here are the sources I used to figure out how to get the stuff to work:

     

  • #IdontstandwithLinus

    The #Gamergaters have a new hashtag: #IstandwithLinus. As everyone knows who read stuff from conferences or mailing lists where Torvalds speaks or writes, he seems too be a pretty big asshole. He created the Linux Kernel and for this I am grateful. It is an awesome project and helped to get free software a huge momentum.

    But that does not justify that he is an asshole.

    #IstandwithLinus apparently found its way onto Twitter because Torvalds explained that he does not really care about diversity and people once again called him out on it. And thus the #Gamergaters had found a new hashtag. And oh wonder, it is again about trashing women and trying to find ways to fight people who think we left the 50s and 60s behind us and not about ethics in game journalism. And they do it with the same means: they dox people, they threaten people and try to get to them in the meatspace. Just read the twitter-timeline of @Shanley.

    The sad thing people like Torvalds or RMS[footnote]Richard Ms. Stallman[/footnote] probably do not care about it, so they won’t speak about it. I wonder if at least organizations like the Linux Foundation or the FSF will speak out or some other big FS/OSS-projects. Otherwise it is once again just a sad example how broken the open source-community is. Diversity is important and not being an asshole in social matters is important as well. It is astounding that people still develop for the Kernel while the project leader is just uncouth.

    Who wants to know about why diversity is important, I can recommend this presentation by Lena Reinhard:

    www.youtube.com/watch

    If you like Linux and free software you shouldn’t use the hashtag #IstandwithLinus. It just is another synonym for #Ihatewomen. You are hurting the whole project more than you do good. Actually you are doing no good at all, you just hurt Linux.

    #IdontstandwithLinus

  • Manjaro - user friendly for various degrees of user friendliness

    Recently I switched to Linux. At first I used Linux Mint but it’s philosophy that there shouldn’t be dist-upgrade but a clean install every six months was not very comforting. Then I heard about Manjaro in an episode of Going Linux about Sonar GNU/Linux. Sonar is a distribution which is specialized for disabled people and they just switched from some distribution to Manjaro. In the episode I heard phrases like “Manjaro does for Arch what Ubuntu does for Debian”. Quite a claim. And since Arch is a rolling release and thus I didn’t have to worry about dist-upgrades anymore and Manjaro is based on Arch but in user-friendly, I gave it a try. Right on the frontpage of the Manjaro-website they boast there is the following sentence in big fat letters:

    "Professional and user friendly Linux at its best."

    Sounds great, so I tried it for a short time and my laptop worked with it fine. Thus I decided to abandon the Mint-install and switch to Manjaro and stay with it. I do not want to waste time with switching distributions, even so it is tempting.

    Unfortunately Manjaro is user friendly for various degrees of user friendly. Let’s compare it to other distributions, I would call user friendly like Mint or Ubuntu[footnote]Ok, Mint is based on Ubuntu, so well…[/footnote]. I installed Mint and everything worked out of the box. I connected my external hard drives and could read and write to them, I connected my secondary display and in contrast to OS X it directly detected the correct resolution, if I needed some software, I could usually find a deb-package except Gnome Shell, stuff like i3 worked like I would expect it from the manual etc.

    Then I started to install Manjaro. I know that it does not yet have reached the state of a 1.0 but it boasts to be user friendly. The graphical installer couldn’t be used by me because when I chose English as UI-language, I couldn’t choose a German locale. Thus I used the command line-based installer which is menu-driven. It worked but I needed the help of Google to set it all up with an encrypted hard drive. I ended up with an XFCe-desktop like I expected. Then I installed Gnome3 because that is actually the desktop I wanted to use and missed from Mint. That worked but suddenly the splash-screen was messy and when I switched to the TTYs I could see parts of the splash screens. The only way I could get rid of it, was to edit my grub-file, thus the splash-screen doesn’t show up anymore.

    I tried using the graphical install-tool called Pamac which also supports AUR. AUR are the Arch User Repository. As far as I understand it there are official repositories but those have not a lot of software. So users can add new software via the AUR and with the package manager of Arch, you can easily install them. Unfortunately Pamac had quite often the problem that when I tried to install more than one package from the AUR or had to install dependencies, then it usually stopped working. But I could never got it fail consistently enough to write a bug report. Henceforth I abandoned it and started using the command-line tool called pacman. And learned how to use AURs. Later I found out about yaourt and packer which made my life easier. But really user-friendly is something else.

    For more fun: I just learned about how to remove orphans with pacman in manjaro and it just removed git from my system.

    Next thing: I installed vim. And when I installed it, it was quite a recent version, nothing like the old stuff Mint gives you (350 patches behind or so). There I had to compile my vim from hand to get something fairly recent. When I opened the first time a markdown-file my vim gave me errors that it is not compiled with python. Thus I had to google and found out that I have to install gvim because the vim-version just gives you a watered-down version and only gvim is compiled with (probably nearly) everything possible. Why? An Ubuntu or CentOS have for example various vim-packages like vim-tiny, vim, vim-gnome etc. So you can quite easily see what you get. I just wondered why my vim won’t work with python and had to google again. Please Manjaro, be friendlier to the user and tell her straight what she gets.

    When I wanted to dip my foot into i3, I found a meta-package called i3. I thought that this is great and easily installed. Then I started i3, pushed win+d which should call up dmenu and nothing happened. I really wondered what the problem is. Searched the i3-manual and yes, that should call up dmenu. Well, dmenu wasn’t installed. The i3-meta package handles dmenu as optional because it isn’t required to install dmenu to run i3, even so the i3-user manual on the i3-website prominently speaks about dmenu. When you offer something like a meta-package, you shouldn’t offer a piece of software that is mentioned in the manual of that software only as an optional install but just install it. I didn’t install i3-wm, I installed i3. Yes, I oversaw that dmenu is optional but it shouldn’t be optional in the i3-package but should be included.

    When I installed Openbox, it was pretty barebones, too. I expected the full experience since there is a Manjaro-edition with Openbox but nope, not really. And I cannot even find packages that give me a decent configuration.

    After installing Gnome 3 I had to set up by myself that the laptop suspends when the lid gets closed. It is configured correctly in XFCe, so why don’t they apply configurations like this to other desktop environments as well?

    My secondary display is not detected correctly and shows the same problem as in OS X. Now I have to figure out, how I get it to work in 1280x768 :(

    But my absolute favorite is how Manjaro handles external hard drives. I have several disks that are formatted with ext4 and several with HFS+. When I connected the ext4-disks in Mint, I could just use them. Manjaro mounts them by default with user root and group root and the permissions that only they can write to them. Asking in the forums just led to what I could find easily: change by hand on the command line owner and permissions. I know that I can configure it somehow with udev and udisks. But why do I have to? Manjaro claims to be user friendly. It should work as a user expects it who comes from user friendly distributions or beware from Windows or OS X.

    I do not expect behavior like that what I described above from Arch or Gentoo. Those distributions are not aiming to be user friendly in my opinion. But Manjaro states that it is. Thus the distribution developers/maintainers should think about the needs of true users. Right now Manjaro is like Arch but at least you have a ready available desktop environment and some applications after installing it. That makes it a bit more user friendly but it is far from user friendly.

    I really like Manjaro. It is some work and I have to tinker and learn more about my system. And things work mostly the way I want them to work[footnote]There are some pieces of software I cannot get to work but I had the same problem on Mint with other pieces of software like Gnome 3.[/footnote] but I would not dare for example to install it on the laptop of my brother-in-law who asked to install Linux instead of Windows on his new used laptop. There I installed Ubuntu since I know from several non-technical persons that they have no real problems with it and could fix their problems easily. With Manjaro, well, I do not waste my time on more inner-family-support calls. But I will keep it on my laptop.

  • 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.