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
import board | |
import digitalio | |
import storage | |
# Only allow code.py updates when turned off | |
switch = digitalio.DigitalInOut(board.D7) | |
switch.direction = digitalio.Direction.INPUT | |
switch.pull = digitalio.Pull.UP | |
storage.remount("/", not switch.value) |
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
FROM ubuntu:20.04 | |
RUN apt-get update && apt-get install -y openssh-server dnsutils telnet netcat vim | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:f33df4ced3adb33f' | chpasswd | |
RUN sed -i 's/#*PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd |
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 | |
sudo find /Applications/Blender.app -perm +111 -type f -exec chmod og+x {} \; | |
sudo find /Applications/Blender.app -type d -exec chmod og+x {} \; |
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
import analogio | |
import simpleio | |
import board | |
import time | |
import neopixel | |
import touchio | |
from digitalio import DigitalInOut, Direction, Pull | |
# NeoPixels | |
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False) |
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
import pulseio | |
import board | |
import time | |
import neopixel | |
import touchio | |
import adafruit_irremote | |
from digitalio import DigitalInOut, Direction, Pull | |
power = True | |
color = (255, 255, 255) |
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/bash | |
source /etc/default/backup | |
MONTH_TWO=$(date -d "- 2 month" '+%Y-%m') | |
MONTH_PREV=$(date -d "- 1 month" '+%Y-%m') | |
MONTH_NOW=$(date '+%Y-%m') | |
DATE=`date +%Y-%m-%d` | |
HOST=`hostname` |
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
import array | |
import math | |
import time | |
import neopixel | |
import audiobusio | |
import board | |
def avg(values): | |
return sum(values) / len(values) |
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
from time import sleep | |
from random import random | |
from board import SPEAKER, SLIDE_SWITCH, SPEAKER_ENABLE, NEOPIXEL | |
from neopixel import NeoPixel | |
from digitalio import DigitalInOut, Direction, Pull | |
from audioio import WaveFile | |
from audioio import AudioOut | |
from simpleio import map_range | |
# NeoPixels |
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
# Circuit Playground NeoPixel | |
import time | |
import board | |
import neopixel | |
import busio | |
import analogio | |
import digitalio | |
import simpleio | |
import adafruit_thermistor | |
import adafruit_lis3dh |
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 | |
curl -H 'X-AIO-Key: feedfacedaedbeef' -H 'Content-Type: application/json' -X POST https://io.adafruit.com/api/feeds/myfeedname/data.json -d'{"value": 17}' |