Compare commits

..

27 Commits

Author SHA1 Message Date
5b3c01607d Add obs notification script 2024-06-17 07:13:26 -03:00
c11cf9202f script that tries to reformat scoop manifests into a nice order 2024-05-25 21:29:29 -03:00
4a7a367547 Add userscript that tries to show the tax on an item before checkout 2024-05-25 21:29:01 -03:00
0085d4dee2 add f4 toggle script 2024-05-25 21:28:32 -03:00
d3648342e5 Fix script 2024-05-25 21:27:29 -03:00
642edffcfe update script to be invoked only in folder where you want to remove version from folders 2024-05-25 21:11:34 -03:00
b449ded8fe Add initial folder scanning remove ver script 2024-05-25 21:05:18 -03:00
93a2d7e329 Make simple ftp server more reusable and add params 2024-04-19 15:32:12 -03:00
7be7397ab1 Add mcrcon wrapper script for ease of entering creds 2024-03-27 23:06:15 -03:00
e66fdf942a Update toggle update script to work with scoop steam installations 2024-03-27 23:04:09 -03:00
d2c5e8cdb9 Add script to compare local and remote scoop packages 2024-02-28 09:17:25 -04:00
fc62233d3f Add basic declarative scoop manager 2024-02-28 08:40:52 -04:00
5caeecb0e7 Make pip toggle utf8 2024-02-10 18:38:53 -04:00
271c4bfc92 Fix sanity check in openasar injector 2024-02-07 11:01:50 -04:00
7d90433a9a Add example on how to use java for scripting 2024-02-07 09:48:47 -04:00
30f67ab42b Merge remote-tracking branch 'refs/remotes/origin/master' 2024-02-03 15:14:47 -04:00
2acd572e8e Add rainbow test script 2024-02-03 15:14:16 -04:00
e4c6e42efb Add volumefix ahk script 2024-02-03 15:13:48 -04:00
ca5302f42f Fix syntax in obsidian checker 2024-01-31 10:14:09 -04:00
3b40a9d62f Add script that installs or uninstalls openasar on linux (tested only on mint) 2024-01-24 14:52:58 -04:00
71c14465b2 Add script for checking for updates for obsidian (only tested on linux mint) 2024-01-24 14:52:17 -04:00
f5abc5a54b Set spinner values to 0 and add update url 2024-01-07 00:57:02 -04:00
307dd6b0dc Add voltorbflip spinner userscript 2024-01-07 00:46:48 -04:00
bbb71a7c49 Add small wget script 2023-12-23 21:43:18 -04:00
f4316e598d Add tool to download from archive.org 2023-12-03 15:02:36 -04:00
76fb8c521d Add bruno api tests 2023-12-02 23:45:36 -04:00
ccc631b2ac Add stardew for upcoming 1.6 update 2023-12-02 23:42:25 -04:00
38 changed files with 925 additions and 9 deletions

10
JavaScripts/HelloWorld Executable file
View File

@ -0,0 +1,10 @@
#!/bin/env -S java --source 11
class Main {
public static void main(String args[]) {
System.out.println("HelloWorld!");
// Print the sum of 1 and 2
System.out.println(1 + 2);
}
}

View File

