Skip to content

Instantly share code, notes, and snippets.

View hisakiyo's full-sized avatar
🏠
Working from home

Hisakiyo hisakiyo

🏠
Working from home
View GitHub Profile
@mcinnes01
mcinnes01 / zigbee2mqtt-snzb-01.yaml
Last active October 13, 2023 21:35
Zigbee2MQTT - Sonoff SNZB-01 Zigbee Wireless Switch
blueprint:
name: Zigbee2MQTT - Sonoff SNZB-01 Zigbee Wireless Switch
description: Automate your Sonoff SNZB-01 Zigbee Wireless Switch via Zigbee2MQTT.
domain: automation
input:
switch:
name: Sonoff SNZB-01 Zigbee Wireless Switch
description: Sonoff SNZB-01 Zigbee Wireless Switch to use
selector:
entity:
@ajmassi
ajmassi / LXCBindMount.md
Last active April 27, 2024 22:16
Create a bind mount from a Proxmox host on an unprivileged lxc container

Proxmox Assign Bind Mount To Unprivileged Container

In order for the LXC container to have full access the proxmox host directory, a subgid is set as owner of a host directory, and an ACL is used to ensure permissions.

Bind Mount dataset to LXC

Add the following line to /etc/pve/lxc/<CT_ID>.conf

mp0:/mount/point/on/host,mp=/mount/point/on/lxc

Create group on host

In the default Proxmox configuration, unpriviliged container subgids will have the prefix "10" followed by the expected 4-digit gid.

@anthonytxie
anthonytxie / hodl20.py
Created March 24, 2018 21:01
Hodl 20 Rebalancing Algorithm
def calc_allocations(self, date, quantity, cap):
"""Figure out ideal allocations for a given date"""
# {
# coin_name: (percent_allocation, data)
# }
top_market = self.get_top_market(date, quantity)
total_cap = sum([coin.market_cap for coin in top_market])
allocations = [{