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
@vovanmix
vovanmix / purchase.svg
Created September 9, 2016 16:09
purchase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vovanmix
vovanmix / programs.svg
Created September 9, 2016 16:08
programs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
@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 / 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 / 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 / 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 / AWS SSL setup.md
Last active July 5, 2016 21:30
AWS SSL setup

#SSH Inbound

SSH			TCP			22			0.0.0.0/0

Outbound

All traffic			All			All			0.0.0.0/0