Skip to content

Instantly share code, notes, and snippets.

View kevinlondon's full-sized avatar

Kevin London kevinlondon

View GitHub Profile
@kevinlondon
kevinlondon / surfingkeys.config
Last active July 5, 2017 17:30
Surfingkeys configuration. Think dotfiles for the browser
// an example to create a new mapping `ctrl-y`
mapkey('<Ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `u` with `?`, click `Default mappings` to see how `u` works.
map('?', 'u');
// an example to remove mapkey `Ctrl-i`
unmap('<Ctrl-i>');
import os
import subprocess
import jsonpickle
# Exploit that we want the target to unpickle
class Exploit(object):
def __reduce__(self):
# Note: this will only list files in your directory.
# It is a proof of concept.
@kevinlondon
kevinlondon / chownow_infra_coding_challenge.md
Last active January 18, 2017 01:20 — forked from maxgutman/adsnative_devops_coding_challenge.md
ChowNow: Infrastructure Engineer Coding Challenge

ChowNow: Infrastructure Engineer Coding Challenge

Get the Flask 'Hello World' app up and running on a Vagrant VM using your known best practices as well as the instructions in the guidelines below. You must use Ansible as your provisioner to install and configure everything. When you're done, we should be able to type vagrant up and our app will be running and reachable on http port 80 at http://192.168.33.15.

Guidelines:

  • The provisioner should clone a Github-hosted repo into the VM under /etc/chownow/infratest
  • The app should route through nginx and gunicorn or uWSGI.
  • The app should be running as a non-privileged user
  • The app should be automatically restarted if crashes or is killed
  • The app should maximize all of the available CPUs (have Vagrant virtualize multiple CPUs and use them)
@kevinlondon
kevinlondon / ansible.cfg
Created April 29, 2016 14:54
Ansible config
[defaults]
inventory = hosts
remote_user = ubuntu
private_key_file = '~/.ssh/id_rsa'
[ssh_connection]
pipelining = True
@kevinlondon
kevinlondon / output.tf
Created April 27, 2016 21:06
Terraform Output file
output "ip" {
value = "${aws_instance.hello_world.public_ip}"
}
aws_access_key = "<yourkey>"
aws_secret_key = "<yourkey>"
@kevinlondon
kevinlondon / variables.tf
Created April 26, 2016 19:57
Terraform variables for DevOps from Scratch
# These variables come from the terraform.tfvars file
variable "aws_access_key" {}
variable "aws_secret_key" {}
variable "aws_region" {
description = "AWS region in which to launch the servers."
default = "us-east-1"
}
variable "public_key_path" {
@kevinlondon
kevinlondon / main.tf
Created April 26, 2016 19:51
DevOps from Scratch tutorial Terraform file
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
}
resource "aws_instance" "hello_world" {
ami = "ami-fce3c696" # Ubuntu 14.04 for us-east-1
instance_type = "t2.micro"
vpc_security_group_ids = ["${aws_security_group.web.id}"]
description "hello-world"
start on (filesystem)
stop on runlevel [016]
respawn
setuid nobody
setgid nogroup
chdir {{ repository_path }}
server {
listen 80;
location / {
include proxy_params;
proxy_pass http://unix:/tmp/hello_world.sock;
}
}