Skip to content

Instantly share code, notes, and snippets.

@ScheerMT
ScheerMT / log_decorator.py
Created June 4, 2019 12:40
requires six to be installed to be able to run
from functools import wraps, partial
import logging
import six
# Testing function decorator version
def log_func():
return log_func_internal
def log_func_internal(func):
@wraps(func)
@ScheerMT
ScheerMT / System Design.md
Created April 18, 2016 02:19 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Interview Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ScheerMT
ScheerMT / statsd.py
Last active September 16, 2015 15:50
Implemented the ruby version in python to handle multiple responses in a single packet. Some client implementations of statsd buffer packets together to be sent as one UDP packet. *NOTE*: You may have to change your location of the python executable in the sha-bang. I put the contents of this gist in /usr/bin/lstatsd so it can be run in terminal
#!/usr/local/bin/python
import socket
from termcolor import colored
UDP_IP = "0.0.0.0"
UDP_PORT = 8125
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
@ScheerMT
ScheerMT / statsd.rb
Last active September 15, 2015 17:09 — forked from leehambley/statsd.rb
#!/usr/bin/env ruby
#
# vim: set ft=ruby
#
require 'socket'
require 'term/ansicolor'
include Term::ANSIColor
@ScheerMT
ScheerMT / Tecmint_monitor.sh
Created September 14, 2015 18:36
Monitoring script to give a quick overview of OS, Network, Users logged in, RAM, Swap, disk usage, and CPU utilization. All credits to original author(s)
####################################################################################################
# Tecmint_monitor.sh #
# Written for Tecmint.com for the post www.tecmint.com/linux-server-health-monitoring-script/ #
# If any bug, report us in the link below #
# Free to use/edit/distribute the code below by #
# giving proper credit to Tecmint.com and Author #
# #
####################################################################################################
#! /bin/bash
# unset any variable which system may be using
@ScheerMT
ScheerMT / .jshintrc
Created September 10, 2015 15:33
JSHint configuration as of v2.8.0 - Strict Settings with some exceptions made. Settings marked as depreciated were *not* included in order to futureproof for newer versions.
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for JSHint[1], using JSHint example[2],
// Ory Band's example[3], and haschek's example[4] as basis and setting
// config values to be most strict:
//
// * set all enforcing options to true
<html>
<!-- Stolen From https://github.com/nubleh/nubleh.github.io/blob/master/anim/index.html -->
<!-- Motivation from: https://www.reddit.com/r/gifs/comments/3jw277/wifi_loading_wheel/ -->
<head>
<style type="text/css">
@-webkit-keyframes rotate {
0% {
-webkit-transform: none;
}
100% {
### Keybase proof
I hereby claim:
* I am scheermt on github.
* I am michaelscheer (https://keybase.io/michaelscheer) on keybase.
* I have a public key whose fingerprint is 6CEA 6EF2 495F 9556 ABD2 3FE5 74DF 9DE1 2268 1CE1
To claim this, I am signing this object: