Skip to content

Instantly share code, notes, and snippets.

@jg3
jg3 / oracle-linux-firewall-notes.md
Created January 19, 2024 19:32
Oracle Linux firewall config

Oracle Linux Host Firewall Config

The default firewall configuration of Oracle Linux in the OCI environment basically denies everything. To enable traffic of any kind these following commands are needed.

sudo systemctl status firewalld
sudo firewall-cmd --list-all
sudo firewall-cmd --zone=public
sudo firewall-cmd --zone=public --add-port=5201/tcp --permanent
sudo firewall-cmd --zone=public --add-port=5201/udp --permanent
@jg3
jg3 / truenas_duplicati_jail_20231206.md
Last active February 26, 2024 20:22
Backup: Installing Duplicati into a TrueNAS Jail

WARNING: orphaned

This worked for me. It will probably work for you with minor touches if you insist. After I ran this for a while I didn't like how unreliable Duplicati was with the actual work of backing up and I began to investigate Duplicacy instead. I will leave this here for a year or so because it will probably remain more or less valid for that long and I did spend a lot of time putting it together to just thwack it because it's not useful to me. YMMV. GL. GG.

Duplicati on TrueNAS

This is a note on installing Duplicati, a free Backup server into a TrueNAS Core jail.

1 - Set up and configure the Jail

In TrueNAS create a Jail running the latest FreeBSD image available (13.2-RELEASE-p4). I am calling this jail instance backup

@jg3
jg3 / hads_notes.md
Last active December 7, 2023 00:44
notes on HADS for HOME

HADS

https://github.com/sinedied/hads

A simple, markdown-based wiki written in Node. It does just enough for what I need and not much more.

Installed on TrueNas in a FreeBSD jail. HADS lives in /mnt/HADS/

Prep & Install

  • Create DNS A record for home pointing to 10.39.6.46
  • pkg install setsid npm sudo
@jg3
jg3 / raspberry_pi_buttons_example.py
Created March 29, 2022 14:16
Raspberry Pi buttons
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BCM) # Use Broadcom GPIO numbers
# not BOARD for pin numbers
# This example is based on using the buttons in this hardware:
# https://learn.adafruit.com/adafruit-2-2-pitft-hat-320-240-primary-display-for-raspberry-pi/
Button1 = 17 # Board pin 11
Button2 = 22 # Board pin 15
Button3 = 23 # Board pin 23
@jg3
jg3 / raspberry_pi_video_stream.md
Created March 26, 2022 15:34
quick video steream from raspberry pi camera

on the raspberry pi with the camera attached:

libcamera-vid -t 0 --listen -o tcp://0.0.0.0:8888

on the client (my mac laptop)

ffplay tcp://10.39.6.55:8888 -vf "setpts=N/30" -fflags nobuffer -flags low_delay -framedrop

Notes:

Obviously, change the IP address in the client command to the IP or hostname of the raspberry pi. The picture quality isn't super great, but when setting up the frame for a time-lapse shot this gives a quick view of what's in the picture and may help with initial focus.

@jg3
jg3 / bash_colors_function
Last active March 24, 2022 02:05
Bash function for colorful text
TEXT () {
# A colorful wrapper around echo takes up to three arguments.
# "the message" IN_<color>
IN_RED='\e[0;91m'
IN_GREEN='\e[0;92m'
IN_YELLOW='\e[0;93m'
IN_BLUE='\e[0;94m'
IN_PURPLE='\e[0;95m'
IN_CYAN='\e[0;96m'
@jg3
jg3 / get-imgcat.sh
Created March 8, 2022 01:15
Download and install the imgcat script on a system so image files can be displayed in an (ssh) shell session when using iTerm2
sudo curl -o /usr/local/bin/imgcat -O https://iterm2.com/utilities/imgcat && sudo chmod +x /usr/local/bin/imgcat
@jg3
jg3 / mbsyncrc
Created November 8, 2021 20:22
# isync / mbsync config file
# hashed lines are comments
# references:
# https://www.jonatkinson.co.uk/posts/syncing-gmail-with-mbsync/
# http://frostyx.cz/posts/synchronize-your-2fa-gmail-with-mbsync
# https://isync.sourceforge.io/mbsync.html (RTFM!)
# https://isync.sourceforge.io/ (homepage)
# About mbsync:
# Stores - define a collection of mailboxes, a folder
@jg3
jg3 / DuckDNS_And_RPi-Monitor
Created June 1, 2021 13:17
DuckDNS update script and RPi-Monitor panel
This gist is a few files that I use to update my DuckDNS internal and external IP addresses,
and report update status on the RPi-Monitor
References:
https://www.duckdns.org/
https://github.com/XavierBerger/RPi-Monitor
@jg3
jg3 / duplicati_docker-compose.txt
Last active June 1, 2021 02:20
My Duplicati Stack
---
version: "2.1"
services:
duplicati:
image: linuxserver/duplicati
container_name: duplicati
environment:
- PUID=998 # this should match the ouput of `id -u admin` on the CLI
- PGID=100 # this should match the ouput of `id -g admin` on the CLI
- TZ=America/New_York