Skip to content

Instantly share code, notes, and snippets.

View pfeerick's full-sized avatar

Peter Feerick pfeerick

  • Australia
  • 01:51 (UTC +10:00)
View GitHub Profile
@pfeerick
pfeerick / update.sh
Created December 8, 2016 05:12
Fixed up shell script for Digistump Oak 'easy serial update'
#!/bin/bash
read -p "Please enter the path of your USB-Serial Adapter (ex: /dev/ttyUSB0):" comport
read -p "Ensure Oak is attached as shown here and press a key: digistump.com/wiki/oak/serialupdate" -n1 -s
echo
echo "Updating..."
python esptool.py --baud 115200 --port $comport write_flash -fs 32m 0x1000 blank.bin 0x2000 firmware_v1.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin
echo "Done!"
read -n1 -s -t3
@pfeerick
pfeerick / OakManualWifiStatic.ino
Last active December 18, 2016 00:32
Demo sketch showing how to configure a Digistump Oak's wifi manually with a static IP without a Particle connection
SYSTEM_MODE(MANUAL);
#include <ESP8266WiFi.h>
//Static IP stuff
char SSID[] = "yournetwork"; // your network SSID
char passwd[] = "yourpassword"; // your network password
//WiFi config stuff
IPAddress ip(192, 168, 0, 70); //your static IP
@pfeerick
pfeerick / OakManualWifi.ino
Created December 18, 2016 00:33
Demo sketch showing how to configure a Digistump Oak's wifi manually without a Particle connection
SYSTEM_MODE(MANUAL);
#include <ESP8266WiFi.h>
//Static IP stuff
char SSID[] = "yournetwork"; // your network SSID
char passwd[] = "yourpassword"; // your network password
void setup()
{
@pfeerick
pfeerick / pine64-install-mate-debian.sh
Created June 2, 2018 10:44
Install MATE Desktop Environment for Debian on the pine64
#!/bin/bash
set -e
DISTRO=""
if hash apt-get 2>/dev/null; then
DISTRO=debian
fi
if [ -z "$DISTRO" ]; then
@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 / rock64-power-led-heartbeat.sh
Created June 22, 2018 23:11
rock64 power led heartbeat indicator
#!/bin/bash
#if a gpio group exists, doing this at startup allows any group member to control leds
#sudo chgrp gpio /sys/class/leds/{diy,work}-led/brightness
#sudo chmod g+w /sys/class/leds/{diy,work}-led/brightness
LED_GPIO="/sys/class/leds/power-led"
LED_ON=255
LED_OFF=0
@pfeerick
pfeerick / iozone.txt
Last active July 6, 2018 04:38
rockpro64 - bionic-minimal-0.6.59-arm64 - pci SATA - 4.18.0-rc3-1042-ayufan-gc1c3de67a7c1
rock64@rockpro64:/mnt/seagate-green-1.5tb$ sudo iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2
Iozone: Performance Test of File I/O
Version $Revision: 3.429 $
Compiled for 64 bit mode.
Build: linux
Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
Al Slater, Scott Rhine, Mike Wisner, Ken Goss
Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
@pfeerick
pfeerick / iozone-nvme-0.7.6.txt
Last active July 18, 2018 07:32
rockpro64 - bionic-containers-0.7.6-arm64 - pci Samsung 960 EVO 250GB - 4.4.132-1062
rock64@rockpro64:/mnt/samsung-960-evo-250GB$ sudo iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2
Iozone: Performance Test of File I/O
Version $Revision: 3.429 $
Compiled for 64 bit mode.
Build: linux
Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
Al Slater, Scott Rhine, Mike Wisner, Ken Goss
Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
@pfeerick
pfeerick / BasicOTA_MDNS_test.ino
Created December 13, 2018 04:24
Modified version of the BasicOTA sketch included with the ESP8266 Arduino core to check if MDNS is an issue
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#define WIFI_SSID "YOUR_SSID"
#define WIFI_PWD "YOUR_SSID_PASSWORD"
void setup()
{
@pfeerick
pfeerick / main.cpp
Last active February 10, 2019 00:14
PlatformIO build_flags docs issue
#include <Arduino.h>
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
#include <DNSServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266WebServer.h>
#include <ArduinoOTA.h>
#define SSID "fancy-ssid"
#define PASS "pass"