Skip to content

Instantly share code, notes, and snippets.

@mysiki
mysiki / duplicate_game_cleaner.py
Last active November 10, 2025 10:46
retro gamelist.xml cleanup duplicated
#!/usr/bin/env python3
"""
Duplicate Game Cleaner for GameList XML files
This script identifies and removes duplicate games based on:
1. If different languages: Keep French (fr) game
2. If same language but different formats: Keep zip file
Duplicates are identified by the same game ID in the XML file.
By default, files are moved to a .trash folder in the same directory.
@mysiki
mysiki / update_windows_hosts_with_wsl_ip
Created August 28, 2020 16:27
Simple shell function for update windows hosts file with wsl IP. Can be put it in .bashrc
function wslhosts() {
vm_name="${1:-wsl}"
file_hosts="${2:-/mnt/c/Windows/System32/drivers/etc/hosts}"
wsl_ip=$(ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
mkdir -p "$(dirname "${file_hosts}")" && touch "${file_hosts}"
grep -q " ${vm_name}" "${file_hosts}"
if [ $? -eq 1 ]; then