Skip to content

Instantly share code, notes, and snippets.

View larsenv's full-sized avatar

Larsen Vallecillo larsenv

View GitHub Profile

Keybase proof

I hereby claim:

  • I am larsenv on github.
  • I am larsenv (https://keybase.io/larsenv) on keybase.
  • I have a public key ASA2JdchgEPOhDtpP9rZka1ltBESNXDcbKKlILpbYbRH2wo

To claim this, I am signing this object:

@larsenv
larsenv / worst_code_ever.py
Last active December 8, 2020 14:39
This used to be the code for the RiiConnect24 News Channel. This is why it took me forever to make it. I think I've learned from my mistake tremendously. Kids, stay in school, or else your code will look like this when trying to work on a big project.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import subprocess
import shutil
import urllib2
import time
import re
import platform
@larsenv
larsenv / wii-remote-date.py
Last active December 18, 2018 01:29
Wii Remotes have a date engraved in them if you open the battery cover. Type in the 7-character code engraved (or just the first 3 characters) and it'll tell you what the date is.
import sys
if len(sys.argv) != 2:
print("Usage: python wii-remote-date.py <date string>")
sys.exit(1)
if len(sys.argv[1]) < 3:
print("Invalid string")
sys.exit(1)
@larsenv
larsenv / dispisg.py
Last active August 17, 2023 17:18
Use pisg with Discord! This script will take a Discord message log created with DiscordChatExporter and convert it into the "mbot" format so that it can be used to generate a webpage of statistics with pisg.
import datetime
import sys
messages = ""
if len(sys.argv) != 3:
print("Usage: dispisg.py <input> <output>")
sys.exit(1)
with open(sys.argv[1], "r") as f:
@larsenv
larsenv / Using pisg with Discord.md
Created April 2, 2019 23:29
Use pisg, a program that takes IRC logs and makes a webpage about statistics of the chat, with Discord.

Using pisg with Discord

This tutorial will briefly tell you how to use pisg, a program that takes IRC logs and makes a webpage about statistics of the chat, with Discord.

Instructions

  1. Use DiscordChatExporter to generate a log of the chat you want to use pisg with. You need to make it saved in the PlainText format. I prefer the command-line version of the tool. (If you're on Linux/Mac, run this tool with mono.)
  2. Run my Python script to convert the log into a format that pisg can read (the "mbot" format).
  3. Run pisg with the command that the script outputs.
@larsenv
larsenv / name_secrets.py
Last active June 17, 2019 16:54
Find Wiimmfi game name and secrets from an executable
import subprocess
import sys
if len(sys.argv) != 3:
exit("Usage: name_secrets.py <DOL or ARM binary> <Wii or DS>")
if sys.argv[2] != "wii" and sys.argv[2] != "ds":
exit("Platform must be specified as Wii or DS.\nUsage: name_secrets.py <DOL or ARM binary> <Wii or DS>")
string = subprocess.Popen(["strings", sys.argv[1]], stdout=subprocess.PIPE)
@larsenv
larsenv / pbskids.py
Last active January 26, 2024 07:43
PBS Kids Video Downloader
import json
import requests
import subprocess
home = requests.get("https://content.services.pbskids.org/v2/kidspbsorg/home/").text
home = json.loads(home)
shows = {}
episodes = {}
@larsenv
larsenv / wad.py
Last active May 30, 2020 20:36
wad.py - Python script to make a clean Wii WAD using another WAD or a ticket. (Not my script)
#!/usr/bin/python
from binascii import hexlify, unhexlify
from Crypto.Cipher import AES
from struct import pack, unpack
from sys import argv, exit
import requests
import re
def modu(dat):
wad.write(b'\x00' * ((0x40 - (len(dat) % 0x40)) % 0x40))
@larsenv
larsenv / locast.py
Last active April 1, 2021 16:41
Locast Video Downloader
import json
import os
import requests
import subprocess
cities = {}
cities["Atlanta"] = [524, 33.7490, -84.3880]
cities["Baltimore"] = [512, 39.2904, -76.6122]
cities["Boston"] = [506, 42.3601, -71.0589]