Skip to content

Instantly share code, notes, and snippets.

@morgan9e
morgan9e / setup.sh
Created January 22, 2023 17:15
video2x install script (ubuntu)
#!/bin/bash
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo dpkg --add-architecture i386
sudo apt update && sudo apt upgrade
sudo apt install -y aptitude libvulkan1 libvulkan1:i386
sudo aptitude install -y nvidia-driver-525
@morgan9e
morgan9e / sr_macro.js
Last active November 4, 2023 15:24
sr_macro.userscript
// ==UserScript==
// @name SR Macro
// @version 1
// @description SR Macro
// @author https://github.com/morgan9e
// @match https://etk.srail.kr/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=srail.kr
// ==/UserScript==
(function() {
@morgan9e
morgan9e / hangul.html
Created October 11, 2023 15:15
hangul.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/inko.min.js"></script>
<style>
#preview {
position: absolute;
font-size: 14px;
font-weight: bold;
@morgan9e
morgan9e / vultr-toggle-sidebar.js
Last active October 12, 2023 00:58
vultr-toggle-sidebar.userscript
// ==UserScript==
// @name Vultr Toggle Sidebar
// @version 0.2
// @description Vultr Toggle Sidebar
// @author Morgan
// @match https://my.vultr.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=vultr.com
// ==/UserScript==
(function() {
@morgan9e
morgan9e / fallback.py
Created October 12, 2023 05:42
fallback.py - FastAPI simple 301 fallback server
#!/usr/bin/env python
import uvicorn
from fastapi import FastAPI, Request, HTTPException
from fastapi.responses import RedirectResponse, HTMLResponse, FileResponse
import os, sys, requests, datetime
app = FastAPI()
hosts = [
"SERVER1",
@morgan9e
morgan9e / chatgpt.css
Last active November 8, 2023 06:47
ChatGPT Darker Mode
.md\:max-w-3xl {
max-width: 70rem;
}
.xl\:max-w-3xl {
max-width: 70rem;
}
.dark body, .dark html {
background-color: #242424;
@morgan9e
morgan9e / Dfxrdpopbx
Created January 2, 2024 15:06
Dockerfiles
FROM debian:12
RUN apt-get update && apt-get install -y \
xrdp dbus-x11
RUN apt-get install -y \
openbox \
pcmanfm \
hsetroot \
xterm
@morgan9e
morgan9e / cfproxy.js
Created January 2, 2024 15:12
cfproxy.js
async function handleRequest(request) {
const originalHeaders = request.headers;
const proxyUrl = originalHeaders.get('X-Proxy-URL');
const proxyMethod = originalHeaders.get('X-Proxy-Method') || 'GET';
const proxyHeaders = originalHeaders.get('X-Proxy-Headers') || null;
let parsedProxyHeaders = {};
if (proxyHeaders) {
try {
@morgan9e
morgan9e / sandbox
Created January 16, 2024 09:41
wayland nested weston container
#!/bin/bash
if ! podman image exists sandbox; then
cat << EOF > /tmp/sandbox.containerfile
FROM debian:12
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
dbus-x11 \
weston \
xterm \
@morgan9e
morgan9e / entrypoint
Created February 29, 2024 00:02
Multiple instance of user-installed Flatpak.
#!/bin/bash
set -euo pipefail
if [ ! -v FLATPAK_ID ]; then echo "Not in Flatpak."; exit; fi;
DEFAULT_COMMAND=$(cat /app/manifest.json | python3 -c "import sys, json; print(json.load(sys.stdin)['command'])");
NEW_HOME="${HOME}/.altvar"
NEW_APP_DIR="${NEW_HOME}/app/${FLATPAK_ID}"