tutorial

How I installed TrueNAS on my new ASUSTOR NAS

A common question I get asked whenever my ASUSTOR NAS makes an appearance is: "but can it do ZFS?"

I'm still trying to convince them to add it to ADM alongside EXT4 and Btrfs support, but until that time, the 2nd best option is to just run another OS on the NAS! This is now permitted, but you won't get technical support from ASUSTOR for other OSes.

Some people (myself included) like buying hardware and... doing what we want with it! And for computer hardware, that often involves installing whatever OS and software we want to do the things we want to do. Pretty crazy, coming from a guy who uses a Mac, right?

ASUSTOR Flashstor 12 - front

Build your own private WireGuard VPN with PiVPN

I am frequently away from home (whether on family vacation, a business trip, or out around town), but I have a number of important resources on my home network—as any homelabber does.

There are services I like to access remotely like my NAS with my giant media library, my edit server with all my active projects, and especially Home Assistant, which lets me monitor all aspects of my home.

Some people rely on individual cloud services from IoT vendors and have a bunch of apps to connect to each type of device independently. As someone who has dealt with numerous security breaches for numerous services, I know not to trust 50 different cloud-connected devices in my home.

That's why I'm a 'self-hosted' homelabber, and why I try to find devices that don't leave my local network.

Transcribing recorded audio and video to text using Whisper AI on a Mac

Late last year, OpenAI announced Whisper, a new speech-to-text language model that is extremely accurate in translating many spoken languages into text. The whisper repository contains instructions for installation and use.

tl;dr:

# Install whisper and its dependencies.
pip3 install git+https://github.com/openai/whisper.git 

# (When needed) Update whisper.
pip3 install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git

# Make sure ffmpeg is installed.
brew install ffmpeg

# Translate speech into text.
whisper my_audio_file.mp3 --language English

One thing I do quite regularly for my YouTube channel is extract the audio track, convert it to text using an online tool (I used to use Welder until they were bought out by Veed), and then hand-edit the file to fix references to product names, people, etc.

Ubuntu's settings won't open after setting CPU to 'performance'

Recently I was doing some benchmarking on my Ubuntu 22.04 PC, and as part of that benchmarking, I tried setting the CPU performance profile to performance. In the old days, this was not an issue, but it seems that modern Ubuntu only 'knows' about balanced and power-saver. Apparently performance is forbidden these days!

$ powerprofilesctl list
* balanced:
    Driver:     placeholder

  power-saver:
    Driver:     placeholder

The problem was, I had set the profile to performance:

$ powerprofilesctl set performance

But suddenly the 'Settings' GUI app would no longer open (at least not after I had opened it and clicked into the 'power' section). A reboot didn't work, and even reinstalling control center (sudo apt-get install --reinstall gnome-control-center) didn't help!

When I tried opening the settings GUI from the command line, I got the following critical error:

How to download an MP4 from YouTube, every time

I use yt-dlp to download videos off YouTube quite frequently. I'll use the videos as reference, and I often use it to grab the VOD for one of my livestreams, since there's no simpler way (I'm not going to dig through the bowel's of YouTube's UI to try to download one of my own videos...).

But I also can't handle the default .webm videos in all my video editing tools natively, and transcoding is annoying. So I've settled on the following yt-dlp command to first try to pull a native MP4 version off YouTube, and failing that, transcode to MP4 immediately after downloading:

yt-dlp -S res,ext:mp4:m4a --recode mp4 https://www.youtube.com/watch?v=dQw4w9WgXcQ

And if you weren't aware, yt-dlp does an excellent job pulling video files from other sites as well, should the need arise.

apt_key deprecated in Debian/Ubuntu - how to fix in Ansible

For many packages, like Elasticsearch, Docker, or Jenkins, you need to install a trusted GPG key on your system before you can install from the official package repository.

Traditionally, you'd run a command like:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

But if you do that in modern versions of Debian or Ubuntu, you get the following warning:

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

This way of adding apt keys still works for now (in mid-2022), but will stop working in the next major releases of Ubuntu and Debian (and derivatives). So it's better to stop the usage now. In Ansible, you would typically use the ansible.builtin.apt_key module, but even that module has the following deprecation warning:

Using a reverse-NFS mount to access Docker container's data from macOS

For years, Mac users have dealt with slow filesystem performance for Docker volumes when using Docker for Mac. This is because the virtualized filesystem, which used osxfs for a while and will soon be upgraded to use VirtioFS.

But if you need to do large operations on huge codebases inside a shared directory, even using NFS to share from the Mac into Docker is a lot slower than running a native Docker volume or just using files inside the container's own filesystem.

macOS Disk Utility APFS Case Insensitive filesystem

Installing the Asahi Linux Alpha on my M1 Mac mini

After upgrading my main workstation to a Mac Studio, I decided to break tradition.

Usually, I sell off my old workstation to offset the cost of the new one. But just last week, Asahi Linux announced their first alpha release.

Asahi Linux MacBook Pro

If you haven't heard of Asahi, it's a Linux distribution based on Arch Linux that aims to bring a polished Linux experience on Apple Silicon Macs (all the current M1 Macs, and any new Apple Silicon Macs that come in the future).

Playing sounds with Python on a Raspberry Pi

Today I needed to play back an MP3 or WAV file through a USB audio device on a Raspberry Pi, in a Python script. "Should be easy!" I thought!

Clarence the Raspberry Pi Bell Slapper with USB audio output and speaker

Well, a couple hours later I decided to write this blog post to document the easiest way to do it, since I had to take quite a journey to get to the point where sound actually plays through the USB audio output.

The problem is most guides, like this simple one from Raspberry Pi's project site, assume two things: