Skip to content

Instantly share code, notes, and snippets.

View jannegpriv's full-sized avatar
🏠
Working from home

Jan Gustafsson jannegpriv

🏠
Working from home
  • Stockholm
View GitHub Profile
@jannegpriv
jannegpriv / macos_atom_hydrogen.md
Last active October 3, 2019 14:48
MacOS preparations for Atom, Hydrogen an ML.
@jannegpriv
jannegpriv / sd_card_handling_raspberry_on_mac.md
Last active February 7, 2020 14:35
SD card handling for Raspberry PI on MAC

Backing up Raspberry Pi SD Cards on Mac OS X

  1. Insert the SD card into a USB card reader, and plug it into your Mac

  2. Open Terminal.app and use the following command to list the disks attached to your Mac and identify which /dev/disk corresponds to the SD card (look for the disk that includes a partition of type Linux):

diskutil list

diskutil unmountDisk /dev/disk3

@jannegpriv
jannegpriv / sd_card_wifi_ssh_access_raspberry.md
Last active October 17, 2020 15:51
WiFi and SSH access to Raspberry via SD card

Adding WiFi and SSH access to Raspberry via SD card

  1. Insert the SD card into a USB card reader, and plug it into your Mac
  2. Navigate to /boot partition using you OS file explorer (On MAC /Volumes/boot)
  3. Create a file on /boot named wpa_supplicant.conf
  4. Add the following content to the file:
country=SE # Your 2-digit country code
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
@jannegpriv
jannegpriv / jmx_agent_openhab_mission_control.md
Last active November 21, 2020 21:07
Configure JMX agent on openHAB to be able to run misison control

Configure JMX agent on openHAB to be able to run misison control

  1. Add the following lines to /etc/default/openhab2: (NOTE: Xmx/Xms is also set to 1024m in this example)
#########################
## JAVA OPTIONS
## Additional options for the JAVA_OPTS environment variable.
## These will be appended to the execution of the openHAB Java runtime in front of all other options.
## 
@jannegpriv
jannegpriv / mosquitto_bridging_tls.md
Last active November 27, 2020 22:54
Configure Mosquitto bridging with TLS

Configure Mosquitto bridging with TLS

The use-case for me is to connect my openHAB installation at our summer house with my production openHAB installation. The summer house openHAB instance will then just act as a slave to the production system and is connected using the MQTT binding and the MQTT Event Bus (Now replaced by the openHAB remote binding).

To be able to connect a remote Mosquitto instance to a central Mosquitto instance you need to configure the remote Mosquitto as a bridge and the central Mosquitto will then be the broker.

Broker side

@jannegpriv
jannegpriv / openhab_k3s_deployment.md
Last active May 2, 2021 15:49
Support for openHAB K3s deployment.

openHAB K3s deployment

openHAB is a popular open source home automation platform that can run on a Docker container. The openHAB K3s deployment in this example uses persistent volume claims on NFS volumes and Traefik Ingress controller for easy external access to GUIs.

NOTE: The yaml-files for openHAB uses NFS Persistent volumes, hence instructions on this page needs to be done before continuing.

The following instructions assumes you are logged into the master node.

You first need to clone the openHAB Docker repo to be able to fetch the latest container additions from OpenHAB:

@jannegpriv
jannegpriv / k3s_traefik_dashboard_activation.md
Last active December 8, 2021 20:30
k3s traefik dashboard activation

Installation steps for K3s traefik dashboard

The steps below requires that you have followed the installation steps for installing K3s on RPIs.

NOTE: The following file can be found in the following repository.

Installation steps for K3s traefik dashboard. On master node, create a folder called k3s-traefik:

Open Helm file:

Boot Raspberry Pi 4 from USB device

  1. Use Raspberry PI Imager to flash latest Raspberry Pi OS Lite (32-bit) on a SD card
  2. Add ssh support and WiFi (if not using wired), follow this gist for instructions
  3. Plug the SD card in your Pi 4 and power it up and ssh to it
  4. Update your OS and firmware by issuing:
sudo apt update
sudo apt full-upgrade
@jannegpriv
jannegpriv / installation_steps_docker_local_registry.md
Last active January 31, 2022 21:54
Installation steps for local Docker repository on master node and K3s integration using K3d

Installation steps for local Docker registry on master node and K3s integration using K3d

The steps below requires that you have followed the installation steps for installing K3s on RPIs.

Start registry container on master node, we will use insecure mode as configured in my K3s installation guide:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

Login to docker on master node (requires that you have an account on Docker Hub): docker login

@jannegpriv
jannegpriv / traefik_letsencrypt_basic_auth.md
Last active September 23, 2022 14:03
K3s and Traefik with Let's encrypt and basic authentication

K3s and Traefik with Let's encrypt and basic authentication

The steps below requires that you have followed the installation steps for installing K3s on RPIs.

Prerequisites

Ensure that you have a DNS hostname that can be resolved on Inet:

$ dig +short oh.domain.se