Skip to content

Instantly share code, notes, and snippets.

View connectthefuture's full-sized avatar

justthefracts connectthefuture

  • Midwest usa
View GitHub Profile
@simora
simora / vm_backup.sh
Created August 17, 2019 18:44
Unraid KVM vm backup script
#!/bin/bash
#
# This script will stop all Unraid VMs and rsync the specified src directories to
# the specified dst directory. All src directories will be base64 encoded with
# hostname and directory path to eliminate potential naming collisions and
# the need for character escapes. This will complicate restoration of
# backup data. The following illustrates what will be written and how to decode
# the base64 string.
#
# # echo $SRC
- alias: lower mountian room shades in the morning
id: lowermountainroomshadesinthemorning
trigger:
- platform: numeric_state
entity_id: sun.sun
value_template: "{{ state.attributes.elevation }}"
above: 8.0
# - platform: time
# at: "21:00:00"
# the shades have to NOT be closed, in order for the "close" automation to run
@Jiab77
Jiab77 / bridged-networking-on-wireless-interface-with-kvm.md
Last active March 15, 2025 17:54
So I needed to upgrade my home "web hosting" server from a Raspberry Pi 3b to something more flexible where I could even simulate a Raspberry Pi 3b given power. The new server hardware is now an Intel NUC i7 16GB / 250Gb SSD NVME. 😁

Bridged Networking on Wireless Interface with KVM and more...

So I needed to upgrade my home "web hosting" server from a Raspberry Pi 3b to something more flexible where I could even simulate a Raspberry Pi 3b given power. The new server hardware is now an Intel NUC i7 16GB / 250Gb SSD NVME. 😁

I order to accomplish this task I had to find a way to bridge the wireless interface which is the faster one on my actual home network setup.

I've also tried to mix the functionnality from another Rapsberry Pi (3b+ this time) who's acting as WLAN to LAN bridge. More details on this setup. But this was finally a bad idea and I was not able to make it work along the virtual network bridge created by libvirt or manually created... (I will explain why later)

The main difficulty was to use the DMZ IP address given by the router and route the traffic to the guest VM's.

Server / Desktop

@warp1337
warp1337 / Dockerfile
Last active March 29, 2021 11:06
Running Margin in Docker
# Download official ubuntu 18.04 base image
FROM ubuntu:18.04
# Update software repository
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && apt-get update && apt-get -y upgrade
# Install LXDE and super minimal deps
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y lxde-core lxterminal libfontconfig1 mesa-common-dev \
libglu1-mesa-dev libasan4 libubsan0 gdb nano libxcb-xkb-dev libxkbcommon-*
## this part is the ESPhome Yaml file ##
esphome:
name: window_control_linear
platform: ESP8266
board: d1_mini
wifi:
ssid: !secret wifi
password: !secret wifi_pw
@stecman
stecman / hackaday-to-md.py
Last active June 30, 2022 02:21
Hackaday.io article to markdown converter for migrating or backing up projects/posts
#!/usr/bin/env python3
# Convert hackaday posts to markdown with images stored nearby
#
# This needs the following modules to run:
#
# - https://github.com/matthewwithanm/python-markdownify
# - https://2.python-requests.org/en/master/
# - https://www.crummy.com/software/BeautifulSoup/
esphome:
name: garage
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi
password: !secret wifi_pw
# Enable logging
@freddielunchbird
freddielunchbird / gist:a74d916b0b9d92ed327552caebfefd67
Created May 16, 2019 14:12
create >1 postgres + postgres_exporter
sudo pg_createcluster -p 5433 --start 11 CLUSTER
vagrant@n6:~$ sudo pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
11 CLUSTER 5433 online postgres /var/lib/postgresql/11/CLUSTER /var/log/postgresql/postgresql-11-CLUSTER.log
11 main 5432 online postgres /var/lib/postgresql/11/main log/postgresql-%Y-%m-%d_%H%M%S.log
sudo vi /etc/postgresql/11/CLUSTER/pg_hba.conf
@ljm42
ljm42 / mount9p
Last active February 26, 2021 20:22
#!/bin/bash
#
# Version 1.4
# Latest version of this script: https://gist.github.com/ljm42/a49268b325df3a2e78d5bafec10b5be7
#
# This script will automatically mount any 9p mount tags that exist
# Designed to be run on Unraid through the User Scripts plugin
#
# 9p docs:
# https://wiki.qemu.org/Documentation/9psetup
from prefect import task, Flow
@task
def create_list():
return [1, 1, 2, 3]
@task
def add_one(x):
return x + 1