View gist:14742f035b7e0c9682a02df54789d30a
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
/boot/config.txt: | |
[all] | |
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4 | |
/boot/cmdline.txt: | |
snd_bcm2835.enable_compat_alsa=1 | |
/etc/rc.local: |
View index.html
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
<!doctype html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta charset="utf-8" /> | |
<script type="text/javascript"> | |
var url = "ws://" + location.host + location.pathname + "websocket"; | |
var connected = false; | |
var ws; | |
var ready = false; |
View am2320.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
# AM2320 connected to Raspberry Pi pin 3 (SDA) and 5 (SCL) | |
# Public domain | |
import sys | |
import fcntl | |
import time | |
import struct | |
I2C_SLAVE = 0x0703 | |
AM2320_ADDR = 0x5c |
View gist:3c5197daefc631b3ed10b2ce1d03700a
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
$ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key |
View gist:6c532afa9437c9b6696e789caa6ecf4a
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 | |
echo "dwc2" >> /etc/modules | |
echo "g_ether" >> /etc/modules | |
echo "dtoverlay=dwc2" >> /boot/config.txt | |
cat > /etc/systemd/network/usb0.network << EOF | |
[Match] | |
Name=usb0 |