Skip to content

Instantly share code, notes, and snippets.

View ileathan's full-sized avatar

Spinelli Valentinuzzi ileathan

View GitHub Profile
@ileathan
ileathan / tinfoilindex.sh
Last active October 27, 2023 05:57
A tinfoil shop in a nutshell (Rooted Nintendo Switches)
# A Tinfoil "shop" is just a collection of roms. You can place them in a directory and allow access to that directory via a simple server and your done.
# This code just loops through all the files and adds their name and filesize to a json that tinfoil likes so that it shows you file sizes.
# There are much more elaborate tools if you need just use this if you know what your doing or if I told you too.
#
# USAGE:
# bash tinfoilindex.sh "urlbase (internet link to the public facing directory with the games)" "Directory with all the games that is public facing (internet directory listing or such)" "Putput json file (serve it over http or however)"
# Example: tinfoilindex.sh "https://example.com/shop" "C:/SwitchGames" "C:/Server/public"
echo -e '{"files":[\n' >> c
i=0
@ileathan
ileathan / microsoftarecodestealers.bat
Last active October 27, 2023 03:45
Crack those crackers back, microsoft is evil.
REM ember that microsoft steals quite literally everything from open source. This should crack Windows OS verification.
@echo off
title Windows 10 ALL version activator&cls&echo ************************************&echo Supported products:&echo - Windows 10 Home&echo - Windows 10 Professional&echo - Windows 10 Enterprise, Enterprise LTSB&echo - Windows 10 Education&echo.&echo.&echo ************************************ &echo Windows 10 activation...
cscript //nologo c:\windows\system32\slmgr.vbs /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk 3KHY7-WNT83-DGQKR-F7HPR-844BM >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk PVMJN-6DFY6-9CCP6-7BKTT-D3WVR >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk MH37W-N47XK-V7XM9-C7227-GCQG9 >nul
@ileathan
ileathan / install_powershell.sh
Created November 28, 2020 12:08
Install powershell on linux (kali-rolling)
# Dependencies
sudo apt-get install libicu63
sudo apt-get install liblttng-ust0
# Download closest thing to kali
# Its updated constantly so just get the latest debian file.
# https://github.com/PowerShell/PowerShell/releases/tag/v7.1.0
wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell_7.1.0-1.debian.11_amd64.deb
# Install
@ileathan
ileathan / AuroraRestoreThumbnails.sh
Created October 27, 2023 03:30
Restores xbox 360 thumbnails (root required)
set -o errexit -o nounset
# The idea is simple, the format Aurora uses is #GameID_DatabaseID where the GameID stays the same and the DatabaseID changes, so we check only the first 8 chars of the backup and the new and if they match we copy over the backups cover file to the new gamedata.
for file in GameData.bak/*; do
# Remove the following as they arnt games?
for file2 in GameData/*; do
if [ "${file2:9:8}" == "00000000" ]; then
continue
fi
if [ "${file2:9:2}" == "FF" ]; then
@ileathan
ileathan / thumbnailrestore.sh
Last active October 27, 2023 03:29
Aurora coverart restore / sharing
set -o errexit -o nounset
# The idea is simple, the format Aurora uses is #GameID_DatabaseID where the GameID stays the same and the DatabaseID changes, so we check only the first 8 chars of the backup and the new and if they match we copy over the backups cover file to the new gamedata.
for file in GameData.bak/*; do
# Remove the following as they arnt games?
for file2 in GameData/*; do
if [ "${file2:9:8}" == "00000000" ]; then
continue
fi
if [ "${file2:9:2}" == "FF" ]; then
#
# Renames all retroarch thumbnails names, roms names, and reupdates the playlist.lpl files with said information.
#
# If your playlists names match your rom directories this will rename all cusom images and roms according to the lpl
# file passed in. Copy all your playlists over to where this script is located and from a wsl (windows subsystem for linus) console
# and ussage would be:
#
# bash rename.sh "PlaylistFile.lpl" "/your/retroarch/thumbnails/folder" "/your/retroarch/roms/folder" "/your/retroarch/playlists/folder"
#
# To update your entire retroarch at once you can follow the above advice and run:
@ileathan
ileathan / rename2.sh
Last active October 27, 2023 03:28
Same as my last gist but probably what more people want. Renames custom pictures correctly.
# Just move the images.
# Usage: bash rename2.sh "playlistfile.lpl" "/retroarch/thumbnails/folder"
IFS=$'\n'
for file in $(cat "$1" | grep -oP '.*"path":.*/\K.*\.([^"]*)'); do
ext=${file##*.}
escfile=$(echo $file | perl -pe 's/([[\]()+\$^{}])/\\$1/g')
newname=$(cat "$1" | grep -zoP "(/|\\\)$escfile"'",\s*\"label\": \"\K[^"]*')
newname=$(echo "$newname" | perl -pe 's/[&*\/:`<>?\|]/_/g')
dir="${1:0:-4}"
if [[ "${file:0:-((${#ext}+1))}" != "$newname" ]]; then
@ileathan
ileathan / generate.sh
Last active October 27, 2023 03:28
Hacked Switch Tinfoil Custom Index Generation (From Games Directory)
# USAGE:
#
# Navigate to the directory that has all the switch rom files (your shop) and run this code.
# A shop.tfl file will be created in your local directory (you should be in your shop)
# which you can serve over http or however you chose to serve it.
# This just has the file location/size for now.
echo -e '{"files":[\n' >> shop.tfl;for f in *.nsp *.xci; do echo -e "{\n\"url\": \"$f\",\n\"size\": "$(stat "$f"|grep -oP "Size: \K\d+")"\n}," >> shop.tfl;done; echo "]}" >> shop.tfl
# USAGE: RetroArchRenameBoilerPoint.sh ./Nintendo\ -\ Nintendo\ Entertainment\ System.lp
IFS=$'\n'
for filename in $(cat "$1" | grep -oP '.*"path": ".*/\K.*\.[^"]*'); do
romname=$(echo $filename | perl -pe 's/([[\]()+\$^{}])/\\$1/g')
romname=$(cat "$1" | grep -zoP "(/|\\\)$romname"'",\s{7}\"label\": \"\K[^"]*')
romname=$(echo "$romname" | perl -pe 's/[&*\/:`<>?\|]/_/g')
if [[ "${filename:0:-4}" == "$romname" ]]; then
:
else
@ileathan
ileathan / base-x encoder gist
Last active January 29, 2018 00:39
Continually mod and map.
encode = (n, a) => {
var r = [];
do {
n = (n - (r[r.length] = n % a.length)) / a.length
} while(n);
return r.map(n=>a[n]).reverse().join('')
};
encode(4095, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')
// Outputs "//"