Skip to content

Instantly share code, notes, and snippets.

View pfeerick's full-sized avatar

Peter Feerick pfeerick

  • Australia
  • 07:49 (UTC +10:00)
View GitHub Profile
@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"
@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-battery.sh
Last active August 24, 2019 03:43
Colourful Battery Status script for Pine64 SOC board
#!/bin/bash
# See https://github.com/pfeerick/pine64-scripts/blob/master/pine64-battery-colour.sh
# for updated versions of this script.
SWITCH="\033["
NORMAL="${SWITCH}0m"
RED="${SWITCH}1;31m"
GREEN="${SWITCH}1;32m"
YELLOW="${SWITCH}1;33m"
@pfeerick
pfeerick / batteryChecker.sh
Last active April 30, 2020 05:54
Intiial rewrite of pine64-battery script from https://github.com/pfeerick/pine64-scripts/ supporting the use of the RGB leds on pinephone
#!/bin/bash
# Simple (!!) script that displays battery info for various pine64 (and possibly other) devices
# (specifically, those that use an AXP20x series power management chip).
# Get device model
if [ -f /proc/device-tree/model ]; then
IFS= read -r -d '' DEVICE_MODEL </proc/device-tree/model || [[ $DEVICE_MODEL ]]
else
DEVICE_MODEL="Unknown model"
@pfeerick
pfeerick / flashLOG.cpp
Created August 8, 2020 06:02
flashlog testing
#include "flashLOG.h"
flashLOG::flashLOG(char *filename)
{
_logfilename = filename;
}
void flashLOG::start() {
if (!LittleFS.begin())
{
#include "flashLOG.h"
flashLOG::flashLOG(char *filename)
{
_logfilename = filename;
}
void flashLOG::start() {
if (!LittleFS.begin())
{