Skip to content

Instantly share code, notes, and snippets.

View Tekunogosu's full-sized avatar
🎯
Focusing

Theysa Tekunogosu

🎯
Focusing
View GitHub Profile
@Tekunogosu
Tekunogosu / wg-killswitch.sh
Last active March 8, 2025 01:39
Wireguard killswitch
#!/bin/bash
# Copy the file to /etc/wireguard/
# Make it executable: chmod +x /etc/wireguard/wg-killswitch.sh
# Add the following lines to your wireguard conf (/etc/wireguard/wg0.conf)
# PostUp = /etc/wireguard/wg-killswitch.sh up %i 123.45.78.99
# PostDown = /etc/wireguard/wg-killswitch.sh down %i 123.45.78.99
# Make sure you update the ip addresses in this file to match your wireguard config and your network
@Tekunogosu
Tekunogosu / server.sh
Created February 3, 2025 14:53
Vintage Story dedicated server script, using TMUX instead of Screen
#!/bin/bash
# /etc/init.d/vintagestory.sh
# version 0.4.2 2016-02-09 (YYYY-MM-DD)
# This shell script launches the game server on linux
#
### BEGIN INIT INFO
# Provides: vintagestory
# Required-Start: $local_fs $remote_fs tmux-cleanup
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
@Tekunogosu
Tekunogosu / tekqr
Last active December 10, 2024 12:58
Hackmud: Cleans QRCodes for T2 missions - May work on other things
function (context, args) {
let qrstates = [];
let corruptChars = #fs.scripts.lib().corruption_chars.split('')
function buildQRPattern() {
// Convert string to array of characters
const chars = "<qr missing>".split('');
// For each character, create a pattern that matches either the original
@Tekunogosu
Tekunogosu / Cargo.toml
Last active September 26, 2024 04:50
Small cli program to open a new tab in kitty. There are no options here; this was an exercise in rust and optimizations for release builds. The binary is 363k on my system when built.
[package]
name = "ktab"
version = "0.1.0"
edition = "2021"
[dependencies]
[profile.release]
opt-level = 3
lto = "fat"
@Tekunogosu
Tekunogosu / ktab.py
Created September 26, 2024 02:41
Kitty: Open new tab with set title from within kitty
#!/usr/bin/env python3
# create a new tab and set the title
# make sure to update your ~/.conf/kitty/kitty.conf to enable: allow_remote_control on
import subprocess
import argparse
import sys
def open_kitty_tab_with_title(title: str) -> None:
# The command to open a new tab with the specified title
@Tekunogosu
Tekunogosu / starfieldcustom.ini
Last active February 13, 2024 13:59
starfieldcustom.ini
[Display]
fDefault1stPersonFOV=90
fDefaultFOV=90
fDefaultWorldFOV=90
fFPWorldFOV=90
fTPWorldFOV=90
;bEnableRaytracing=1
;bUseSkyLighting=1
;set to 0 to disable
fMaxAnisotropy=2
@Tekunogosu
Tekunogosu / gist:b5a21e8bc3395bdc81c4b0ec1a00362a
Created September 2, 2023 05:29
vim regex for gentoo kernel modules
#/lib/modules/6.5.0-gentoo-nox/kernel/virt/lib/irqbypass.ko
:%s/.*\/\([^/]\+\)\.k\{,1\}o\?$/\1/
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit, QLabel
from PyQt5.QtGui import QCursor, QKeyEvent
from PyQt5.QtCore import Qt, QEvent
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
## Make sure the kernel in use has a real time patch available for it.
## Check the below patch site for a patch for the appropriate kernel
## For gentoo, its usually necessary to emerge a specific version of the kernel as not all version have a patch set
## Using different kernel than the one you're using also allows you to switch between a working version if something goes wrong
## You need to make sure the exact version matches, example: 5.15.65 is exact version I used
## Patch site
## https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.15.59-gentoo Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Gentoo 11.3.0 p4) 11.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110300
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800