Skip to content

Instantly share code, notes, and snippets.

@kipavy
kipavy / README.md
Last active September 27, 2025 13:42
Enshrouded Dedicated Server Docker

Enshrouded Dedicated Server with Docker Compose

A simple Docker Compose setup for running an Enshrouded dedicated server with persistent data storage.

Quick Start

1. Create the Docker Compose file

cat > docker-compose.yml <
@kipavy
kipavy / README.md
Last active August 17, 2025 14:30
One-step installer for Citron switch emulator on Linux and Windows

Citron Installer

One-step installer for Citron switch emulator on Linux and Windows.

Usage

Linux

curl -fsSL https://gist.githubusercontent.com/kipavy/2e71fd3624c76e4a7d4f256977152973/raw/installCitron.sh | bash
@kipavy
kipavy / sam.py
Created August 13, 2025 14:14
Python wrapper for SAM, SAM2, SAM2.1, MobileSAM (Segment Anything Model from Meta)
"""
Python wrapper for Ultralytics SAM
Available models:
https://docs.ultralytics.com/models/sam/
SAM base: 'sam_b.pt'
SAM large: 'mobile_sam.pt'
https://docs.ultralytics.com/models/sam-2/
@kipavy
kipavy / bw_to_gdrive.sh
Last active May 20, 2025 10:13
Export Bitwarden Vault as Encrypted ZIP & Upload to Gdrive
#!/bin/bash
# REPLACE WITH YOUR CREDENTIALS
BW_EMAIL=""
BW_PASSWORD=""
GDRIVE_FOLDER_ID=""
EXPORT_FILE="bitwarden_export.json"
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
ZIP_FILE="bitwarden_export_$TIMESTAMP.zip"
@kipavy
kipavy / git_rebase.md
Last active September 18, 2024 06:38 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/main:

git fetch upstream

@kipavy
kipavy / pkg_test.sh
Created September 11, 2024 15:26
This script automates the process of setting up a Conda environment, installing a Python package using Poetry, and running tests. It creates a Conda environment with the specified Python version, installs the package and its dependencies, runs the tests, and then cleans up by deactivating and removing the Conda environment. Usage: ./core.sh <pyt…
#!/bin/bash
# Check if the Python version argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <python-version>"
exit 1
fi
PYTHON_VERSION=$1
ENV_NAME="test_env_$PYTHON_VERSION"
@kipavy
kipavy / hotreload.py
Created August 29, 2024 15:22
Restart fitspy.main whenever a change is detected.
import os
import sys
import time
import subprocess
from watchdog.observers.polling import PollingObserver
from watchdog.events import FileSystemEventHandler
class RestartHandler(FileSystemEventHandler):
def __init__(self, script):
self.script = script
# PowerShell script to find and compact WSL2's ext4.vhdx file
# Stop all WSL2 instances
wsl --shutdown
# Get the user's profile path
$userProfile = [System.Environment]::GetFolderPath("UserProfile")
# Path to WSL2 distributions
$wslPath = "$userProfile\AppData\Local\Packages"
# https://github.com/CEA-MetroCarac/pyvsnr/tree/data-loading-enhancement
# cProfile.Profile()
import cupy as cp
import cupyx
from pyvsnr import vsnr2d
filters=[{'name':'Dirac', 'noise_level':0.35}]
img = cp.random.rand(2048, 2048).astype(cp.float32)
nit=20