Skip to content

Instantly share code, notes, and snippets.

View Erisa's full-sized avatar
💕

Erisa A Erisa

💕
View GitHub Profile
@Erisa
Erisa / index.js
Created November 28, 2023 04:28
tunnel status Worker - just use with quick edit
const tunnelStatusTypes = {
TUNNEL_STATUS_TYPE_INVALID: {
color: 3553599,
name: 'Invalid',
},
TUNNEL_STATUS_TYPE_INACTIVE: {
color: 3553599,
name: 'Inactive',
},
TUNNEL_STATUS_TYPE_DOWN: {
@Erisa
Erisa / node_exporter.sh
Last active December 13, 2023 23:50 — forked from galexrt/node_exporter.sh
Simple Prometheus node_exporter install script (Updated for 1.0.1)
#!/bin/bash
set +x
version="${VERSION:-1.6.1}"
arch="${ARCH:-linux-amd64}"
bin_dir="${BIN_DIR:-/usr/local/bin}"
wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \
-O /tmp/node_exporter.tar.gz
@Erisa
Erisa / worker.js
Created June 9, 2023 18:15
xkcd feed
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
let url = 'https://xkcd.com/rss.xml'
let match = /(&lt;img(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\n\uD800-\uDFFF])*? alt="((?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\n\uD800-\uDFFF])*?)"(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\n\uD800-\uDFFF])*?&gt;<\/description>)/ig
let replace = "$1&lt;p&gt;&lt;/p&gt;</description><summary>$2</summary>"
var resp = await fetch(url)
@Erisa
Erisa / create-cloud-template.sh
Created April 20, 2023 22:52 — forked from meramsey/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@Erisa
Erisa / repeat.ts
Last active September 5, 2023 09:05
tunnel status cf alert with https://repeat.dev
const tunnelStatusTypes = {
TUNNEL_STATUS_TYPE_INVALID: {
color: 3553599,
name: 'Invalid',
},
TUNNEL_STATUS_TYPE_INACTIVE: {
color: 3553599,
name: 'Inactive',
},
TUNNEL_STATUS_TYPE_DOWN: {
@Erisa
Erisa / repeat.ts
Last active January 7, 2023 17:48
Repeat for clearing out Pages deployments (https://repeat.dev)
const config = [
{
project: "erisa",
days: 180
},
{
project: "super-secret-sauce",
days: 60
}
]
@Erisa
Erisa / fly.toml
Created October 10, 2022 22:58
thelounge on fly
# fly.toml file generated for lounge on 2022-10-10T20:05:47+01:00
app = "lounge"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[deploy]
strategy = "rolling"
@Erisa
Erisa / as-ire.js
Last active April 1, 2024 01:55
Cloudflare Worker serving https://asi.re modifications
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
let url = new URL(request.url)
let response = await fetch(request)
const contentType = response.headers.get('Content-Type');
@Erisa
Erisa / updown-proxy.js
Created April 25, 2021 16:39
updown.io status page proxy for cf workers
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
var whitelist = [
"/rik1",
// etc
]
@Erisa
Erisa / seafile_trash.rb
Last active March 22, 2021 01:54
Restore everything from trash in seafile
# frozen_string_literal: true
require 'json'
require 'net/http'
libs = [
"aa3ffa6f-61d3-4cda-bf7d-89a856068fc3",
"563aa837-4865-4e4e-b0aa-6333c2634c64",
"385275da-c656-4f2f-918a-d4190828ae20",
'c50d9d60-5478-4c27-89d5-b3c6d1708438',