Skip to content

Instantly share code, notes, and snippets.

View slacksec's full-sized avatar

Jason Huang slacksec

View GitHub Profile
@slacksec
slacksec / cheatsheet.py
Created August 27, 2016 10:32 — forked from fuyufjh/cheatsheet.py
My Python Cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)
@slacksec
slacksec / droneci.json
Created September 20, 2016 13:23 — forked from dcoxall/droneci.json
Cloudformation template to deploy drone to AWS using EC2 Container Service
{
"Description": "Drone Continuous Integration (drone.io)",
"Parameters": {
"VPC": {
"Type": "AWS::EC2::VPC::Id",
"Description": "The VPC that needs provisioning"
},
"Subnets": {
"Type": "List<AWS::EC2::Subnet::Id>",
@slacksec
slacksec / pedantically_commented_playbook.yml
Created January 6, 2017 21:29 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@slacksec
slacksec / userdata.sh.erb
Created May 17, 2017 10:12 — forked from jbz/userdata.sh.erb
EC2 userdata.sh script to install Chef and register with Chef server
#!/bin/bash
# User data to configure a vanilla Ubuntu EC2 instance.
# Installs chef-client (with minimal dependencies),
# configures chef, and adds roles
test $UID == 0 || (echo "Error: must run as root"; exit 1)
######### STEP 1: OPERATING SYSTEM CONFIGURATION
BOOTLOG="/var/log/bootstrap.log"
@slacksec
slacksec / Install & Usage
Created June 13, 2017 21:12 — forked from bwhaley/Install & Usage
Download artifacts from Teamcity
# Installation
Download the file
$ wget https://gist.githubusercontent.com/bwhaley/490a1ee890c0f010b1f3/raw/b471e67138be484a0140e5ca420b0ffca7726ed1/artifactory.py
Install the requests library
$ pip install requests
Set TEAMCITY env vars
$ export TEAMCITY_USERNAME=ben
@slacksec
slacksec / ansible-summary.md
Created July 23, 2017 22:49 — forked from AdamOssenford/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@slacksec
slacksec / _aws_golang_examples.md
Created August 20, 2017 22:00 — forked from eferro/_aws_golang_examples.md
golang aws: examples

AWS Golang SDK examples

@slacksec
slacksec / AWS_Single_LetsEncrypt.yaml
Last active September 26, 2017 01:16 — forked from tony-gutierrez/AWS_Single_LetsEncrypt.yaml
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@slacksec
slacksec / nginx.conf
Created October 8, 2017 19:53 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@slacksec
slacksec / clean_sqs.py
Created November 8, 2017 01:57 — forked from alexmojaki/clean_sqs.py
Clean out old SQS queues
"""
This script iterates through all your SQS queues (based on your default
AWS credentials), shows you a few helpful attributes, and asks if you want
to delete it. It's meant as an easy way to clean out old queues that are
no longer needed.
Requires boto3 (pip install boto3).
The names of queues are derived from their URLs which are assumed to have
a common prefix: replace the 12345 in the URL below. If you don't know what