Skip to content

Instantly share code, notes, and snippets.

View pfeerick's full-sized avatar

Peter Feerick pfeerick

  • Australia
  • 21:08 (UTC +10:00)
View GitHub Profile
@pfeerick
pfeerick / bootstrap-linux.sh
Last active December 28, 2025 23:02
dotfiles-bootstrap
#!/bin/bash
# bootstrap-linux.sh
# Setup for Linux (works with private repos via gh CLI)
# Usage: curl -fsSL https://YOUR_PUBLIC_URL/bootstrap-linux.sh | bash
# Or if script is local: ./bootstrap-linux.sh
set -e
echo "================================"
echo "Starting Linux Bootstrap..."
@pfeerick
pfeerick / main.cpp
Created February 10, 2019 11:06
ESP32 AP platformio forum code
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <IPAddress.h>
String inputString="";
String inputStringWiFi="";
String hello="hello\r";
@pfeerick
pfeerick / pine64-i2c-MCP23017-toggleLeds.sh
Last active May 3, 2024 10:48
Shell script to toggle LEDs on a MCP23017 I2C I/O expander connected to a pine64 board
#!/bin/bash
#elevate to root to ensure no permission errors
#[ `whoami` = root ] || exec su -c $0 root
if [[ $EUID -ne 0 ]]; then
echo "i2cset usually needs sudo powers to run, please login if prompted to avoid permission errors"
exec sudo $0
fi
echo "Set all Port A pins (GPA0-7) as outputs..."
@pfeerick
pfeerick / compressed_ota.py
Last active January 5, 2024 09:15
Extra script to make PlatformIO do compressed OTA updates for the ESP8266
import gzip
import shutil
import os
Import("env")
def compressFirmware(source, target, env):
""" Compress ESP8266 firmware using gzip for 'compressed OTA upload' """
SOURCE_FILE = env.subst("$BUILD_DIR") + os.sep + env.subst("$PROGNAME") + ".bin"
if not os.path.exists(SOURCE_FILE+'.bak'):
@pfeerick
pfeerick / ipcam-capture.sh
Last active September 16, 2022 08:29
Scripts to capture and generate timelapse footage from Maginon IPC-100 IP camera
#!/bin/bash
USERNAME=""
PASSWORD=""
URL="http://192.168.0.156/snapshot.jpg?user=${USERNAME}&pwd=${PASSWORD}"
TIMESTAMP=$(date +%F_%T)
OUTPUT_DIR="/home/rock64/ipcam-snapshots"
curl "${URL}" --output "${OUTPUT_DIR}/${TIMESTAMP}.jpg"
@pfeerick
pfeerick / keybase.md
Last active September 22, 2021 03:28
Keybase proof - account reset

Keybase proof

I hereby claim:

  • I am pfeerick on github.
  • I am pfeerick (https://keybase.io/pfeerick) on keybase.
  • I have a public key ASDnUoeLmUrvFSkRC51KpJD7BftOaXoHqJ--LdLzZPQQrAo

To claim this, I am signing this object:

@pfeerick
pfeerick / nrfRx_v0.1.ino
Created September 21, 2016 11:22
Arduino script to receive a NRF24L01+ sensor on a Digistump Oak
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
//needed for printDetails
#define printf Serial.printf
#define sprintf(...) os_sprintf( __VA_ARGS__ )
#define CE_PIN 10
#define CSN_PIN 5
@pfeerick
pfeerick / pine64-SYSLED-heartbeat.sh
Last active July 2, 2021 07:02
Shell script that makes the Pine64 System LED do a double flash heartbeat approximatley every 10 seconds
#!/bin/bash
function openGPIO
{
#test if GPIO sysfs entry exists, create if necessary
if [ ! -e "/sys/class/gpio/gpio359" ]; then
# echo "DEBUG: export 359"
echo 359 > "/sys/class/gpio/export"
fi
@pfeerick
pfeerick / flash_SYSLED.sh
Last active April 15, 2021 04:59
Flash the SYSLED of the pine64/clusterboard
#!/bin/bash
function openGPIO
{
#test if GPIO sysfs entry exists, create if necessary
if [ ! -e "/sys/class/gpio/gpio359" ]; then
# echo "DEBUG: export 359"
echo 359 > "/sys/class/gpio/export"
sleep 0.1
fi
@pfeerick
pfeerick / flash-app.sh
Last active January 14, 2021 23:45
stlink pinetime swd
#!/bin/bash
OCD_SCRIPTS=/home/pfeerick/repos
openocd -f ${OCD_SCRIPTS}/stlink.cfg -f ${OCD_SCRIPTS}/flash_app.ocd