@ -0,0 +1,66 @@
# Import json parsing and urllib
import json
import urllib.request
# Import subprocess for running dpkg
import subprocess
# Endpoint for the latest release
API_URL = "https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest"
# DEB file name, will be filled in later
DEB_NAME = ""
# URL for the latest deb file, will be filled in later
DEB_URL = ""
# Version number, will be filled in later
DEB_VERSION = ""
# Installed version number, will be filled in later
INSTALLED_VERSION = ""
# Get the latest release from the API
with urllib.request.urlopen(API_URL) as url:
data = json.loads(url.read().decode())
assets = data["assets"]
for asset in assets:
if asset["name"].endswith(".deb"):
DEB_NAME = asset["name"]
DEB_URL = asset["browser_download_url"]
# Parse the version number from the deb file name
# Example: obsidian_0.12.15_amd64.deb -> 0.12.15
DEB_VERSION = DEB_NAME.split("_")[1]
print("Latest version: " + DEB_VERSION)
# Get the installed version number by parsing the output of dpkg -s obsidian
output = subprocess.run(["dpkg", "-s", "obsidian"], capture_output=True)
# Parse the output for the version number
# Example: Version: 0.12.15
for line in output.stdout.decode().split("\n"):
if line.startswith("Version:"):
INSTALLED_VERSION = line.split(" ")[1]
print("Installed version: " + INSTALLED_VERSION)
def semver_check_new(old, new):
# Split the version numbers into arrays of numbers
old_split = old.split(".")
new_split = new.split(".")
# Loop through the numbers
for i in range(len(old_split)):
# If the new version is higher, return true
if int(new_split[i]) > int(old_split[i]):
return True
# If the new version is the same or lower, return false
return False
# Check if the new version is higher than the installed version
if semver_check_new(INSTALLED_VERSION, DEB_VERSION):
print("New version available!")
# Download the deb file
urllib.request.urlretrieve(DEB_URL, DEB_NAME)
# Install the deb file
subprocess.run(["pkexec", "apt", "install", f"./{DEB_NAME}"])
# Remove the deb file
subprocess.run(["rm", DEB_NAME])
else:
print("No new version available")

122
OpenAsarInjector/main.py Normal file
View File

@ -0,0 +1,122 @@
ASAR = "app.asar"
ASAR_BACKUP = ASAR + ".bak"
SYMLINK_PATH = ""
REAL_PATH = ""
DISCORD_FOLDER = ""
RESOURCES_PATH = ""
def root():
import os
if os.geteuid() != 0:
print("Script not running as root")
exit()
def backup():
import os
# Check for existing backup
if os.path.isfile(RESOURCES_PATH + ASAR_BACKUP):
print("Backup already exists, openasar is already installed")
exit()
try:
print(RESOURCES_PATH + ASAR)
os.rename(RESOURCES_PATH + ASAR, RESOURCES_PATH + ASAR_BACKUP)
except Exception as e:
print("Couldn't rename file: " + str(e))
def find():
import os
from shutil import which
# Get full path of discord symlink on path
global SYMLINK_PATH
SYMLINK_PATH = which("discord")
# Parse real path of discord symlink
global REAL_PATH
REAL_PATH = os.path.realpath(SYMLINK_PATH)
# Get containing folder
global DISCORD_FOLDER
DISCORD_FOLDER = os.path.dirname(REAL_PATH)
# Add /resources/ to the real path
global RESOURCES_PATH
RESOURCES_PATH = DISCORD_FOLDER + "/resources/"
def download():
import urllib.request
import json
# Get nightly release from github
# url: https://github.com/GooseMod/OpenAsar/
# release: https://github.com/GooseMod/OpenAsar/releases/tag/nightly
API_URL = "https://api.github.com/repos/GooseMod/OpenAsar/releases/latest"
DOWNLOAD_URL = ""
with urllib.request.urlopen(API_URL) as url:
data = json.loads(url.read().decode())
DOWNLOAD_URL = data['assets'][0]['browser_download_url']
# Download the file
urllib.request.urlretrieve(DOWNLOAD_URL, RESOURCES_PATH + ASAR)
def kill():
import os
import signal
import psutil
# Get discord process
for proc in psutil.process_iter():
if proc.name() == "Discord":
# Kill discord
os.kill(proc.pid, signal.SIGTERM)
def uninstall():
import os
if os.path.isfile(RESOURCES_PATH + ASAR_BACKUP):
try:
os.remove(RESOURCES_PATH + ASAR)
os.rename(RESOURCES_PATH + ASAR_BACKUP, RESOURCES_PATH + ASAR)
except Exception as e:
print("Couldn't remove/rename file: " + str(e))
else:
print("No backup found, openasar is not installed")
exit()
# Should check if the package has been updated, as discords asar is much larger
def sanity_check():
import os
# Get file size of asar
asar_size = os.path.getsize(RESOURCES_PATH + ASAR)
# If the asar is larger than 1MB, discord has probably updated
if asar_size > 1000000:
print("Discord has probably updated, please clear backups and reinstall")
print("Would you like to clear backups? (y/n)")
answer = input().lower()
if answer == "y":
if os.path.isfile(RESOURCES_PATH + ASAR_BACKUP):
os.remove(RESOURCES_PATH + ASAR_BACKUP)
print("Backup cleared, installation will continue as normal")
print("Backups cleared, installation will continue as normal")
else:
print("Backups not cleared, please clean manually")
exit()
def main():
import sys
root()
kill()
find()
sanity_check()
if len(sys.argv) > 1:
if sys.argv[1] == "uninstall":
uninstall()
print("Uninstalled openasar")
else:
print("Unknown argument")
else:
backup()
download()
print("Installed openasar")
if __name__ == "__main__":
main()

