Skip to content

Instantly share code, notes, and snippets.

View jathanism's full-sized avatar
🍕
See below.

Jathan McCollum jathanism

🍕
See below.
View GitHub Profile
import re
import netaddr
RE_COLON = re.compile(".*::$")
def parse_network_as_string(search):
"""
@jathanism
jathanism / README.md
Created February 22, 2021 21:57 — forked from bruth/README.md
Django command that gives a set of subcommands a namespace. For example, a command named after an app can be defined with a set of subcommands, e.g. `python manage.py command subcommand`.

Subcommander

Managment commands are assumed to be unique across all apps in a Django project. This can lead to long or obscure command names in attempt to namespace those commands.

Subcommander acts as a proxy command giving the real commands a namespace. The subcommander module can be named after the app name or some derivation. The structure looks as follows:

myapp/
    management/
        commands/
@jathanism
jathanism / ipsec.js
Last active September 23, 2020 14:07
Versa API Data dump
define({ "api": [
{
"error": {
"fields": {
"Error 4xx": [
{
"group": "Error 4xx",
"optional": false,
"field": "InternalError",
"description": "<p>Internal Error.</p>"
@jathanism
jathanism / itemrack.md
Last active August 19, 2024 02:50
ItemRack Custom Skinning Event

Gear Set

I have a set named "Skinning" that has Finkle's Skinner and a pair of gloves with +5 Skinning.

Skinning Event

Create a new event called "Skinning" that triggers on mousever of skinnable corpse.

  • In ItemRack go to Events > New
  • Name of event: Skinning
  • Type of event: Script
  • Event Trigger: UPDATE_MOUSEOVER_UNIT
@jathanism
jathanism / gist:10db3d5da745450aed8dff4c1a566edc
Created October 10, 2019 16:16
ShareMouse crash report from 2019-10-09 13:57:36.678 -0700
Process: ShareMouse [10546]
Path: /Applications/ShareMouse.app/Contents/MacOS/ShareMouse
Identifier: com.bartelsmedia.ShareMouse
Version: 5 (5.0.12)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: ShareMouse [10546]
User ID: 501
Date/Time: 2019-10-09 13:57:36.678 -0700
@jathanism
jathanism / unicron.py
Created August 10, 2019 00:24
A simple script that fetches the page for the Unicron Transformer on Hasbro Pulse and does some calculations since the UI view is done in JavaScript.
#!/usr/bin/env python3
"""
Track stats for Unicron.
Requirements:
- Python3
- pip install bs4 requests
"""
@jathanism
jathanism / .tmux.conf
Created March 8, 2019 17:30
My tmux setup that keeps sessions working perfectly. Every time a new session is started and `tmux` is ran, `_ssh_auth_save()` is called to refresh the symlink to `SSH_AUTH_SOCK`.
# Put me in ~/.tmux.conf
set -g default-terminal "screen-256color"
set -g update-environment -r
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
@jathanism
jathanism / click_gflags.py
Last active February 27, 2019 22:23
Click/Gflags compatibiltiy.
"""
Click gflags compatibility, provides a click.Command subclass that plays
nicely with gflags, passing any unknown arguments to it and combining the
help text.
Use me like this:
@click.command(cls=GflagsCommand)
def foo(bar):
...
@jathanism
jathanism / do_auth.py.diff
Created June 15, 2018 15:22
Netaddr fix for do_auth.py
diff --git a/do_auth.py b/do_auth.py
index 921a9d3..305f5a6 100755
--- a/do_auth.py
+++ b/do_auth.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
# vim: ts=4:sw=4:expandtab
"""
@jathanism
jathanism / dict_runner.py
Created December 5, 2017 18:30
Simple example of running different commands on each device.
from trigger.cmds import Commando
class DictRunner(Commando):
"""
Takes a dict of {device:commands} and runs the
specified commands for each device.
"""
def __init__(self, commands_dict, **kwargs):
self.commands_dict = commands_dict