Skip to content

Instantly share code, notes, and snippets.

View yuxi-liu-wired's full-sized avatar

Yuxi Liu yuxi-liu-wired

View GitHub Profile
@yuxi-liu-wired
yuxi-liu-wired / sh
Created August 8, 2025 18:26
Enable IPv6s on DigitalOcean
#!/bin/bash -eu
# https://docs.digitalocean.com/products/networking/reserved-ips/how-to/manually-enable/#enable-reserved-ipv6
IFACE_ETH0="eth0"
IFACE_LO="lo"
PREFIX_LEN="128"
# get Droplet metadata
md=$(curl -s 169.254.169.254/metadata/v1.json)
@yuxi-liu-wired
yuxi-liu-wired / chromedriver_updater.py
Created March 19, 2025 20:36
Python script that downloads the latest stable chromedriver to the current folder
import os
import requests
import zipfile
import io
import shutil
from bs4 import BeautifulSoup
def find_chromedriver(root_folder):
# Recursively search for chromedriver.exe in the given folder
for dirpath, dirnames, filenames in os.walk(root_folder):
# Plots for Competitive Programming with Large Reasoning Models (2025)
import requests
from bs4 import BeautifulSoup
import matplotlib.pyplot as plt
import numpy as np
# URL with all IOI 2024 scores
url = "https://cphof.org/standings/ioi/2024"
response = requests.get(url)
@yuxi-liu-wired
yuxi-liu-wired / crlf_to_lf.sh
Last active December 4, 2023 03:32
Run this in your local Git repo to convert it from CRLF to LF ending, and make sure it *stay so*.
#!/bin/bash
git config --global core.eol lf
git config --global core.autocrlf input
echo "* text=auto eol=lf" > .gitattributes
# Find files but exclude .git directory
find . -type f ! -path '*/.git/*' | while read -r file; do
# Check if the file is a text file
if file "$file" | grep -q text; then