View File

@ -26,7 +26,7 @@ if (Test-Path $location) {
Write-Host $newPipConfig
# Write the new content to the file
$newPipConfig | Out-File $location -Force
$newPipConfig | Out-File $location -Force -Encoding utf8
} else {
# If it doesn't exist, create it
New-Item -Path $location -ItemType File

37
Rainbow/rainbow.js Normal file
View File

@ -0,0 +1,37 @@
// Approximate racket functions
function circle(color) {
print(`${color} circle`)
}
function square(color) {
print(`${color} square`)
}
function print(shape) {
console.log(shape)
}
// Cuz javascript doesn't have functional primitives
function first(list) {
return list[0]
}
function rest(list) {
return list.slice(1)
}
// Helper to cycle through the functions
function cycle(list) {
return rest(list).concat(first(list))
}
// The actual function
function rainbow(...functions) {
let colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
function rainbowRecursive(functions, colors) {
if (colors.length === 0) {
return
}
first(functions)(first(colors))
rainbowRecursive(cycle(functions), rest(colors))
}
rainbowRecursive(functions, colors)
}
rainbow(circle, square)

17
Rainbow/rainbow.rkt Normal file
View File

@ -0,0 +1,17 @@
#lang racket
(require pict)
(require pict/color)
; The actual function
(define (rainbow . shapes)
(define colors (list red orange yellow green blue purple))
(define (cycle lst) (append (rest lst) (list (first lst))))
(define (rainbow-recursive shapes colors)
(cond
[(empty? colors) (void)]
[(print((first colors) (first shapes)))
(rainbow-recursive (cycle shapes) (rest colors))]
)
)
(rainbow-recursive shapes colors))
; Example usage
(rainbow (filled-rectangle 25 25) (filled-ellipse 25 25))

View File

@ -0,0 +1,72 @@
# Get each folder in the current directory
$folders = Get-ChildItem -Directory
# Array to store the folders that need to be renamed
$work = @()
foreach ($folder in $folders) {
# Find the version number in the folder name
$version = $folder.Name -match '(\d+\.\d+\.\d+\.\d+)'
if ($version) {
# Replace entire folder name with the version number
$new_name = $matches[0]
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
$alpha = $folder.Name -match '(\d+\.\d+\.\d+\.\d+)([a-zA-Z])'
if ($alpha) {
$new_name = $matches[1]
$new_name = $new_name + $matches[2]
}
$toadd = New-Object PSObject
$toadd | Add-Member -MemberType NoteProperty -Name path -Value $folder.FullName
$toadd | Add-Member -MemberType NoteProperty -Name newname -Value $new_name
$work += $toadd
Write-Host "Rename $folder to $new_name"
continue
}
# Find the version number in the folder name
$version = $folder.Name -match '(\d+\.\d+\.\d+)'
if ($version) {
# Replace entire folder name with the version number
$new_name = $matches[0]
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
$alpha = $folder.Name -match '(\d+\.\d+\.\d+)([a-zA-Z])'
if ($alpha) {
$new_name = $matches[1]
$new_name = $new_name + $matches[2]
}
$toadd = New-Object PSObject
$toadd | Add-Member -MemberType NoteProperty -Name path -Value $folder.FullName
$toadd | Add-Member -MemberType NoteProperty -Name newname -Value $new_name
$work += $toadd
Write-Host "Rename $folder to $new_name"
continue
}
# Find the version number in the folder name
$version = $folder.Name -match '(\d+\.\d+)'
if ($version) {
# Replace entire folder name with the version number
$new_name = $matches[0]
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
$alpha = $folder.Name -match '(\d+\.\d+)([a-zA-Z])'
if ($alpha) {
$new_name = $matches[1]
$new_name = $new_name + $matches[2]
}
$toadd = New-Object PSObject
$toadd | Add-Member -MemberType NoteProperty -Name path -Value $folder.FullName
$toadd | Add-Member -MemberType NoteProperty -Name newname -Value $new_name
$work += $toadd
Write-Host "Rename $folder to $new_name"
continue
}
}
Read-Host -Prompt "Press Enter to continue"
foreach ($item in $work) {
Rename-Item -Path $item.path -NewName $item.newname
}

View File

@ -0,0 +1,26 @@
// Run with node
// Read ~/scoop/apps.json and compare it to scoop export
// Then display the differences in the installed apps and the apps.json file
// read apps.json file
let fs = require('fs');
let apps = fs.readFileSync('C:/Users/Isaac/scoop/apps.json', 'utf8');
apps = JSON.parse(apps);
apps = apps.apps;
// run scoop export in shell and save output to variable
let { execSync } = require('child_process');
let installedApps = execSync('scoop export').toString();
installedApps = JSON.parse(installedApps);
installedApps = installedApps.apps;
// Make a set out of each of the arrays on the Name property
let appsSet = new Set(apps.map(app => app.Name));
let installedAppsSet = new Set(installedApps.map(app => app.Name));
// Find the difference between the two sets
let diffFromInstalledApps = new Set([...appsSet].filter(x => !installedAppsSet.has(x)));
let diffFromApps = new Set([...installedAppsSet].filter(x => !appsSet.has(x)));
console.log("Apps in apps.json but not installed: ", diffFromInstalledApps);
console.log("Apps installed but not in apps.json: ", diffFromApps);

View File

@ -0,0 +1,71 @@
<#
use this order to reformat json objects:
version
description
homepage
license
notes
depends
suggest
architecture
url
hash
extract_dir
extract_to
pre_install
installer
post_install
env_add_path
env_set
bin
shortcuts
persist
pre_uninstall
uninstaller
post_uninstall
checkver
autoupdate
#>
# Read all json files in the current directory
Get-ChildItem -Filter *.json | ForEach-Object {
# Read the file
$json = Get-Content $_.FullName | ConvertFrom-Json -Depth 9
# Create a new object with the properties in the desired order
$newJson = [ordered]@{
version = $json.version
description = $json.description
homepage = $json.homepage
license = $json.license
notes = $json.notes
depends = $json.depends
suggest = $json.suggest
architecture = $json.architecture
url = $json.url
hash = $json.hash
extract_dir = $json.extract_dir
extract_to = $json.extract_to
pre_install = $json.pre_install
installer = $json.installer
post_install = $json.post_install
env_add_path = $json.env_add_path
env_set = $json.env_set
bin = $json.bin
shortcuts = $json.shortcuts
persist = $json.persist
pre_uninstall = $json.pre_uninstall
uninstaller = $json.uninstaller
post_uninstall = $json.post_uninstall
checkver = $json.checkver
autoupdate = $json.autoupdate
}
# Remove any null properties
$newJson = $newJson | Where-Object { $_.Value -ne $null }
# Convert the new object back to json and write it back to the file
$newJson | ConvertTo-Json -Depth 9 | Set-Content $_.FullName
}
# Run scoop json prettier on all json files in the current directory
~/scoop/apps/scoop/current/bin/formatjson.ps1 -Dir .

54
ShowTax/showtax.js Normal file
View File

@ -0,0 +1,54 @@
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2024-04-12
// @description try to take over the world!
// @author You
// @match https://www.amazon.ca/*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function() {
const TAX = 0.15;
// Todo: decide if it should just round up to the nearest dollar
// Todo: fix queryselectorall only finding one element at a time
const changeNode = function(node) {
var wholeNode = node.querySelector('.a-price-whole');
var fractionNode = node.querySelector('.a-price-fraction');
var whole = wholeNode ? wholeNode.textContent : '0';
var fraction = fractionNode ? fractionNode.textContent : '0';
whole = parseInt(whole);
fraction = parseInt(fraction);
whole += whole * TAX;
fraction += fraction * TAX;
whole = Math.floor(whole);
fraction = Math.floor(fraction);
if (fraction >= 100) {
whole += 1;
fraction -= 100;
}
if (fraction < 10) {
fraction = '0' + fraction;
}
wholeNode.textContent = whole;
fractionNode.textContent = fraction;
}
const find = function() {
console.log("Finding price nodes");
document.querySelectorAll('.a-price').forEach((node) => {
if (node.attributes['found']) {
return;
}
node.attributes['found'] = true;
console.log(node);
console.log("Price node found")
changeNode(node);
});
}
//find();
setInterval(find, 1000);
})();

