Skip to content

Instantly share code, notes, and snippets.

View MrStonedOne's full-sized avatar
🎯
Focusing

Kyle Spier-Swenson MrStonedOne

🎯
Focusing
View GitHub Profile
<?php
//This has very little documentation, and is a hobbled togeather mess where speed to code and preformance of the code were placed before code readability or maintainability. Only works on linux. Requires gzip and gunzip shell commands as well as the php extentions.
// edit the server array below to your server(s)
// symlink server-gamedata/servername to the static folder of tgs3 (gamedata folder for tgs2), and symlink parsed-logs to a folder accessable by the webserver
// you also need the runtime condenser in the folder rc, with the binary named rc
// it creates .gz files, you can abuse http-gzip-static and a few rewrite rules in nginx to make nginx serve them up as http-gzip compressed text files.
//exit;
<?php
define('OAUTH2_CLIENT_ID', '');
define('OAUTH2_CLIENT_SECRET', '');
$authorizeURL = 'https://tgstation13.org/phpBB/app.php/tgapi/oauth/auth';
$tokenURL = 'https://tgstation13.org/phpBB/app.php/tgapi/oauth/token';
$apiURLBase = 'https://tgstation13.org/phpBB/app.php/tgapi/user/me';
session_name('TG_OAUTH_PSESSIONID');
@MrStonedOne
MrStonedOne / loadblacklist.sh
Last active December 29, 2023 22:12
Load newline ipv4 subnet list into nftables set. ip blacklist blackhole denylist filter
nft add set netdev filter blackhole {type ipv4_addr\; counter\; auto-merge\; flags interval\; elements={$(grep -oP '^ *(?:[0-9]{1,3}\.){3}[0-9]{1,3}/{0,1}[0-9]{0,2}' blacklist.txt | tr '\n' ',' | sed 's/,*$//')}\;}
# (don't forget to add a drop rule checking the @blackhole rule)
[
"Man (Old Wise)",
"Woman (Elf)",
"Man (Cold, Elf)",
"Woman (Pirate)",
"Man (Violent)",
"Man (Confident)",
"Man (Gruff Dwarf)",
"Man (Northern)",
"Man (Evil Pirate)",
@MrStonedOne
MrStonedOne / PreCompile.sh
Created May 10, 2022 05:38
campbell event hook scripts
#!/bin/bash
# REPO MAINTAINERS: KEEP CHANGES TO THIS IN SYNC WITH /tools/LinuxOneShot/SetupProgram/PreCompile.sh
# No ~mso
set -e
set -x
#load dep exports
#need to switch to game dir for Dockerfile weirdness
original_dir=$PWD
@MrStonedOne
MrStonedOne / breakdown.txt
Created February 28, 2022 04:40
typecache vs istype realworld
typecache_size=1 istype_size=1 count = 2102 typecache = 0.00486952 istype = 0.0100201
typecache_size=2 istype_size=2 count = 27 typecache = 0.00527306 istype = 0.00397598
typecache_size=3 istype_size=1 count = 257 typecache = 0.00114017 istype = 0.00145129
typecache_size=4 istype_size=1 count = 15 typecache = 0.0031474 istype = 0.00425723
typecache_size=4 istype_size=4 count = 20 typecache = 0.00287879 istype = 0.00792816
typecache_size=9 istype_size=1 count = 4 typecache = 0.00223673 istype = 0.00292081
typecache_size=19 istype_size=2 count = 18 typecache = 0.00152456 istype = 0.00148972
typecache_size=20 istype_size=3 count = 5900 typecache = 0.0023313 istype = 0.00363955
typecache_size=29 istype_size=4 count = 270 typecache = 0.00289221 istype = 0.00459528
typecache_size=32 istype_size=5 count = 179054 typecache = 0.00272347 istype = 0.0050234
world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
view = 6 // show up to 6 tiles outward from center (13x13 view)
//this is like this because its how the bot runs this code, and i wanted to repo the bug as seen by the bot.
var/b = new /a()
/a/New()
var/list/types = list()
for (var/datum/typepath as anything in typesof(/datum))
<?php
//Record the votes:
$votes = array(); //array of ckeys assoicated to an array of dicts with vote metadata for each pick the player picked
$candidates = array(); //array of dicts
//grab each vote from the db
while ($row = $res->fetch_assoc()) {
$vote = array();
$ckey = $row['ckey'];
$cid = $row['optionid'];
@MrStonedOne
MrStonedOne / 1gistfile1.txt
Last active April 14, 2021 00:36
/tg/ list length stats.
Shortly after map load:
All List Stats: (round(log(2,list.len)))
0: 20996
1: 18639
2: 33842
4: 7067
8: 3171
16: 227
32: 122
@MrStonedOne
MrStonedOne / README.md
Last active January 5, 2021 08:43 — forked from Log1x/README.md
Uptime Robot Discord Webhook

Uptime Robot Webhook for Discord

Configuration

  • Alert Contact Type: Web-Hook
  • URL to Notify: https://discordapp.com/api/webhooks/CHANGEME/CHANGEME?
    • Must end with ?

[x] Send as JSON (application/json).