Skip to content

Instantly share code, notes, and snippets.

View MaxVRAM's full-sized avatar

Chris Vik MaxVRAM

View GitHub Profile
@MaxVRAM
MaxVRAM / washingdone.json
Created January 21, 2021 00:08
Home Assistant Node Red flow to notify when clothes washing is done with today and tomorrow's chance of rain pulled from BOM (default is Melbourne Australia, change locale in function node after FTP pull request)
[
{
"id":"777f5f6a.b72fc8",
"type":"poll-state",
"z":"921d2869.baa6e",
"name":"Washing Watts over 30",
"server":"dc09bc1e.a5f7f",
"version":1,
"exposeToHomeAssistant":false,
"haConfig":[
@MaxVRAM
MaxVRAM / timestamp_to_timesince.js
Created March 8, 2021 20:09
Convert a timestamp to time since
var timeStamp = msg.payload;
var date = timeStamp.substring(0, timeStamp.lastIndexOf("T") - 1);
var time = timeStamp.substring(timeStamp.lastIndexOf("T") + 1, timeStamp.lastIndexOf("+") - 1);
var bootDateTime = Date.parse(msg.payload);
var currentDateTime = Date.parse(new Date());
var difference = (currentDateTime - bootDateTime) / 1000;
var outputValue;
@MaxVRAM
MaxVRAM / ha_reset_button.yaml
Created March 8, 2021 20:15
HA Reset Button (press and hold unlock)
type: 'custom:button-card'
hold_action:
action: call-service
service: script.pimainrestart
entity: script.pimainrestart
aspect_ratio: 1/1
styles:
card:
- font-size: 14px
- height: 50px
@MaxVRAM
MaxVRAM / docker-compose.yml
Created April 2, 2021 05:40
My Jellyfin compose
version: "2"
services:
jellyfin:
image: ghcr.io/linuxserver/jellyfin
container_name: jellyfin
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ=Australia/Melbourne
{"Features":[{"geometry":{"coordinates":[1126.645785876964,2427.125284738052],"type":"Point"},"properties":{"code":"MI-02-AV01","id":15,"name":"Biunial Magic Lantern","status":"Off"},"type":"Feature"},{"geometry":{"coordinates":[1451.2727790432511,2577.198747152631],"type":"Point"},"properties":{"code":"MI-01-AV02","id":12,"name":"Taree Mackenzie: Pepper's Ghost","status":"Off"},"type":"Feature"},{"geometry":{"coordinates":[1617.8436788154604,2158.9088838268904],"type":"Point"},"properties":{"code":"OB-02-LR01","id":10,"name":"Yanmeearr - Lens Reader","status":"Off"},"type":"Feature"},{"geometry":{"coordinates":[1258.0931093393783,2266.4083143508083],"type":"Point"},"properties":{"code":"MI-01-AV01","id":11,"name":"Shadow Play","status":"Off"},"type":"Feature"},{"geometry":{"coordinates":[1146.3362756263946,2224.898633257414],"type":"Point"},"properties":{"code":"MI-02-AV02","id":16,"name":"Cuphead: Inspiration from the Inkwell (Zoetrope)","status":"Off"},"type":"Feature"},{"geometry":{"coordinates":[808.9370
@MaxVRAM
MaxVRAM / print_modes.py
Created June 15, 2021 10:46
A Python utility script for printing console logs with tierable success/failure options
def print_blank(num_lines = 1):
for x in range(num_lines):
print("")
def print_break():
print(bcolors.DARK + "---------------------------------------------------------------------------------------" + bcolors.ENDC)
def print_info(text, tier=0):
offset = ''.ljust(tier * 3)
print(offset + bcolors.ENDC + " [-] " + str(text))
@MaxVRAM
MaxVRAM / config.conf
Last active December 12, 2021 03:34
my neofetch config
# Use the following command to pull to curernt host:
# curl -o ~/.config/neofetch/config.conf https://gist.githubusercontent.com/MaxVRAM/d83ca67038d98a0e4948e2f228bea268/raw/7ff98567bd707e857ba2374ae63364c930931e55/config.conf
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline
info "Local IP" local_ip
prin ""
@MaxVRAM
MaxVRAM / fedora-fresh.sh
Created October 7, 2022 01:40
Essential repos and my selection of packages for fresh Fedora installs [flatpak/rpm/free/non-free]
#!/bin/bash
echo -e '\n'
echo -e ' _____ ____ ______________ _____ _____ '
echo -e ' / \ _____ ___ __\ \ / /\______ \ / _ \ / \ '
echo -e ' / \ / \\\\__ \ \ \\/ /\\ Y / | _/ / /_\\ \ / \ / \ '
echo -e ' / Y \\/ __ \_> < \ / | | \/ | \/ Y \ '
echo -e ' \____|__ (____ /__/\\_ \ \___/ |____|_ /\____|__ /\____|__ / '
echo -e ' \/ \/ \/ \/ \/ \/ '
echo -e ' Another fresh install by... '
#!/bin/bash
# Set the function-key lock state on system boot for Fedora 37. Adapted from hglee's solution on Linux Mint:
# https://forums.linuxmint.com/viewtopic.php?p=2247849&sid=dd549cc8f87191b1bf45a5727cdd0fae#p2247849
# Current PARAM and MODULE variables defined for ASUS ExpertBook B5
# Valid values depend on target system.
# Try something like `sudo find / | grep fnlock` or `find /sys/module | grep fn` to locate the relevant system module.
PARAM=fnlock_default