View logitech_attack3_rpi.py
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 python | |
import time | |
import Adafruit_PCA9685 | |
import evdev | |
# Initialise the PCA9685 using the default address (0x40). | |
pwm = Adafruit_PCA9685.PCA9685() | |
# Set frequency to 60hz, good for servos. |
View gist:cdc59d9852f56bbdb2e1bc2aa465dc26
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=Playlist generator daemon | |
[Service] | |
User=user | |
WorkingDirectory=/home/user | |
Type=simple | |
Environment="LC_ALL=en_US.UTF-8" | |
Environment="LANG=en_US.UTF-8" | |
ExecStart=/bin/sh -c 'while inotifywait --exclude .*.swp --exclude .*.swo --exclude .*.swx -q -r -e create,modify,move /home/user/Videos; do /home/user/Videos/playlist-generator-script.sh; done' |
View gist:5a12fb06d9d3ffd52c0814970e5f1a14
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
find "$PWD" -type f \( -name '*.webm' -o -name '*.mp4' -o -name '*.avi' \) -printf "#EXTINF:%s,%f\n%P\n" | sed 's/ /%20/g;s/\[/%5B/g;s/\]/%5D/g' > playlist.m3u |