A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
1) Create a branch with the tag | |
git branch {tagname}-branch {tagname} | |
git checkout {tagname}-branch | |
2) Include the fix manually if it's just a change .... | |
git add . | |
git ci -m "Fix included" | |
or cherry-pick the commit, whatever is easier | |
git cherry-pick {num_commit} | |
#!/bin/bash | |
# This script cleans up your EC2 instance before baking a new AMI. | |
# Run the following command in a root shell: | |
# | |
# bash <(curl -s https://gist.github.com/justindowning/5921369/raw/ami-clean.sh) | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" | |
} |
{ | |
"Statement": [ | |
{ | |
"Sid": "PackerSecurityGroupAccess", | |
"Action": [ | |
"ec2:CreateSecurityGroup", | |
"ec2:DeleteSecurityGroup", | |
"ec2:DescribeSecurityGroups", | |
"ec2:AuthorizeSecurityGroupIngress", | |
"ec2:RevokeSecurityGroupIngress" |
{ | |
"variables": { | |
"aws_access_key": "", // This helps me connect to AWS | |
"aws_secret_key": "" | |
}, | |
"builders": [{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", | |
"region": "us-east-1", |
# Detect operating system in Makefile. | |
# Author: He Tao | |
# Date: 2015-05-30 | |
OSFLAG := | |
ifeq ($(OS),Windows_NT) | |
OSFLAG += -D WIN32 | |
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) | |
OSFLAG += -D AMD64 | |
endif |
##Using Let's Encrypt certificates with AWS API Gateway
Before starting off with API Gateway set up it's worth mentioning that certificate configuration for this particular service is so far isn't well integrated, therefore different from other AWS services. Despite it using CloudFrount to serve on custom domains it won't let you customize distributions it creates, however all the limitations of CloudFront naturally apply to API Gateway. The most important in this case is the size of the key, which is limited by 2048 bit. Many tutorials provide ready to use terminal commands that have the key size preset at 4096 bit for the sake of better security. This won't work with API Gateway and you'll get an error message about certificate's validity or incorrect chain which won't suggest you the real cause of the issue. Another consideration is that to add a custom domain to API Gateway you have to have a certif
'use strict'; | |
const _ = require('lodash'); | |
const co = require('co'); | |
const AWS = require('aws-sdk'); | |
const lambda = new AWS.Lambda({ apiVersion: '2015-03-31' }); | |
let functions = []; | |
let listFunctions = co.wrap(function* () { |
I have run an nginx container... | |
docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg | |
I want to use Debian for debug: | |
docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin debian | |
I can see the nginx process: |
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |