Skip to content

Instantly share code, notes, and snippets.

View alertedsnake's full-sized avatar

Michael Stella alertedsnake

View GitHub Profile
--- Packages.orig/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs 2023-12-15 17:36:51.390368366 -0500
+++ Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs 2023-12-15 17:37:10.234606341 -0500
@@ -108,7 +108,12 @@
{
continue;
}
- var groups = (IEnumerable)groupsList?.GetValue(servicePointGroups.GetValue(scheduler));
+ var servicePointGroup = servicePointGroups?.GetValue(scheduler);
+ if (servicePointGroup == null)
+ {
@alertedsnake
alertedsnake / uwsgi.ini
Last active May 26, 2020 18:58
Uwsgi logs in JSON format
# add 'logfile' to the plugin list
plugins = python3,logfile
# match logs already in json format
logger = applogger stdio
log-route = applogger ^{
log-encoder = format:applogger ${msg}
log-encoder = nl:applogger
# all other logs, we jsonify
@alertedsnake
alertedsnake / test.py
Last active March 9, 2020 19:46
sentry exception tests
import sentry_sdk
import MySQLdb
import logging
import os
from sentry_sdk.integrations.logging import LoggingIntegration
DB_HOST = 'bogus.example.com'
DB_USER = 'monkey'
DB_PASS = 'you know what this is'
DB_DB = 'database'
@alertedsnake
alertedsnake / gist:5d3c7c85da75ce5dee9536027c34e034
Created February 27, 2020 15:31
Bash function to do AWS 2-factor auth
#
# Bash function to peform AWS 2-factor auth.
#
# This assumes you have $AWS_CREDENTIAL_FILE set to an actual credentials file, and
# AWS_PROFILE set to the appropriate profile in said file.
#
awsmfa() {
unset AWS_ACCESS_KEY_ID
unset AWS_AWS_SECRET_ACCESS_KEY
@alertedsnake
alertedsnake / dumpyaml.py
Last active January 23, 2018 19:20
How to handle multi-line blocks nicely in yaml
from ruamel.yaml import YAML
def str_representer(dumper, data):
if len(data.splitlines()) > 1: # check for multiline string
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|')
return dumper.represent_scalar('tag:yaml.org,2002:str', data)
@alertedsnake
alertedsnake / randompw.py
Last active January 4, 2018 17:54
xkcd #936 password generator
#!/usr/bin/env python3
"""
Random password generator, ala https://xkcd.com/936/
The wordlist is assumed to be a list of words in the language of your choice,
of the sizes of your choice. I got mine out of aspell::
aspell dump master | \
sed -e "s/'s$//" -e '/^[A-Z]/d' -e '/^.\{4,6\}$/!d' | \
sort -u > wordlist.txt
@alertedsnake
alertedsnake / gist:4bb4e421ab60aaac5de5006d6123d9f7
Created October 3, 2017 21:21
Useful EC2 shell functions
ec2ip() {
aws ec2 describe-instances --instance-ids $* | jq '.Reservations[0].Instances[0].PrivateIpAddress' | sed 's/"//g'
}
ec2ssh() {
ssh $(ec2ip $1)
}
Given this config file:
```YAML
credentials:
ftp://ftp.someserver.com:
user: foo
pass: bar
path: /path/to/logs
ftp://ftp.otherserver.com:

Keybase proof

I hereby claim:

  • I am alertedsnake on github.
  • I am alertedsnake (https://keybase.io/alertedsnake) on keybase.
  • I have a public key ASCfxV4qRyhhdxbeDgbNB5_C-vSKI1qSFx2kKHXLcpDhPwo

To claim this, I am signing this object:

@alertedsnake
alertedsnake / gist:b7dc834510cf9883c84b3cfb286397b5
Created May 27, 2016 15:30
Kill all servers in an AWS Autoscaling Group
#!/bin/bash
#
# Note that this requires the really cool command-line tool 'jq'
#
if [ -z "$1" ]; then
echo "as_kill_instances [group]"
exit -1
fi