Skip to content

Instantly share code, notes, and snippets.

View gersilex's full-sized avatar

Leroy Förster gersilex

View GitHub Profile
@DelusionalAI
DelusionalAI / gist:c3bfa05b5268a96f8a0c527ceace5f1b
Last active November 10, 2023 10:27
ESPHome Fallback config example.
output:
- platform: gpio
pin: GPIO4
id: shelly_25_relay_1
- platform: gpio
pin: GPIO15
id: shelly_25_relay_2
fan:
- platform: binary
@tomhicks
tomhicks / sweep-swoop.js
Last active December 10, 2021 10:02
Listen to your web pages
const audioCtx = new window.AudioContext();
const oscillator = audioCtx.createOscillator();
oscillator.connect(audioCtx.destination);
oscillator.type = "sine";
let numItems = 0
oscillator.frequency.setValueAtTime(
1,
audioCtx.currentTime
@mzealey
mzealey / migrate_live_ssh
Last active May 16, 2024 09:57 — forked from gersilex/migrate_live_ssh
OpenNebula Live Migration Examples
#!/usr/bin/env bash
#
# Live migration-over-SSH script for use with OpenNebula.
# Set the 'migrate' action to run this script in /etc/one/oned.conf
# for your respective virtualization type. Only KVM is supported right now.
#
# Author: Leroy Förster <leroy.foerster@immonet.de>
# Contributor: Paul Jost <paul.jost.immonet.de>
# Contributor: Mark Zealey - port to ONE 5.10
#
@wilmardo
wilmardo / jackett.md
Created October 29, 2019 13:08
Jackett add public indexers all in one go

Source: Jackett/Jackett#1576 (comment)

From the Jackett page, click the "add indexer" button so that the pop up window with the full list of indexers appears.

You'll then need to open your browser's development toolbar (in Chrome just hit F12) and go to the JavaScript Console and enter the following:

////hack to add all free indexers in Jackett
$(document).ready(function () {
	EnableAllUnconfiguredIndexersList();
@maiers
maiers / gist:3a9dd183dd5e6c434a85694c1fb2a57a
Created May 27, 2018 14:58
Compare DNS output from two Servers for multiple domains
#!/bin/bash
# This script will create a visual comparison of the
# output of the two DNS servers defined as NS0 and
# NS1 for the fqdn defined in DOMAINS
#
# Created: 2018-05-27
# Author: Sebastian <sebastian@progether.com>
#
# Source: https://stackoverflow.com/a/29079962/683977
@lmakarov
lmakarov / lambda-basic-auth.js
Created August 30, 2017 19:15
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
@hExPY
hExPY / demo.items
Created January 20, 2017 07:40
Openhab 2 German Weather Dashboard
Number Weather_Temperature "Temperatur [%.2f °C]" <temperature> (groupDashboardWeather) {weather="locationId=home, type=temperature, property=current"}
Number Weather_Temperature_Feel "gefühlte Temperatur [%.2f °C]" <temperature_cold> (groupDashboardWeather) {weather="locationId=home, type=temperature, property=feel"}
DateTime Sunrise_Time "Sonnen Aufgang [%1$tH:%1$tM]" <sunrise> (groupDashboardWeather) {channel="astro:sun:hamburg:rise#start" }
DateTime Sunset_Time "Sonnen Untergang [%1$tH:%1$tM]" <sunset> (groupDashboardWeather) {channel="astro:sun:hamburg:set#start" }
Number Weather_Humidity "Luftfeuchtigkeit [%d %%]" <humidity> (groupDashboardWeather) {weather="locationId=home, type=atmosphere, property=humidity"}
Number Weather_Pressure "Luftdruck [%.2f mb]" <fan> (groupD
@xbb
xbb / README
Last active May 14, 2024 14:33
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@fstern
fstern / gist:a68b215b4e01392d405bcc86cecf2f6f
Last active October 12, 2016 14:02
My journey with chef...

my chef story

(names removed to protect the guilty)

On one day, the chef-client on our opennebula hosts failed. After looking into it, someone had updated the base recipe and removed a repository which was no longer reachable. So, I'll update the environment of the application cookbook.

$ berks update

Now test it.

$ kitchen converge

@tadly
tadly / pacaur_install.sh
Last active August 30, 2023 13:15
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
#
# !!! IMPORTANT !!!
# As of 2017-12-14, pacaur is unmaintained (https://bbs.archlinux.org/viewtopic.php?pid=1755144#p1755144)
# For alternatives see the arch wiki: https://wiki.archlinux.org/index.php/AUR_helpers#Active
# pacaur seems to get occasional updates to fix breaking changes due to pacman updates though.
#
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time