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 / 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
@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:

@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 / 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.
## 

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 / 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 / build_install_duo_drivers_on_pi.md
Created March 30, 2020 17:23
Build and install drivers for Tellstick Duo on Raspberry PI

Build and install drivers for Tellstick Duo on Raspberry PI

sudo sh -c 'echo "deb-src http://download.telldus.com/debian/ stable main" > /etc/apt/sources.list.d/telldus.list'
wget http://download.telldus.com/debian/telldus-public.key
sudo apt-key add telldus-public.key
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get build-dep telldus-core
sudo apt-get install cmake libconfuse-dev libftdi-dev help2man
@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 / mitmproxy_on_mac.md
Last active October 14, 2022 08:26
Man in the middle proxy on MAC

Man in the middle proxy on MAC.

To be able to reverse engineer Web APIs it is very convenient to use a man-in-the-middle proxy that can in detail reveal what is being sent over the line.

For MAC I recommend to use the mitmproxy which is very easy to install and use. To install just use brew:

brew install mitmproxy

mitmproxy is opensource and can be found on github.

@jannegpriv
jannegpriv / installation_steps_influxdb_grafana_k3s.md
Last active October 14, 2023 19:37
InfluxDb and Grafana in K3s