Skip to content

Instantly share code, notes, and snippets.

View sugoidogo's full-sized avatar

SugoiDogo sugoidogo

View GitHub Profile
@sugoidogo
sugoidogo / videolink.js
Last active February 28, 2025 17:38
extract a working video url from a twitch embed url using my videolink service
import { DurableObject } from "cloudflare:workers";
export default {
/** @param {Request} request */
async fetch(request, env, ctx) {
if(request.headers.get('Accept')!='text/event-stream'){
return new Response()
}
let id = env.EVENT_SOURCE.idFromName('test');
let stub = env.EVENT_SOURCE.get(id);

Using CurseForge Overwolf API Key with Prism Launcher

Go to Settings > APIs > API Keys and put the following into the "CurseForge Core API" box

$2a$10$bL4bIL5pUWqfcO7KQtnMReakwtfHbNKh6v1uTpKlzhwoueEJQnPnm

image

If the API key changes, it may be found again with this guide

@sugoidogo
sugoidogo / smove.lua
Last active November 29, 2024 11:42
fuel and chunk safe movement for ComputerCraft turtles
local forward=0
local right=0
local up=0
local rotation=0
local function quit(reason)
if smove.print_status then
print(reason)
end
fs.delete('.smove_home')
[Unit]
Description=initialize nvidia devices and the nvidia container toolkit for podman containers
[Service]
Type=oneshot
ExecStart=nvidia-smi
ExecStart=nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
@sugoidogo
sugoidogo / fetch-retry.js
Created August 18, 2024 16:04
fetch polyfill with automatic retries in case of network issues
/**
* @param {RequestInfo | URL} input
* @param {RequestInit} init
* @returns {Promise<Response>}
*/
function fetch(input,init=undefined){
return window.fetch(input,init).catch(async error=>{
if(error.message==="Failed to fetch"){
await new Promise(function(resolve,reject){
setTimeout(resolve,1000)
[Container]
ContainerName=%N
Image=docker.io/author/image:latest
Volume=/etc/%N:/config
Network=Host
AutoUpdate=registry
Pull=newer
[Service]
ExecStartPre=mkdir -p /etc/%N
@sugoidogo
sugoidogo / 0-setup.ps1
Last active August 16, 2024 02:58
New PC setup script
# irm 'https://gist.githubusercontent.com/sugoidogo/5a42715e6589a836b9692399013d1657/raw/0-setup.ps1' | iex
# allow running local scripts. Question: why is it called -Force when it's really a -NoConfirm?
Set-ExecutionPolicy RemoteSigned -Force
# Disable forced updates
$RegPath="HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
New-Item $RegPath -Force
New-ItemProperty $RegPath AUOptions -PropertyType DWORD -Value 2 -Force
@sugoidogo
sugoidogo / tailscale-deck.sh
Last active May 28, 2024 11:53
Install tailscale into /opt on steam deck
#!/bin/bash
set -xeuo pipefail
mkdir -p /opt/tailscale
cd /opt/tailscale
curl -L https://pkgs.tailscale.com/stable/tailscale_latest_amd64.tgz | tar xzf - --strip-components 1
cd systemd
sed -i s.ExecStart=/usr/sbin/tailscaled.ExecStart=/opt/tailscale/tailscaled.g tailscaled.service
sed -i s.EnvironmentFile=/etc/default/tailscaled.EnvironmentFile=/opt/tailscale/systemd/tailscaled.defaults.g tailscaled.service
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
@sugoidogo
sugoidogo / chromium-flatpak-sync.sh
Last active August 16, 2024 05:01
Enable chromium google account sync
flatpak override --user --env=GOOGLE_DEFAULT_CLIENT_ID=77185425430.apps.googleusercontent.com --env=GOOGLE_DEFAULT_CLIENT_SECRET=OTJgUOQcT7lO7GsGZq2G4IlT org.chromium.Chromium