Skip to content

Instantly share code, notes, and snippets.

View MCOfficer's full-sized avatar

M*C*O MCOfficer

View GitHub Profile
@MCOfficer
MCOfficer / carbon-intensity.json
Last active June 19, 2025 15:12
static test data
{"data":{"from":"2025-06-11T18:00Z","to":"2025-06-11T18:30Z","generationmix":[{"fuel":"biomass","perc":8},{"fuel":"coal","perc":0},{"fuel":"imports","perc":8.5},{"fuel":"gas","perc":33},{"fuel":"nuclear","perc":9.8},{"fuel":"other","perc":0},{"fuel":"hydro","perc":0},{"fuel":"solar","perc":10.3},{"fuel":"wind","perc":30.2}]}}
@MCOfficer
MCOfficer / IMAGES.md
Last active October 19, 2022 21:55
Public domain AI images generated with Midjourney
@MCOfficer
MCOfficer / plugins.json
Last active May 3, 2021 11:37
trying to break the ES website plugin table
[
{
"name": "Test Plugin",
"authors": "MCOfficer",
"homepage": "\"><script>alert('xss')</script><\"",
"license": "Public Domain",
"version": "0",
"shortDescription": "<a href='https://httbin.org'>link</a> \"><SCRIPT>alert('XSS')</SCRIPT><\"",
"description": "",
"url": "",
@MCOfficer
MCOfficer / odd_batch.py
Last active November 14, 2020 13:27
OpenDirectoryDownloader batch scanning
# Reads URLs from to_scan.txt, one URL per line.
# Outputs the reddit-formatted results to results.txt
import subprocess
import os
with open("to_scan.txt", "r") as f:
urls = [line.strip() for line in f.readlines()]
print("Scanning %s URLs" % len(urls))
@MCOfficer
MCOfficer / README.md
Last active October 27, 2024 18:24
Bash script to download files from gofile.io
@MCOfficer
MCOfficer / trydown
Created July 6, 2020 10:58
A bash script that tries to download a file with multiple programs, for use in makepkg.conf.
#!/bin/bash
# arg 0: URL
# arg 1: Output
url="$1"
output="$2"
url_key="%u"
output_key="%o"
order=(
@MCOfficer
MCOfficer / ESUpdate.bat
Last active March 23, 2020 17:20
InstallNightly - Automate the Installation of Endless Sky Windows Nightlies
@Echo off
setlocal
set GIT=mingit\cmd\git.exe
set NIGHTLY_URL=https://ci.mcofficer.me/job/endless-sky-win64/lastSuccessfulBuild/artifact/EndlessSky.exe
echo Switching working directory
cd %~dp0
echo Checking if MinGit is available...
@MCOfficer
MCOfficer / run_working_dir.cmd
Created December 6, 2018 07:21
tiny script that changes to a directory (relative to its location) and executes a command. useful for executables that need to be executed from their directory.
@echo off
set origin=%cd%
cd %~dp0%1
%2
cd %origin%
@MCOfficer
MCOfficer / spotify-recorder.py
Last active July 29, 2018 19:25
[Python] Script that automatically records tracks played by the linux spotify client.
from subprocess import run, PIPE, Popen
import shutil
import string
try:
import psutil
except ModuleNotFoundError:
print("psutil not found, please install it.\n$pip install psutil\n$python3 -m pip install psutil")
exit(1)
@MCOfficer
MCOfficer / gdrive_sync.py
Created April 25, 2018 02:27
[Python] Crude script that i use to mirror the endless sky assets on my server.
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
import os
import time
import datetime
mirror_dir = "PUT SOMETHING HERE"
gauth = GoogleAuth()
gauth.LoadCredentialsFile("credentials")