Skip to content

Instantly share code, notes, and snippets.

#/etc/systemd/system/geocache-shmile.service
[Unit]
Description=shmile for geocache
[Service]
Type=simple
WorkingDirectory=/home/debian/shmile
ExecStart=/home/debian/shmile/node_modules/coffee-script/bin/coffee /home/debian/shmile/app.coffee
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: app.coffee
# modified: lib/camera_control.coffee
#
# Untracked files:
# netstat -nalp |grep 3000
tcp6 0 0 :::3000 :::* LISTEN 1/systemd
tcp6 0 0 ::1:38545 ::1:3000 ESTABLISHED 1310/chromium
tcp6 0 0 ::1:3000 ::1:38543 ESTABLISHED 1667/node
tcp6 0 0 ::1:3000 ::1:38545 ESTABLISHED 1667/node
tcp6 0 0 ::1:3000 ::1:38544 ESTABLISHED 1667/node
tcp6 0 0 ::1:3000 ::1:38541 TIME_WAIT -
tcp6 0 0 ::1:38544 ::1:3000 ESTABLISHED 1310/chromium
tcp6 0 0 ::1:38543 ::1:3000 ESTABLISHED 1310/chromium
tcp6 0 0 ::1:3000 ::1:38540 TIME_WAIT -
#/bin/bash
if [$1 == ""];then
echo Need a file name!
else
fswebcam --no-banner --rotate -90 -v -r 768x1024 --jpeg 95 -D 1 $1.jpg
feh -F $1.jpg
fi
geocache.service:
< https://gist.github.com/Technicus/7b7ce39254bc36711add >
statuspin_1.sh:
< https://gist.github.com/Technicus/b17d754550592ced9094 >
statuspin_0.sh:
< https://gist.github.com/Technicus/97fa961f4a3db6131a1d >
geocache.service - status:
#! /bin/bash
printf '---- TURNING OFF THE GPIO ---- \n'
echo 67 > /sys/class/gpio/export
echo 68 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio67/direction
echo out > /sys/class/gpio/gpio68/direction
#! /bin/bash
echo '---- TURNING ON THE GPIO ---- \n'
echo 67 > /sys/class/gpio/export
echo 68 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio67/direction
echo out > /sys/class/gpio/gpio68/direction
# systemd-journalctl -a | grep 1324
Jul 13 20:03:03 beaglebone statuspin_0.sh[1324]: /home/debian/Desktop/geocache/utilities/statuspin_0.sh: line 3: printf: --: invalid option
Jul 13 20:03:03 beaglebone statuspin_0.sh[1324]: printf: usage: printf [-v var] format [arguments]
Jul 13 20:03:03 beaglebone statuspin_0.sh[1324]: /home/debian/Desktop/geocache/utilities/statuspin_0.sh: line 5: echo: write error: Device or resource busy
Jul 13 20:03:03 beaglebone statuspin_0.sh[1324]: /home/debian/Desktop/geocache/utilities/statuspin_0.sh: line 6: echo: write error: Device or resource busy
Jul 13 20:03:03 beaglebone statuspin_0.sh[1324]: /home/debian/Desktop/geocache/utilities/statuspin_0.sh: line 14: printf: --: invalid option
Jul 13 20:03:03 beaglebone statuspin_0.sh[1324]: printf: usage: printf [-v var] format [arguments]
# systemd-journalctl -a | grep 1329
Jul 13 20:03:06 beaglebone statuspin_1.sh[1329]: ---- TURNING ON THE GPIO ---- \n
# systemctl status -a geocache.service
geocache.service - Status pin for geocache
Loaded: loaded (/lib/systemd/system/geocache.service; enabled)
Active: active (exited) since Mon, 13 Jul 2015 20:03:06 +0000; 31s ago
Process: 1324 ExecStop=/home/debian/Desktop/geocache/utilities/statuspin_0.sh (code=exited, status=2)
Process: 1329 ExecStart=/home/debian/Desktop/geocache/utilities/statuspin_1.sh (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/geocache.service
Jul 13 20:03:06 beaglebone statuspin_1.sh[1329]: ---- TURNING ON THE GPIO ---- \n
Jul 13 20:03:06 beaglebone statuspin_1.sh[1329]: /home/debian/Desktop/geocache/utilities/statuspin_1.sh: line 5: echo: write error: Device or resource busy
[Unit]
Description=Status pin for geocache
Before=shutdown.target
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/home/debian/Desktop/geocache/utilities/statuspin_1.sh
ExecStop=/home/debian/Desktop/geocache/utilities/statuspin_0.sh