View terraform.tf
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
locals { | |
public_zones = { | |
"domainone.egg" = "FEEDFACEBEEF" | |
"domaintwo.egg" = "BEEFBEEFFACE" | |
"domainthree.egg" = "FACEFEEDFACE" | |
} | |
} | |
resource "aws_default_vpc" "default" {} |
View redirect.tf
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
locals { | |
www_zones = { | |
"www.domainone.egg" = "FEEDFACEBEEFFEED" | |
"www.domaintwo.egg" = "BEEFBEEFFEEDFACE" | |
"www.domainthree.egg" = "FACEFACEFEEDFACE" | |
} | |
} | |
resource "aws_s3_bucket" "redirect-www-bucket" { | |
for_each = local.www_zones |
View iterate_network.js
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
function getIPv4Range(networkString) { | |
const networkdef = networkString.split('/'); | |
const netmask = parseInt(networkdef[1]) | |
const bitmask = 32 - netmask; | |
const quads = networkdef[0].split('.'); | |
const addrbin = | |
(parseInt(quads[0]) << 24) + | |
(parseInt(quads[1]) << 16) + | |
(parseInt(quads[2]) << 8) + | |
parseInt(quads[3]); |
View mynodeapp
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 | |
### BEGIN INIT INFO | |
# Provides: mynodeapp | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: A Node app that runs in the background | |
# Description: A Node app that runs in the background | |
### END INIT INFO |
View boot.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
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) |
View Dockerfile
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 |
View fix_blender_282.sh
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 {} \; |
View code.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
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) |
View code.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
import array | |
import math | |
import time | |
import neopixel | |
import audiobusio | |
import board | |
def avg(values): | |
return sum(values) / len(values) |
View code.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
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) |
NewerOlder