Until last year, work had Mitel 5212 softphones as the main devices on desks. This was the case since 2008, and was apparently high time to replace them. As they had nowhere to go but the bin, I grabbed a few in the hope to use them at home. While Mitel has a proprietary protocol (MiNET), they also support standard SIP through another vendor firmware, which allowed me to add a few more physical phones behind my FRITZ!Box.
Category Archives: sysadmin
Using Let’s Encrypt certificates with a FRITZ!Box
Today, when trying to log in remotely to my home router (a FRITZ!Box), I was greeted with an TLS certificate error. I was pretty sure it’s my router, but am I really keen to type in a password into a field that I have no idea whether it is actual my machine, or a nice-looking replica? A clear indication that it is time to use a better cert than a self-signed one that I cannot verify remotely.
I use Let’s Encrypt for all my other certificates, so why not use it on my router? However, I found precious little information about how to use it with the FRITZ!Box. Fortunately, it’s pretty straightforward.
Unified password management, the UNIX way
I’ve long been meaning to store all my passwords in a single, safe, location, as a way to remain sane as well as safe. But which one? Every operating system (or desktop environment) now has its own store, but choosing one casts a lot of things into stone, and most have a lot of third-party dependencies.
KeePass seems to be a good cross-platform solution, with clients for Linux, Windows, OS X and even Android, and nice features such as filling on demand. But I don’t like the whole clicky interface, if only for use without graphical display. It also doesn’t offer a native way to synchronise the stores across boxes.
For a while, I have been storing all my important configuration files in a git repository, with some make magic to install and update the files on the system. This magic would also store all passwords in a GPG-encrypted files, and replace them when installing the files.
The problem, of course, is that the passwords are still in plaintext in the live systems. And it came back to bite me when I sent an innocuous script (the
ics2dav.sh script from this post) to a friend… with the password nicely sitting there. Fortunately, I noticed this before him, and changed my password. In addition, this doesn’t cater for passwords stored in other applications, such as Firefox.
So things had to change. And I discovered pass(1), a simple command-line tool based on GPG-encrypted flat files, with an option to sync natively with Git. So there is finally an option for me to store passwords in a way which fits my workflow.
Remote scanning on a QNAP TS-212 with a Samsung SCX-3200 with SANE
I recently realised that the QNAP TS-212 NAS (running the latest QTS 4.2.0) can be used as a print server. No need to keep another machine on to print from anywhere!
Remote printing is easy
Both UNICES, through CUPS, and Windows, through Samba, can use the printer straight-away. In the case of the Samsung SCX-3205, the driver under ArchLinux is the samsung-unified-driver (from AUR) which, fortunately, doesn’t install any useless binary beyond those needed by the PPD used by CUPS.
client$ pacman -Qs samsung local/samsung-unified-driver 1.00.36-2
Remote scanning is harder
The problem is that this is a combo printer/scanner. Moving the printer to the NAS requires a similar solution to CUPS to scan from the network. Fortunately, SANE can do this, and there is some documentation about setting it up on a QNAP NAS. In this case, however, this did not work smoothly, so I had to fix a few things.
Managing locally-built packages without wrecking the system, with stow(8)
It is bad practice to use
make install. Period.
Why? Because it installs files everywhere on your system—if you’re lucky, only in
/usr/local—with no guaranteed way to cleanly remove them afterwards.
Yet, sometimes, there is no other option, for example if some software is not packaged for your Unix of choice and you don’t have time to do it yourself. There are some easy and rather straightforward ways around it, which I usually recommend to beginners.
It happened again today. So I recommended the use of
/opt/PKG-VER as an installation prefix and stow(8) to make the software seamlessly available to the rest of the system. Nothing fancy or novel, but I thought I’d share the summary email in the hope it would help others.
You know it’s mature when you only need a terminal to run it (CalDAV tools for the console)
The following was initially posted on Pump.io, before I realised that this might benefit from a more preservable/visible format.
Frustrated with only interacting with my ownCloud calendar through the native web interface, I finally decided to look for a replacement application that I could run locally. Khal ended up being it, with vdirsyncer for two-way CalDAV sync with ownCloud.
Coupled with watdo, by the same author as vdirsyncer, for todo.txt-like management of CalDAV tasks (
VTODO), I can now do all my schedule and tasks management from the comfort of my own terminal, even without any connectivity!
Reinstalling CAcert root certificates on Debian
CAcert is an SSL Certificate Authority based on the establishment of a web-of-trust à la PGP: rather than charging to issue certificates to anyone, it issues them only to members who have been vouched for by enough other trustworthy members (assurers).
For historical reasons, they were included in the Debian ca-certificates package. It was however recently removed, for justified reasons (CAcert is conducting an audit, and withdrew their demand for inclusion in the Mozilla chain until it’s done). Most other distributions mirror from this package to ship their root certificate, and have also dropped CAcert as a consequence.
This is however a bit annoying, as many sites started popping up warnings due to their root certificate not being in the trusted chain of the OS anymore. Until, maybe, they are reinstalled but disabled by default, I quickly wrote up a tiny script that downloads CAcert’s root certificates, and re-registers them. It’s quick and dirty, and only does an MD5 sum to make check they are the right ones, so use at your own risks.
Migrating to WordPress
After a lot of humming, I decided that it wasn’t very practical to use a different platform for every blog I was running on the same machine. Some more puffing led me to conclude that WordPress was the best candidate to replace the likes of SimplePHPBlog and Blogsum. I still have an odd Nanoblogger to migrate, but it is easily maintained and keeps to itself for the moment.
In the process, I had to find ways to import data from the old platforms, and massage it into something that WordPress can work with.
Booting OpenBSD installation from PXELINUX
PXE-booting OpenBSD is easy and well documented. Unfortunately, it is not the case when more than just one OpenBSD install has to be made available through PXE. Using PXELINUX for multiplexing purposes has potential but the documentation is scarce, unsuccessful, or require patching the PXE loader.
One trick which works is to boot from a floppy disk image, using memdisk.
Jenkins: Fixing “java.io.IOException: Unexpected termination of the channel” due to “java.lang.InternalError: Can’t connect to window server”
Some time ago, a PPC/Mac OS X 10.5 build slave used with Jenkins started consistently failing with a java.io.IOException: Unexpected termination of the channel due error on some Jenkins slaves.
Relaunching the agent showed the reason for the error was due to a java.lang.InternalError: Can't connect to window server exception.
This was fixed, based on some insight from StackOverflow, by setting -Djava.awt.headless=true in the Advanced/JVM Options for this host.