Skip to content

Instantly share code, notes, and snippets.

View vovanmix's full-sized avatar

Vladimir Mikhaylovskiy vovanmix

  • San Francisco Bay Area
View GitHub Profile
  1. install cloudflare_module
https://support.cloudflare.com/hc/en-us/articles/203656534-How-do-I-restore-original-visitor-IP-with-Apache-2-4-

mirght need to change sudo yum install httpd-devel libtool git with sudo yum install httpd24-devel libtool git

  1. put the config file to /etc/httpd/conf.d/cloudflare.conf
CloudFlareRemoteIPHeader X-Forwarded-For
@vovanmix
vovanmix / The Technical Interview Cheat Sheet.md
Created April 16, 2016 07:03 — forked from tsiege/The Technical Interview Cheat Sheet.md
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.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.

#SSH Inbound

SSH			TCP			22			0.0.0.0/0

Outbound

All traffic			All			All			0.0.0.0/0
@vovanmix
vovanmix / AWS SSL setup.md
Last active July 5, 2016 21:30
AWS SSL setup
@vovanmix
vovanmix / gist:8ab379f4c62d30966db9e2b8f72d99da
Created June 20, 2016 22:28 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@vovanmix
vovanmix / python snippets.md
Last active July 5, 2016 19:56
python snippets

Style Guide for Python Code - https://www.python.org/dev/peps/pep-0008/

Python style guide checkers - pep8, flake8

Access an item in a dict that is not available. The dict returns a new object using the function you passed as argument to the constructor

#long:
somedict = {}
if somekey not in somedict:
  somedict[somekey] = []
@vovanmix
vovanmix / AWS code deploy.md
Last active July 20, 2016 21:22
AWS code deploy and auto scaling

#Auto Scaling ##1. Have a config (ex. .env) file in a private S3 ##2. Create a reference instance ##3. Install AWS cli app to the server ##4. Create a shell script to download config file ##5. Create an image with all stack software installed, with shell script in place Write bash scripts in the AMI creating interface to automatically bootstrap the instance on create

#Code Deploy configuration ##Create an App

@vovanmix
vovanmix / functors.js
Last active February 27, 2017 05:30
javascript snippets
/**
* Functor takes a value and a function, splits the value, feeds the value to the function and returns the result
* Examples: .map(), .filter()
*/
function F(value, fn){
return fn(value);
}
F(1, plus1); //2
@vovanmix
vovanmix / readme.md
Last active July 11, 2016 18:30
http -> https redirect on AWS using load balancer

We create a separate port listener in web server config, forwart all HTTP connections from load balancer to this port, and configure web server to redirect all connections on this port to https

#add port 1443 listener to EC2 security group

Custom TCP Rule   TCP   1443  <load balancer group id>

#add load balancer rules:

HTTP 80 HTTP 1443 N/A N/A