View File

@ -1,16 +1,26 @@
param (
[int] [alias('p')] $port = 21,
[string] [alias('d')] $directory = '.',
[bool] [alias('w')] $write = $false
)
$venv = "\.pyftplib"
$venv = $HOME + $venv
# Create virtual environment
if (-not (Test-Path venv)) {
virtualenv venv
if (-not (Test-Path $venv)) {
write-host "Creating virtual environment at $venv"
virtualenv "$venv"
}
# Activate virtual environment
.\venv\Scripts\activate.ps1
. ($venv + "\Scripts\Activate.ps1")
# Install dependencies
pip install pyftpdlib
# Run FTP server
python -m pyftpdlib
# Not working for streaming video files
# twistd -n ftp -r .
if ($write) {
python -m pyftpdlib -p $port -d $directory -w
} else {
python -m pyftpdlib -p $port -d $directory
}

View File

@ -0,0 +1,20 @@
$appId = 377160
$networkLocation = "https://raw.githubusercontent.com/IsaacShoebottom/Scripts/master/SteamToggleUpdate/ToggleUpdates.ps1"
# Test if ToggleUpdates.ps1 exists and invoke it if it does
If (Test-Path -Path ".\ToggleUpdates.ps1" -PathType Leaf) {
.\ToggleUpdates.ps1 $appId
}
Else {
# construct temp path
$env:temp = [System.IO.Path]::GetTempPath()
$tempPath = $env:temp + "\ToggleUpdates.ps1"
# Download the network script
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($networkLocation, $tempPath)
# Invoke the network script
&$tempPath $appId
# Delete the network script
Remove-Item -Path $tempPath
}

View File

@ -0,0 +1,20 @@
$appId = 413150
$networkLocation = "https://raw.githubusercontent.com/IsaacShoebottom/Scripts/master/SteamToggleUpdate/ToggleUpdates.ps1"
# Test if ToggleUpdates.ps1 exists and invoke it if it does
If (Test-Path -Path ".\ToggleUpdates.ps1" -PathType Leaf) {
.\ToggleUpdates.ps1 $appId
}
Else {
# construct temp path
$env:temp = [System.IO.Path]::GetTempPath()
$tempPath = $env:temp + "\ToggleUpdates.ps1"
# Download the network script
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($networkLocation, $tempPath)
# Invoke the network script
&$tempPath $appId
# Delete the network script
Remove-Item -Path $tempPath
}

View File

@ -1,7 +1,12 @@
# function that takes in an app id as a number and returns the path to the steam library folder that contains the app id
function parseVDFforPath([int]$appId) {
# Steam libary folder vdf if using scoop
$scoopVDF = "$env:USERPROFILE\scoop\apps\steam\current\steamapps\libraryfolders.vdf"
# Steam library folders vdf absolute path
$steamLibraryFoldersVDF = "C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf"
$normalVDF = "C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf"
# Set the path to the vdf file based on whether you are using scoop or not
$steamLibraryFoldersVDF = if (Test-Path $scoopVDF) { $scoopVDF } else { $normalVDF }
# convert the app id to a string
$appIdString = $appId.ToString()

5
VoltorbFlipSpinners/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
VoltorbFlipSpinners/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/VoltorbFlipSpinners.iml" filepath="$PROJECT_DIR$/.idea/VoltorbFlipSpinners.iml" />
</modules>
</component>
</project>

6
VoltorbFlipSpinners/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,84 @@
// ==UserScript==
// @name Voltorb Flip Spinners
// @namespace http://tampermonkey.net/
// @version 0.0.2
// @description Adds spinners to the inputs of numbers
// @author Isaac Shoebottom
// @match http://voltorbflip.com/
// @icon http://voltorbflip.com/favicon.ico
// @grant none
// @run-at document-idle
// @updateURL https://git.shoebottom.ca/IsaacShoebottom/Scripts/raw/branch/master/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js
// @downloadURL https://git.shoebottom.ca/IsaacShoebottom/Scripts/raw/branch/master/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js
// ==/UserScript==
// To add spinners I just need to change the input type from text to numbers
/**
* Finds the board element
* @returns {HTMLElement}
*/
function findBoard() {
return document.getElementById("board");
}
/**
* Finds all inputs that are children of the passed element
* @param {HTMLElement} element
* @returns {Array<HTMLElement>}
*/
function findInputs(element) {
// Find all input elements that are children of the root element
// Should have the type="text" attribute
let col = element.getElementsByTagName("input");
// Convert the HTMLCollection to an array
return Array.from(col).filter((input) => input.type === "text");
}
/**
* Adds a spinner to the input element on mouseover
* @param {HTMLElement} inputElement
* @returns {void}
*/
function addMouseOverSpinner(inputElement) {
console.log("Adding mouseover spinner on element: " + inputElement);
inputElement.addEventListener("mouseover", () => {
console.log("Mouseover on element: " + inputElement);
inputElement.type = "number";
});
inputElement.addEventListener("mouseout", () => {
console.log("Mouseout on element: " + inputElement);
inputElement.type = "text";
});
}
/**
* Sets the content of the input to be the passed value
* @param {HTMLElement} inputElement
* @param {number} value
* @returns {void}
*/
function setInputValue(inputElement, value) {
console.log("Setting input value of" + inputElement + "to" + value);
inputElement.value = value;
}
/**
* Executes the script
* @returns {void}
*/
function execute() {
let board = findBoard();
if (!board) {
console.log("Could not find board");
return;
}
let inputs = findInputs(board);
console.log("Found " + inputs.length + " inputs");
inputs.forEach(addMouseOverSpinner)
inputs.forEach((input) => setInputValue(input, 0));
}
execute();

12
VolumeFix/VolumeFix.ahk Normal file
View File

@ -0,0 +1,12 @@
; Fix Windows Volume:
$Volume_Up::
SoundGet, volume
Send {Volume_Up}
SoundSet, volume + 1
Return
$Volume_Down::
SoundGet, volume
Send {Volume_Down}
SoundSet, volume - 1
Return

8
archive-rom/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

8
archive-rom/.idea/archive-rom.iml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.9 (archive-rom)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,12 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="list.__getitem__" />
</list>
</option>
</inspection_tool>
</profile>
</component>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

11
archive-rom/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.9 (archive-rom)" />
</component>
<component name="DiscordProjectSettings">
<option name="show" value="ASK" />
<option name="description" value="" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (archive-rom)" project-jdk-type="Python SDK" />
</project>

8
archive-rom/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/archive-rom.iml" filepath="$PROJECT_DIR$/.idea/archive-rom.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,60 @@
import os
import sys
import requests
import humanize
from urllib.parse import unquote
def parse_file(file_name):
urls = []
with open(file_name, 'r') as f:
for line in f:
urls.append(unquote(line.strip()))
return urls
def get_filename(url):
return url.split('/')[-1]
def print_progress(amount_written, file_size, sizes):
for size in sizes:
if amount_written >= size:
sizes.remove(size)
percentage = (10 - len(sizes)) * 10
print(f"{percentage}% Written {humanize.naturalsize(amount_written)} / {humanize.naturalsize(file_size)}")
return sizes
def download_url(url, filename):
# Constant
temp_file = filename + ".tmp"
chunk_size = 1024 * 1024 * 8 # 8MB
# Request
r = requests.get(url, stream=True)
# More constants
file_size = int(r.headers.get('Content-Length'))
sizes = [file_size * (i / 100) for i in range(0, 101, 10)] # 101, because range is exclusive lmao
# Statistics
amount_written = 0
with open(temp_file, 'wb') as f:
for chunk in r.iter_content(chunk_size=chunk_size):
if chunk:
f.write(chunk)
amount_written += chunk_size
sizes = print_progress(amount_written, file_size, sizes)
# Rename
os.rename(temp_file, filename)
def main():
file = sys.argv[1]
urls = parse_file(file)
for url in urls:
filename = get_filename(url)
print(f"Downloading {filename}")
download_url(url, filename)
if __name__ == '__main__':
main()

2
archive-rom/run.ps1 Normal file
View File

@ -0,0 +1,2 @@
.\venv\Scripts\activate.ps1
python .\download-urls.py .\urls.txt

5
archive-rom/todo.url Normal file
View File

@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
IDList=
URL=https://stackoverflow.com/questions/62007674/multi-thread-requests-python3

36
archive-rom/urls.txt Normal file
View File

@ -0,0 +1,36 @@
https://archive.org/download/wii_rvz_usa/wii_rvz_usa/Animal%20Crossing%20-%20City%20Folk%20%28USA%2C%20Asia%29%20%28En%2CFr%2CEs%29%20%28Rev%201%29.rvz
https://archive.org/download/wii_rvz_usa/wii_rvz_usa/Donkey%20Kong%20-%20Barrel%20Blast%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa/wii_rvz_usa/Donkey%20Kong%20Country%20Returns%20%28USA%29%20%28En%2CFr%2CEs%29%20%28Rev%201%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/GoldenEye%20007%20%28USA%29%20%28En%2CFr%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/Kirby%27s%20Dream%20Collection%20-%20Special%20Edition%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/Kirby%27s%20Epic%20Yarn%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/Kirby%27s%20Return%20to%20Dream%20Land%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/Last%20Story%2C%20The%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/Legend%20of%20Zelda%2C%20The%20-%20Skyward%20Sword%20%28USA%29%20%28En%2CFr%2CEs%29%20%28Rev%202%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/Legend%20of%20Zelda%2C%20The%20-%20Twilight%20Princess%20%28USA%29%20%28En%2CFr%2CEs%29%20%28Rev%202%29.rvz
https://archive.org/download/wii_rvz_usa_p2/wii_rvz_usa/Mario%20Kart%20Wii%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/New%20Super%20Mario%20Bros.%20Wii%20%28USA%29%20%28En%2CFr%2CEs%29%20%28Rev%202%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/No%20More%20Heroes%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/No%20More%20Heroes%202%20-%20Desperate%20Struggle%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Ookami%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Pikmin%202%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Pokemon%20Battle%20Revolution%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Punch-Out%21%21%20%28USA%29%20%28En%2CFr%2CEs%29%20%28Rev%201%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Rhythm%20Heaven%20Fever%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Super%20Mario%20All-Stars%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Super%20Mario%20Galaxy%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Super%20Mario%20Galaxy%202%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Super%20Paper%20Mario%20%28USA%29%20%28Rev%202%29.rvz
https://archive.org/download/wii_rvz_usa_p3/wii_rvz_usa/Super%20Smash%20Bros.%20Brawl%20%28USA%29%20%28Rev%202%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Wario%20Land%20-%20Shake%20It%21%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/WarioWare%20-%20Smooth%20Moves%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Wii%20Music%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Wii%20Party%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Wii%20Play%20%28USA%29%20%28Rev%201%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Wii%20Sports%20%28USA%29%20%28Rev%201%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Wii%20Sports%20Resort%20%28USA%29%20%28En%2CFr%2CEs%29%20%28Rev%201%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Wii%20Sports%20%2B%20Wii%20Sports%20Resort%20%28USA%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Xenoblade%20Chronicles%20%28USA%2C%20Asia%29%20%28En%2CFr%2CEs%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Trauma%20Center%20-%20New%20Blood%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Trauma%20Center%20-%20Second%20Opinion%20%28USA%29.rvz
https://archive.org/download/wii_rvz_usa_p4/wii_rvz_usa/Trauma%20Team%20%28USA%29.rvz

View File

@ -0,0 +1 @@
wget -r -nd -np $args[0]

4
mcrcon/rcon.ps1 Normal file
View File

@ -0,0 +1,4 @@
$ip = "localhost"
$ip = Read-Host -Prompt 'Enter the RCON IP (default: localhost)'
$password = Read-Host -MaskInput -Prompt 'Enter the RCON Password'
mcrcon -H $ip -p $password

View File

@ -0,0 +1,29 @@
local obs = obslua
local ffi = require("ffi")
local winmm = ffi.load("Winmm")
-- Put a sound of your choosing next to "Beep on replay save.lua" and don't forget to match its name either in code below or rename your file.
PROP_AUDIO_FILEPATH = script_path() .. "sound_npc_scanner_scanner_photo1.wav"
ffi.cdef[[
bool PlaySound(const char *pszSound, void *hmod, uint32_t fdwSound);
]]
function playsound(filepath)
winmm.PlaySound(filepath, nil, 0x00020000)
end
function on_event(event)
if event == obs.OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED
then playsound(PROP_AUDIO_FILEPATH)
end
end
function script_load(settings)
obs.obs_frontend_add_event_callback(on_event)
end
-- This Lua script was downloaded from https://gist.github.com/snakecase/e816384a071cec31efbb4b9e429c108d
-- Credits: upgradeQ (https://gist.github.com/upgradeQ/b2412242d76790d7618d6b0996c4562f), gima (https://gitlab.com/gima/obsnotification)
-- Thank you guys!

View File

@ -0,0 +1,5 @@
{
"version": "1",
"name": "vimm",
"type": "collection"
}

32
vimm/bruno-vimm/test1.bru Normal file
View File

@ -0,0 +1,32 @@
meta {
name: test1
type: http
seq: 1
}
get {
url: https://download2.vimm.net/download/?mediaId=9709&alt=1
body: none
auth: none
}
query {
mediaId: 9709
alt: 1
}
headers {
Referer: https://vimm.net/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
~Accept-Encoding: gzip, deflate, br
~Connection: keep-alive
~Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8
~Accept-Language: en,en-CA;q=0.7,en-US;q=0.3
~DNT: 1
~Sec-GPC: 1
~Upgrade-Insecure-Requests: 1
~Sec-Fetch-Dest: document
~Sec-Fetch-Mode: navigate
~Sec-Fetch-Site: same-site
~Sec-Fetch-User: ?1
}

32
vimm/bruno-vimm/test2.bru Normal file
View File

@ -0,0 +1,32 @@
meta {
name: test2
type: http
seq: 2
}
get {
url: https://download2.vimm.net/download/?mediaId=9704&alt=1
body: none
auth: none
}
query {
mediaId: 9704
alt: 1
}
headers {
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8
Accept-Language: en,en-CA;q=0.7,en-US;q=0.3
Accept-Encoding: gzip, deflate, br
DNT: 1
Sec-GPC: 1
Connection: keep-alive
Referer: https://vimm.net/
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-site
Sec-Fetch-User: ?1
}