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
@TSiege
TSiege / The Technical Interview Cheat Sheet.md
Last active Jun 3, 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!






\

@marcelom
marcelom / pysyslog.py
Created Dec 5, 2012
Tiny Python Syslog Server
View pysyslog.py
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@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"}}';
}
@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
@mapbutcher
mapbutcher / EnableWinRm
Created Jul 17, 2013
Enable WinRM with basic auth
View EnableWinRm
set-executionpolicy -executionpolicy remotesigned
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
@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 {
@dctrwatson
dctrwatson / nginx.conf
Last active Mar 1, 2020
Caching PyPi packages locally with nginx
View nginx.conf
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@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
@ghoseb
ghoseb / factorial.py
Created Nov 14, 2008
The evolution of a Python Programmer
View factorial.py
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
You can’t perform that action at this time.