Skip to content

Instantly share code, notes, and snippets.

View michaelcoyote's full-sized avatar
👀
building and learning

Michael michaelcoyote

👀
building and learning
View GitHub Profile
@michaelcoyote
michaelcoyote / classtest.py
Last active June 17, 2017 09:18
Comparison of plain, static and class methods
#!/usr/bin/env python
"""Comparison of plain, static and class methods.
some tests around staticmethod and classmethod decorators along with methods
for programmatically loading external data using a dict defined in a static
method as a map between the external and internal data.
Also shown is the property decorator, however setters and deleters are
not shown.
@michaelcoyote
michaelcoyote / python_dict_defaults.ipynb
Last active June 19, 2017 21:05
Python dictonary defaults
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
#
# Script to rate limit port 443
#
#network interface on which to limit traffic
IF="bond0"
#limit of the network interface in question
LINKCEIL="10gbit"
#limit outbound https protocol traffic to this rate
@michaelcoyote
michaelcoyote / backup.py
Last active December 20, 2017 19:53
errbot backup
## This file is not executable on its own. use errbot -r FILE to restore your bot.
log.info("Restoring repo_manager.")
bot.repo_manager["installed_repos"] = {'sijis/err-vmware': 'https://github.com/sijis/err-vmware.git', 'errbotio/err-fileshare': 'https://github.com/errbotio/err-fileshare', 'AbigailBuccaneer/err-dailymarx': 'https://github.com/AbigailBuccaneer/err-dailymarx', 'jvasallo/err-plugins': 'https://github.com/jvasallo/err-plugins', 'carriercomm/err-hubot': 'https://github.com/carriercomm/err-hubot', 'keithslater/err-whois': 'https://github.com/keithslater/err-whois', 'jwm/err-gcalendar': 'https://github.com/jwm/err-gcalendar', 'errbotio/err-helloworld': 'https://github.com/errbotio/err-helloworld'}
bot.repo_manager["repo_index"] = {'errbotio/err-killme': {'KillMe': {'repo': 'https://github.com/errbotio/err-killme', 'documentation': 'Kill your bot.', 'python': '2+', 'path': '/killme.plug', 'avatar_url': 'https://avatars.githubusercontent.com/u/15802630?v=3', 'name': 'KillMe'}}, 'errbotio/err-storage
@michaelcoyote
michaelcoyote / PerfTest.py
Created August 15, 2014 17:37
An automated Avamar perf test thing that ended up not being needed and was never finished.
#!/usr/bin/python
#
# Automate the testing for Avamar POC
# script should be able to log activity and useful status.
# TODO
# check error on all subprocess.Popen() and file open() functions
# Error handling: i.e. catch/log errors before dieing
# make sure all the function defs check inputs
#
@michaelcoyote
michaelcoyote / NetWorker_iptables
Created August 28, 2014 00:18
A collection of NetWorker iptables rules for NetWorker
#App,Destination,Source,Service, Port, Port Type
#DPA,dpaserv,managment-net,SSH,22, TCP
#DPA,dpaserv,managment-net,SNMP,161, TCP
#DPA,dpaserv,managment-net,DPA HTTPS 9002 TCP
#DPA,dpaserv,managment-net,DPA HTTPS 9002 TCP
#DPA,dpaserv,managment-net,DPA HTTP, 9003, TCP
#DPA,dpaserv,managment-net,DPA HTTP, 9004, TCP
#DPA,server-agents,dpaserv,DPA Agent - HTTP, 3741, TCP
#
#App,Destination,Source,Service,Dest Port, Src Port Proto
@michaelcoyote
michaelcoyote / mung_bean_soup.md
Last active April 26, 2019 23:23
Mung bean soup

Mung Bean Soup from Eat Clean Live Well / Terry Walters

Quantity Ingredient
1 tablespoon coconut oil
1 onion, chopped.
2 celery stalks, chopped.
2 carrots, chopped.
@michaelcoyote
michaelcoyote / NetWorker_NMM_exchange_troubleshooting.md
Last active June 3, 2019 09:56
Troubleshooting NetWorker Module for Microsoft

NetWorker NMM & Exchange

Basic networker stuff to check.

  • Check that forward and reverse lookup works from each of the Exchange nodes
    • nslookup of networkerservername
    • nslookup of networker-ip-addr
    • ping from client to server

NMM and VSS stuff to check

@michaelcoyote
michaelcoyote / Rust_StructOpt_question.md
Created May 20, 2020 23:44
Rust StructOpt question

StructOpt question

Need to figure out a way to turn mutually exclusive options from StructOpt into someting I can select at runtime. In Python I can do this using argparse and then testing existance on the option something like this:

if args.argument1:
    thing(args.argument1)
else if args.argument2:
    otherthing(args.argument2)