Skip to content

Instantly share code, notes, and snippets.

View spanthetree's full-sized avatar

David Woodruff spanthetree

View GitHub Profile
@spanthetree
spanthetree / parse_paystub.py
Created April 19, 2020 13:22
parse paystubs and optionally convert tax/gross pay to another currency
#! /usr/bin/env python3
import os
import argparse
import json
from exchangeratesapi import Api
def convert_pay(src_list):
date = ''
target_list = []
@spanthetree
spanthetree / stat_calc.py
Created March 15, 2017 18:25
**WIP** ESO Max stat calculator
#! /usr/bin/env python
# reference: https://www.reddit.com/r/elderscrollsonline/comments/3ov0n4/formulas_for_max_statsweaponspell_damage_etc/
# [ (7958 base Magicka + (Attribute Points x 111) + GearBonus) x
# (1 + 0.01 x (Champion Pts in Mage)^0.56) + MageMundus x (1 + .075 x DivinesTraits) + Food ] x
# (1 + SumofPassives)
import argparse
@spanthetree
spanthetree / get_info.py
Created October 18, 2016 22:49
Get table info from a Junos device (pyez test example)
#!/usr/bin/env python
import os, sys, argparse, pprint, getpass, re, yaml
from threading import Thread
# Import junos eznc factory loader - for generating new tables/views
from jnpr.junos.factory.factory_loader import FactoryLoader
# Import junos sample tables:
# https://www.juniper.net/techpubs/en_US/junos-pyez1.0/topics/concept/junos-pyez-tables-and-views-overview.html
from jnpr.junos.op.arp import ArpTable
from jnpr.junos.op.fpc import FpcHwTable, FpcInfoTable
#!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2015 David Woodruff, Michael-Keith Bernard
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@spanthetree
spanthetree / check_juniper.sh
Last active March 11, 2019 21:05
Nagios plugin to check Juniper devices
#!/bin/bash
##
# Bash script to check the status of a SRX cluster via Nagios.
# You can use -h to see the help file. This works by connecting via ssh to a junos device and running a specific command,
# defined in the options
#
# Inspiration for this script came from: http://www.scottyob.com/2012/07/09/monitoring-srx-chassis-cluster/
##
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"/media/github_backup/bash_backup"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"YOUR_ORG"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"YOUR_USERNAME"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"YOUR_PASSWORD"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted