Skip to content

Instantly share code, notes, and snippets.

View melissacoleman's full-sized avatar

Melissa Coleman melissacoleman

View GitHub Profile
[Unit]
Description=run iotproduct service and redirect stderr and stdout to a log file
After=multi-user.target
[Service]
Type=idle
ExecStart=/home/pi/iotproduct.sh > /home/pi/iotproduct.log 2>&1
User=pi
[Install]
@melissacoleman
melissacoleman / gist:dd5382cb8aea45e5277ddb69c8ae3081
Created November 3, 2017 12:34
Output from systemd-analyze critical-chain
multi-user.target @22.520s
└─getty.target @22.518s
└─serial-getty@ttyS0.service @22.504s
└─rc-local.service @21.338s +844ms
└─network.target @21.278s
└─dhcpcd.service @10.542s +10.718s
└─basic.target @10.338s
└─sockets.target @10.336s
└─dbus.socket @10.327s
└─sysinit.target @10.283s
@melissacoleman
melissacoleman / gist:6b5c9ecddda137d725ad1f4546190a74
Last active September 16, 2019 08:50
boot splash screen service
[Unit]
Description=boot splash screen
[Service]
ExecStart=/usr/bin/python3 /path/to/framebuffer-pythonscript.py -img /path/to/bootimage.jpg
[Install]
WantedBy=basic.target
@melissacoleman
melissacoleman / gist:19f1bbf112e15e6e4201fda55d9c85db
Last active September 16, 2019 08:50
Service for showing image on starting shutdown
[Unit]
Description=show image on starting shutdown
DefaultDependencies=no
Before=halt.target
[Service]
ExecStart=/usr/bin/python3 /path/to/framebuffer-pythonscript.py -img /path/to/powerdownimage.jpg
Type=oneshot
[Install]
@melissacoleman
melissacoleman / gist:ff05d8fea5e2113ddb8628352c9e9ade
Last active October 23, 2020 14:20
Service for safe-to-power-off image
[Unit]
Description=safe-to-power-off image
DefaultDependencies=no
After=umount.target
Before=final.target
[Service]
ExecStart=/usr/bin/python3 /path/to/framebuffer-pythonscript.py -img /path/to/unplugimage.jpg
Type=oneshot
@melissacoleman
melissacoleman / gist:a1442b9d23f4515c6e9e4d337c34c265
Last active January 22, 2018 12:55
startup bash script for python module
#!/bin/bash
echo "start wifi-leaf"
exec python3 -m wifi-leaf
#!/bin/bash
source .env
cd "$(dirname "$0")"
exec rsync -rlpt \
--exclude '*.pyc' \
--exclude '__pycache__/' \
--exclude 'venv/' \
#!/bin/bash
set -eo pipefail
cd "$(dirname "$0")"
watchman watch-del-all
watchman watch .
watchman -- trigger . sync '**/*' -- ./sync.sh
@melissacoleman
melissacoleman / gist:9a9860574c859ce606bfa0b3ed4e63bc
Last active February 5, 2024 17:30
Remove all console messages on Raspberry Pi
#!/bin/bash
if [[ ! $UID -eq 0 ]]; then
echo "you must run this as root:"
echo "sudo $0"
exit 1
fi
touch /home/pi/.hushlogin
#!/bin/bash
source .env
set -eo pipefail
cd "$(dirname "$0")"
if [[ ! $UID -eq 0 ]]; then
echo "you must run this as root:"