This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Sync pi to PjJuice hardware RTC | |
[Service] | |
ExecStart=/sbin/hwclock -s | |
# This might be optional, as default user is root(?) | |
User=root | |
Group=root | |
[Install] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import logging | |
from systemd import journal | |
log = logging.getLogger("pijuice") | |
log.setLevel(logging.INFO) | |
handler = journal.JournaldLogHandler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import datetime | |
import os | |
import time | |
from datetime import time | |
import dateutil.parser | |
from pijuice import PiJuice | |
import argparse | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
from time import sleep | |
from pijuice import PiJuice | |
import argparse | |
argparser = argparse.ArgumentParser("Blink the user LED on a pijuice") | |
argparser.add_argument("element",choices=['photo','upload','wifi']) | |
argparser.add_argument("status", choices=['ok','fail']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Auto Reverse SSH | |
# No - can fail on dependancy. No sure best way to do this. | |
# Requires=systemd-networkd-wait-online.service | |
After=systemd-networkd-wait-online.service | |
# Try to restart forever! | |
StartLimitIntervalSec=0 | |
StartLimitInterval=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /tmp/wifi_functions.php 2020-06-01 20:04:41.178166241 +1000 | |
+++ includes/wifi_functions.php 2020-06-01 19:12:34.424035192 +1000 | |
@@ -5,10 +5,12 @@ | |
function knownWifiStations(&$networks) | |
{ | |
// Find currently configured networks | |
+ $index = 0; | |
exec(' sudo cat ' . RASPI_WPA_SUPPLICANT_CONFIG, $known_return); | |
foreach ($known_return as $line) { | |
if (preg_match('/network\s*=/', $line)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- install Ubuntu Desktop 20 | |
-- minimal install | |
-- LVM | |
- install ssh | |
sudo apt install openssh-server | |
- now can remote in | |
scp -r .ssh server-name | |
ssh server-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# -ne 1 ] | |
then | |
echo "Wrong args" | |
echo "write-pi-sd.sh <device> | |
echo <device> such as "/dev/sdc" for a SD card | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## non-interactive config | |
sudo raspi-config nonint do_wifi_country au | |
## software | |
sudo apt update && sudo apt dist-upgrade -y | |
sudo apt install vim git -y | |
sudo apt install -y autossh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# PiZero : flash LED depending on 'net connection. Reboot after 1 hour disconnected. | |
# | |
from subprocess import run | |
from time import sleep | |
import socket | |
from datetime import datetime as dt |
OlderNewer