Posts for: #Linux

Banana Pi installation

Banana Pi in 2024?

Recently I needed a quick and easy way to mount an external disk with an ntfs file system and share it to the network.

So whatcha gonna do? Connect it to a server, mount it, create a samba share for it - done.

So I thought of my long forgotten Banana Pi M1 as it would an absolutely perfect little machine for the job. I am planning to turn it off most of the time, boot it up by wake-on-lan and auto-mount and share the external disk, which automatically goes into standby when nothing is happening with it. The perfect scenario.

Read more

Mount an external NTFS disk in FreeBSD / TrueNAS

When mounting an (external) NTFS disk in FreeBSD, especially in TrueNAS right here, with write permissions (777 actually) you would do the following, which can also be found in the FreeBSD manual

# list currently attachded disks
geom disk list
# load fusefs
kldload fusefs
# or install, if not installed - then load like shown above
pkg install fusefs-ntfs
# make your mount directory for your disk, e.g.
mkdir /mnt/usb
# show the partitions on the disk, decide which one to mount, e.g. the first, 'da0s1'
gpart show da0
# ...and actually mount it, use ntfs-3g instead of 'mount'
ntfs-3g /dev/da0s1 /mnt/usb/
# and/or add an fstab entry for automagic mounting after boot
# /dev/da0s1  /mnt/usb	ntfs mountprog=/usr/local/bin/ntfs-3g,noauto,rw  0 0
# and unmount if you are done
umount /mnt/usb
Read more

Hands Off Updating Docker Containers

In this article I want to paste a code snippet which is checking it’s filtered subfolders for docker-compose files and pulls and ups automagically.

Here it is!

#!/bin/bash

# our docker base folder
DOCKER_BASE_DIR="/home/user/docker"
# folders to exclude from udpate
DIRS_TO_EXCLUDE=("code" "snacklish" "nginx-proxy" "psono")
# docker-compose binary location
DC=$(which docker-compose)

cd ${DOCKER_BASE_DIR}
for D in *; do
    # if is directory and not excluded
    if ([ -d "${D}" ] && [[ ! " ${DIRS_TO_EXCLUDE[@]} " =~ " ${D} " ]]); then
        cd ${D}
        echo "I am in $(pwd)"
        if [ -f "./docker-compose.yaml" ]; then
            echo "I found a docker-compose.yaml, updating ..."
            ${DC} pull && ${DC} up -d && cd ..
        else
            echo "No docker-compose.yaml found, stepping back"
            cd ..
        fi
    fi
done

Oriented on Selenium acceptance tests, I have designed the output to be as readable and as debuggable as possible.

Read more

SMART

Self-Monitoring, Analysis and Reporting Technology is a system for monitoring and recognizing errors of storage media like Hard Disk Drives (HDDs) and Solid State Disks (SSD).

All HDDs and SSDs (refered to as HDD in the following) have SMART functionality while some external drive cases do NOT support reading SMART values from the HDD directly.

Since SMART is not a standardised procedure or well-defined value collection, these values differ greatly between manufacturers and might indicate death for some hard drives while others do not even show or update said values.

Read more