This file contains hidden or 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 | |
HOSTNAME='wled-dlamp1.local' | |
if nc -z "$HOSTNAME" 80 2>/dev/null; then | |
if curl -s "http://$HOSTNAME/json/state" | jq -r ".on"; then | |
PALETTE=$(shuf -i 0-70 -n 1) | |
FX=$(shuf -i 0-117 -n 1) | |
curl -s "http://$HOSTNAME/win&FP=$PALETTE&FX=$FX" >/dev/null | |
fi | |
fi | |
exit |
This file contains hidden or 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
- id: '1548903378760' | |
alias: Daily Backup | |
trigger: | |
platform: time | |
at: '3:00:00' | |
action: | |
- service: hassio.snapshot_full | |
data_template: | |
name: DailyBackup_{{ now().strftime('%Y%m%d') }} | |
- id: '1548903378761' |
This file contains hidden or 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
This is for the 2.8" 320x240 TFT from Adafruit. This is what I did to get it working on my Pi Zero W (also the Pi 3). | |
It isn't perfect, but it is working. Only issues I see are during the boot. I don't see the logo and it seems the refresh is | |
really slow. | |
/boot/cmdline.txt: | |
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=PARTUUID=59e04602-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait fbcon=map:10 | |
^^ changed that from serial ^^ added this | |
/boot/config.txt: |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am nixternal on github. | |
* I am richjohnson (https://keybase.io/richjohnson) on keybase. | |
* I have a public key whose fingerprint is 3578 0981 A21D D662 2A96 7623 F4C1 838C D8C4 4738 | |
To claim this, I am signing this object: |
This file contains hidden or 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
def get_mplayer_length(filename): | |
result = subprocess.Popen(['mplayer', '-vo', 'null', '-ao', 'null', | |
'-frames', '0', '-identify', filename], stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT) | |
duration = [x for x in result.stdout.readlines() if "ID_LENGTH" in x] | |
return duration[0].split('=')[1].strip('\n') |
This file contains hidden or 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 python | |
import subprocess | |
from optparse import OptionParser | |
def get_mplayer_length(filename): | |
result = subprocess.Popen(['mplayer', '-vo', 'null', '-ao', 'null', | |
'-frames', '0', '-identify', filename], stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT) |
This file contains hidden or 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 python | |
import subprocess | |
from optparse import OptionParser | |
def get_length(filename): | |
result = subprocess.Popen(['ffprobe', filename], stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT) | |
duration = [x for x in result.stdout.readlines() if "Duration" in x] |