Skip to content

Instantly share code, notes, and snippets.

@Perif
Perif / gist:9d6737ce8cd683371e47d9ba576e8629
Created November 27, 2017 04:02 — forked from nateware/gist:3997958
Cheat sheet to create auto-scaling group behind ELB
  1. Create the appropriate VPC that your application is going to live in. Create subnets for each availability zone you want to use.

  2. Create VPC security group(s) for your auto-scaling instances. For example, if you're going to auto-scale web servers, create a "web" VPC security group.

  3. Go into AWS console and create an ELB. Easy wizard. Select HTTP and (if needed) HTTPS. Make sure it's associated with the VPC you created in step 1.

  4. Create an auto-scaling launch configuration from the CLI. The launch configuration has the AMI, size, and security group from step #2. The security group must be by ID not name ("sg-12345"):

       as-create-launch-config web --image-id ami-2e31bf1e --instance-type m1.medium \
    

-g sg-7619041a --key root

@Perif
Perif / README.md
Created November 27, 2017 01:54 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@Perif
Perif / README.md
Created November 27, 2017 01:54 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@Perif
Perif / README.md
Created November 27, 2017 01:54 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


asciinema rec myfile.json
docker run --rm -v $PWD:/data asciinema/asciicast2gif -s 2 myfile.json myfile.gif
ffmpeg -f gif -i myfile.gif myfile.mp4
@Perif
Perif / read_dirty.py
Created August 15, 2017 15:28
Quick and dirty config reader for check_config on docker compatibility script
# Use it on output : https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh
import re
section = '^([A-Z][a-zA-Z0-9_ ]+)+(?:)'
subsection = '"([^"]*)"'
category = '([A-Z0-9_]+[A-Z]+)'
fname='test.txt'
with open(fname) as f:
@Perif
Perif / overlay.py
Last active August 15, 2017 13:38
Plot images overlay
import pickle as pkl
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
from sklearn import preprocessing
from mpl_toolkits.axes_grid1 import make_axes_locatable
from skimage import filters
discriminate = True
@Perif
Perif / bin_study.py
Last active August 14, 2017 15:11
Bins Analysis with Numpy
import pickle as pkl
import numpy as np
import seaborn as sns
# load data
scores = pkl.load(open('y_scores_20.pkl','rb'))
# create bins
bins = np.linspace(0, 1, 157) # 157 is determined arbitrarily
digitized = np.digitize(scores, bins)
@Perif
Perif / Deserialization.scala
Created October 5, 2015 20:34 — forked from ramn/Deserialization.scala
Object serialization example in Scala
import java.io._
@SerialVersionUID(15L)
class Animal(name: String, age: Int) extends Serializable {
override def toString = s"Animal($name, $age)"
}
case class Person(name: String)
// or fork := true in sbt
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = '[email protected]'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }