Skip to content

Instantly share code, notes, and snippets.

@jg3
jg3 / firstGist.txt
Created May 31, 2021 15:53
>Hello_
This is a gist. I l<3e it.
@jg3
jg3 / services.conf
Created May 31, 2021 15:57
RPi-monitor services.conf
########################################################################
# Extract information about Opened Port
# Page: 1
# Information Status Statistics
# - ssh port (22) - yes - no
# ...
# see also: https://xavierberger.github.io/RPi-Monitor-docs/index.html
########################################################################
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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