Skip to content

Instantly share code, notes, and snippets.

@aangairbender
aangairbender / cg-fall-challenge-2023-pm.md
Last active June 4, 2024 09:26
CG Fall Challenge 2023 PM of aangairbender

aangairbender, Legend 11th!

Overview

Very important for me was having good toolkit for this contest:

  • code for state serialization (every turn I print base64 encoded state of the bot to stderr, so I can run my bot locally from any replay from any frame and debug the bot's behavior)
  • state visualizer (to debug fish tracking mostly)

Bot itself consists of 3 components:

  • fish tracking
@ThePlenkov
ThePlenkov / boot.sh
Last active October 25, 2025 01:59
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null