Linux

Resize all images in subdirectories

For a project I was working on, I had a folder structure full of images and wanted to compress them to a specific maximum resolution in-place while retaining the aspect ratio using ImageMagick. The crucial point, as so often, were spaces and special characters in the folder names, making it really hard to use bash loops etc. to make this work. With the NULL character trick, luckily this works pretty well.

Download encrypted HLS content with ffmpeg

I maintain an archive of videos, especially documentaries from public media libraries from tv channels etc. on my NAS. Whilst I can use youtube-dl for the most part, it’s rather difficult for sites that use HTTP live streaming (HLS) to stream their content. In the most cases this is even AES-128 encrypted, which makes it difficult to download it. But since there’s players that support playback, it’s obviously possible to decode the stream on the client side.

Gmail DNS records for Hetzner Domain Robot

During a setup change I had to temporarily move my incoming mailserver to Gmail and while I am now back in my own mail server, I again had this major headache of configuring the my DNS (using BIND) because I always forget the dots in the end of CNAME and MX records because usually I dont create nameserver records for external domains… So anyway here is the final configuration I used in Hetzners Domain Robot:

Mount Time Capsule SMB from a Linux host

As it turns out, the Apple Time Capsule only uses SMB protocol version 1 and NTLM for authentication. While this works with macOS without any changes, it often creates problem when trying to mount the the Time Capsule’s SMB share on a Linux system. With this parameters, mounting should work out of the box, given you have the cifs-utils (Debian/Ubuntu) installed: sudo mount.cifs //10.0.0.1/Data /mnt/timecapsule/ -o password='yourpw',sec=ntlm,uid=<local user>,vers=1.0 If you have any problems or further insights, feel free to leave a comment.

rsync over SSH

rsync as a very important tool in a system administrators’ toolbox. It allows to synchronize files and directories and is preferred over cp by many, especially when operating on a large file base because it allows to resume copying in case it is canceled. But rsync can do so much more… For example syncing files and folders over SSH, like scp copies files and folders over SSH but again, with some advantages.

Simple mail forwarding using Postfix

It’s more than likely that your email provider of choice, especially the ones that offer mail services free of charge, will not support receiving email to custom domain names like, in my case, davd.net. Running your own mail server would solve this problem but running a fully featured mail stack including POP, IMAP, Sieve filters et cetera requires a fairly powerful machine. Additionally, if not configured properly, there’s big potential for abuse, e.g. spam.

As an alternative, it’s possible to just run a MTA which redirects all incoming email to an external mail server. This can be ran on almost any machine, even on a low-budget computer like the Raspberry Pi or a cheap virtual server.

Simple Podcast-Downloader for Linux & BSD

During the last few months I managed to automate many recurring tasks on my NAS. One good example for those task is updating my podcast archive. I tried to accomplish this using a lightweight shell script which, running as a cronjob, would hold my podcast archive up to date and notify me about new episodes via push notifications.

Git: Ignore permission changes

In this guide I’ll show you, how to prevent permission changes within a Git repository to be recognized as a file change.

At least after changing file permissions using the Makefile in your version controlled project, the output of git status will be a mess making it nearly impossible to identify changes within your project’s source code.

Linux on the 13-inch MacBook Pro Retina

So it’s already been a month ago when I got my new 13-inch MacBook Pro w/ Retina Display. So everyone who knows me could already promise what would happen next: I’d install Linux on it. For this one I once again chose to use my favorite Linux distribution Fedora, which is currently available in version 20. Meanwhile I tried to install Ubuntu but this lead to problems with ACPI, the disk controller and last but not least the hi-res display featuring a pixel density from 227 ppi.

There are some things to have an eye on during the installation process but generally most things are working now so that the system is more or less ready for production usage.