Skip to content

Instantly share code, notes, and snippets.

View gmorell's full-sized avatar
⛱️

Gabe gmorell

⛱️
View GitHub Profile
@gmorell
gmorell / README
Created March 5, 2025 20:55
gabe-podman-homeassistant-stax
mkdir your /mnt/whatevers
put .container's in /etc/containers/systemd/
systemctl daemon-reload
systemctl enable --now mosquitto
systemctl enable --now esphome
systemctl enable --now matter
systemctl enable --now hass
systemctl enable --now zigbee2mqtt
@gmorell
gmorell / etc
Created December 22, 2024 03:46
peeringdb podman
ls ~/.config/containers/systemd/
peer-es.container peer-mysql.container peer-pdb.container peer.pod
always use &str instead of &String
always use &Path instead of &PathBuf
always use &[T] instead of &Vec<T>
S (Consistently Good)
- Guru the Caterer
- Godavri
- Ritu Ki Rasoi
A (Good)
- Dosa And Curry
- Himalayan Kitchen
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
## Lights
import machine
import neopixel
np0 = neopixel.NeoPixel(machine.Pin(5), 200)
np1 = neopixel.NeoPixel(machine.Pin(19), 200)
for i in range(0,200):
np0[i] = (101,51, 0)
@gmorell
gmorell / container.yml
Created May 9, 2017 23:41
container variable expansion
version: "2"
settings:
# The deployment_output_path is mounted to the Conductor container, so
# that the `run` and `deployment` commands can write generated Ansible
# playbooks to it.
# deployment_output_path: ~/ansible-deployment
# The Conductor container does the heavy lifting, and provides a portable
# Python runtime for building your target containers. It should be derived
# from the same distribution as you're building your target containers with.
conductor_base: centos:7
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.resource import Resource
import json, hmac
from hashlib import sha1
from blinker import signal
class WebhookServer(Resource):
import network
sta_if = network.WLAN(network.STA_IF)
ap_if = network.WLAN(network.AP_IF)
if not sta_if.isconnected():
sta_if.active(True)
sta_if.connect('YYY', '')
ap_if.active(False)
while not sta_if.isconnected():
pass
@gmorell
gmorell / secret-key-gen.py
Created March 15, 2016 04:15 — forked from ndarville/secret-key-gen.py
Generating a properly secure SECRET_KEY in Django
"""
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`