Skip to content

Instantly share code, notes, and snippets.

View Erisa's full-sized avatar
💕

Erisa A Erisa

💕
View GitHub Profile
@Erisa
Erisa / ota-manifest-gen.js
Last active April 22, 2024 02:26
Dynamically generate OTA manifests for iOS apps stored in Cloudflare R2
export default {
async fetch(request, env, ctx) {
let url = new URL(request.url)
let fields = url.pathname.split('/')
const task = fields[1]
const bundleid = fields[2]
if (task === "install") {
return Response.redirect(`itms-services://?action=download-manifest&url=https://${url.hostname}/manifest/${bundleid}`)
@Erisa
Erisa / cfd-termux.sh
Last active April 17, 2024 13:01
Install the Cloudflare Daemon (cloudflared) in Termux
#!/bin/sh
echo 'NOTE: You can now install cloudflared directly from Termux repos.'
echo 'NOTE: To install it from source instead, open the script and comment out the next two lines.'
pkg install cloudflared
exit
# ^ comment out these lines to proceed with the script
echo "--upgrading packages"
yes "" | pkg update
@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 / hlg.cr
Created November 11, 2020 17:01
Hard Link Generator
#!/bin/env -S crystal build
# Hard Link Generator
# Generates hard links for all files in a given folder,
# while also finding and replacing strings in the filenames.
#
# The folder is created for you, but existing files (Running it twice?) will cause errors.
#
# Usage:
@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 / 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 / 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 / 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 / dynamic_variables.rb
Last active February 28, 2023 21:35
Dynamic Variables [RPG Maker VX Ace]
if true #Set to false to disable script.
# (C) Copyright Erisa A (Seriel) 2019
###############################################################################
# Seriel ~ Dynamic Variables #
# See under this notice for some help. #
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# The code here can be reused for any purpose, with credit given. #
# This includes both Commercial and Non-Commercial use. #
# However, contact is appreciated before Commercial use. #
# Modified versions must give credit, however it must not be implied that the #