View proxmox_get_vm_name.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROXMOX_SERVER="pve:8006" | |
USERNAME="root@pam" | |
PASSWORD="<your pve password>" | |
NODE="pve" | |
INTERNAL_BRIDGE="vmbr1" | |
NIC="ens18" # nic name inside the vm to be templatized | |
MAC_ADDRESS="$(ip addr show $NIC | grep -m 1 -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | tr 'a-f' 'A-F' | head -n1)" | |
# Step 1: Login and get ticket and CSRF token |
View _wireguard_nat_guide.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt install wireguard-tools | |
cd /etc/wireguard | |
# https://www.wireguard.com/quickstart/ | |
umask 077 | |
wg genkey | tee privatekey | wg pubkey > publickey | |
# https://stanislas.blog/2019/01/how-to-setup-vpn-server-wireguard-nat-ipv6/ | |
echo "net.ipv4.ip_forward = 1 | |
net.ipv6.conf.all.forwarding = 1" > /etc/sysctl.d/wg.conf |
View grafana_alert_maint.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reveal dashboards and panels that have alerts but no notification channels | |
# Works on Grafana v8 Alerts (v9 changes alerts a lot) | |
# This script is useful for when you accidentally change alert notification channel | |
import requests | |
from config import base_url, api_key | |
headers = {'Authorization': f'Bearer {api_key}'} | |
def get_dashboards(): | |
url = f'{base_url}/api/search' | |
response = requests.get(url, headers=headers) |
View gist:adee7a5019473f3f07679f21889c9d07
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('[data-href]').forEach((a)=>{ a.href = a.dataset.href; a.onclick=(e)=>{e.preventDefault(); e.stopPropagation(); window.open(a.href, 'blank')}} ) |
View output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _LP64 1 | |
#define __AARCH64EL__ 1 | |
#define __AARCH64_CMODEL_SMALL__ 1 | |
#define __AARCH64_SIMD__ 1 | |
#define __APPLE_CC__ 6000 | |
#define __APPLE__ 1 | |
#define __ARM64_ARCH_8__ 1 | |
#define __ARM_64BIT_STATE 1 | |
#define __ARM_ACLE 200 | |
#define __ARM_ALIGN_MAX_STACK_PWR 4 |
View dance.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
B=' o \ o / _ o __| \ / |__ o _ \ o / o ' | |
C='/|\ | /\ ___\o \o | o/ o/__ /\ | /|\' | |
D='/ \ / \ | \ /) | ( \ /o\ / ) | (\ / | / \ / \' | |
E='55555555556666668888888777777555557777777766666666666677777775555' | |
P=0 | |
function dance() { | |
if [ $P -ge ${#B} ]; then | |
P=0 | |
fi | |
N=${E:$P:1} |
View _test.spec.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { test, expect } from '../helper/test.mjs'; | |
import { signInProcess} from '../helper/sign_in_helper.mjs' | |
test('test', async ({ page, bpd, playwright }) => { | |
await Promise.all([ | |
(async ()=>{ | |
const browser2 = await playwright.chromium.launch(); | |
const context2 = await browser2.newContext(); | |
const page2 = await context2.newPage(); | |
const pc2 = await bpd.createCompanyWithUsersContacts(); |
View rebroadcast.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You can use streamlink to extract the stream URL, e.g.: | |
# PL_URL=$(streamlink --stream-url https://livestream-website-url best) | |
# Generally figured out from this gist... | |
# https://gist.github.com/keiya/c8a5cbd4fe2594ddbb3390d9cf7dcac9 | |
PL_URL=https://some.owncast-server.tv/hls/1/stream.m3u8 | |
while ! curl -s $PL_URL | grep -q offline; do |
View global-video-shortcuts-userscript.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Global Video Shortcuts | |
// @namespace Violentmonkey Scripts | |
// @match *://*/* | |
// @grant none | |
// @version 1.0 | |
// @author - | |
// @description lets you step through videos on any site using youtube's keyboard shortcut design | |
// ==/UserScript== |
View gist:2022a0aba0f61708ff72df20a18dfd72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --name timescaledb -t timescale/timescaledb:latest-pg12 -e POSTGRES_USER=user -e POSTGRES_PASSWORD=pass -e POSTGRES_DB=db -p 5432:5432 | |
docker run --name grafana -t grafana/grafana:7.5.6 -p 3000:3000 | |
now you can visit port 3000 and add a datasource using the credentials |
NewerOlder