Skip to content

Instantly share code, notes, and snippets.

Greg Nilchee gnilchee

  • Evernote
  • Woodinville, WA
Block or report user

Report or block gnilchee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@anti1869
anti1869 / parallel-script.py
Created Dec 21, 2015
How To Call Shell Commands From Python In Parallel With Asyncio
View parallel-script.py
#!/usr/bin/env python
"""
Test parallel scripts running with asyncio executors.
Requires at least Python 3.4 to run.
"""
import asyncio
import os
View easy_mac.py
'''
Easy Mac
Copyright (2015) Sean Beck
Licensed under Creative Commons Attribution-ShareAlike 4.0 International
See: https://creativecommons.org/licenses/by-sa/4.0/
Easily change your MAC address on Linux using `ifconfig`
'''
#!/usr/bin/python2.7
@z0mbix
z0mbix / tcpdump-es-capture
Created Dec 19, 2014
Capture Elasticsearch Queries
View tcpdump-es-capture
# tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
14:32:33.525122 IP 127.0.0.1.49777 > 127.0.0.1.9200: Flags [P.], seq 313752908:313753888, ack 2465010394, win 257, options [nop,nop,TS val 2684167067 ecr 2684167066], length 980
E...^.@.@............q#...}L...............
..#...#.GET /index/_search HTTP/1.1
Host: 127.0.0.1:9200
Accept: */*
Content-Length: 845
Content-Type: application/x-www-form-urlencoded
@jeremyj
jeremyj / haproxy rate limiting
Last active Oct 31, 2019
haproxy rate limiting
View haproxy rate limiting
HTTP request limiting ===================================================================================================================
frontend ft_web
# Use General Purpose Couter (gpc) 0 in SC1 as a global abuse counter
# Monitors the number of request sent by an IP over a period of 10 seconds
stick-table type ip size 1m expire 10s store gpc0,http_req_rate(10s)
tcp-request connection track-sc1 src
# refuses a new connection from an abuser
tcp-request content reject if { src_get_gpc0 gt 0 }
View gist:42e4d8b4a9abbffb28c0
#!/bin/bash
# ------------------------------------------------------------------
# Author: Ryan C Koch - ryanckoch@gmail.com
# Purpose: CHECK TCP AND UDP CONNECTIVITY BETWEEN
# SOURCE AND DESTINATION HOSTS
# ------------------------------------------------------------------
SOURCE_FILE="source.hosts"
DESTINATION_FILE="destination.hosts"
LOG_VERBOSE="logs/verbose.log"
@thisismitch
thisismitch / haproxy-www.tf
Last active Mar 6, 2020
How To Use Terraform with DigitalOcean
View haproxy-www.tf
resource "digitalocean_droplet" "haproxy-www" {
image = "ubuntu-14-04-x64"
name = "haproxy-www"
region = "nyc2"
size = "512mb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
connection {
@weapp
weapp / nginx.conf
Created Aug 4, 2014
Return common errors as json in Nginx
View nginx.conf
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
@TSiege
TSiege / The Technical Interview Cheat Sheet.md
Last active May 29, 2020
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@creativepsyco
creativepsyco / gist:9322214
Last active Aug 29, 2015 — forked from vitormoura/gist:9102668
Host Python Server in Current Directory.
View gist:9322214
#Python 2
python -m SimpleHTTPServer 8080
#Python 3
python3 -m http.server 8113
You can’t perform that action at this time.