Skip to content

Instantly share code, notes, and snippets.

View PJTewkesbury's full-sized avatar

Peter T PJTewkesbury

View GitHub Profile
@PJTewkesbury
PJTewkesbury / Lsyncd Technical Session.md
Created November 20, 2022 15:33 — forked from mralexjuarez/Lsyncd Technical Session.md
Quick Tutorial on Using Lsyncd

Lsyncd Technical Session

So what is lsyncd?

Lsyncd is a tool used to keep a source directory in sync with other local or remote directories. It is a solution suited keeping directories in sync by batch processing changes over to the synced directories.

When would we use lsyncd?

So the generic use case is to keep a source directory in sync with one or more local and remote directories.

@PJTewkesbury
PJTewkesbury / emailwiz.sh
Last active December 21, 2021 08:26
Email Install (Dovecot, Postfix, SpamAssassin, OpenDKIM)
#!/bin/sh
# THE SETUP
# Mail will be stored in non-retarded Maildirs because it's $currentyear. This
# makes it easier for use with isync, which is what I care about so I can have
# an offline repo of mail.
# The mailbox names are: Inbox, Sent, Drafts, Archive, Junk, Trash
@PJTewkesbury
PJTewkesbury / InstallTailScale.sh
Last active December 22, 2022 09:19
Install TailScale
#!/bin/bash
curl -fsSL https://pkgs.tailscale.com/stable/raspbian/buster.gpg | sudo apt-key add -
curl -fsSL https://pkgs.tailscale.com/stable/raspbian/buster.list | sudo tee /etc/apt/sources.list.d/tailscale.list
sudo apt-get update
sudo apt-get install tailscale
sudo systemctl start tailscale
sudo tailscale up --authkey tskey-auth-kKtuoK5CNTRL-k5sMzVPkz6Nvn2g6Efw67Nf5qJ31MGp2 --hostname=$HOSTNAME --ssh
sudo ip addr show tailscale0
@PJTewkesbury
PJTewkesbury / BuildClockPi.sh
Last active October 14, 2025 12:48
Build ClockPI
#!/bin/bash
# This script requires the following enviroment variables to be defined before calling this script.
IPADDR_ETH0="192.168.0.16"
IPADDR_WLAN0="192.168.0.17"
ROOTPW="ClockPIP@ssw0rd"
wget -O ./BuildPiCore.sh https://gist.github.com/PJTewkesbury/142815aace9f37f36fe8ef90cb683102/raw
chmod +x ./BuildPiCore.sh
source "./BuildPiCore.sh"
@PJTewkesbury
PJTewkesbury / BuildServerPI.sh
Last active January 16, 2023 10:08
Build Server PI
#!/bin/bash
# wget -O - Url | bash
# This script requires the following enviroment variables to be defined before calling this script.
IPADDR_ETH0="192.168.0.14"
IPADDR_WLAN0="192.168.0.15"
ROOTPW="ServerPI@ssword"
DISKLABEL=""
USBDISKLABEL=""
#include <wiringPi.h>
#include <wiringPiSPI.h>
#include <iostream>
#include <stdint.h>
int main() {
wiringPiSetup();
if(wiringPiSPISetup(0, 6000000) < 0) {
std::cerr << "wiringPiSPISetup failed" << std::endl;
}