Skip to content

Instantly share code, notes, and snippets.

View arbabnazar's full-sized avatar
🏠
Working from home

Arbab Nazar arbabnazar

🏠
Working from home
View GitHub Profile
@garnaat
garnaat / gist:4111114
Created November 19, 2012 14:59
Set up simple lifecycle config for a bucket
from boto.s3.lifecycle import Lifecycle, Transition, Rule
import boto
c = boto.connect_s3()
b = c.lookup('mybucket')
t = Transition(days=0, storage_class='GLACIER')
r = Rule('foo rule', 'foo', 'Enabled', 1, t)
l = Lifecycle()
l.append(r)
@wolfeidau
wolfeidau / main.yml
Last active August 29, 2016 12:24
Very simple ansible app setup
---
#
# Setup mysvchere in this environment
#
- name: Add the mysvchere user
user: name=mysvchere comment="My company mysvchere" system=yes shell="/bin/bash"
- name: Install mysvchere certificates
copy: src=server_crt.pem dest=/etc/ssl/certs/{{ mysvchere_hostname }}.crt mode=0644 owner=root group=root
@bbeck
bbeck / setup.sh
Created June 27, 2012 03:53
Setup Asgard on Ubuntu 12.04
#################
# Update packages
#################
DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes update
DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes upgrade
########################
# Install the Oracle JDK
########################
@rdhyee
rdhyee / digitalocean_ansible_minecraft.ipynb
Last active October 22, 2016 17:42
An IPython notebook that I use to create a digitalocean.com droplet to host a minecraft server. I've currently hardcoded a reference to the Ansible Playbook, which I've posted at https://gist.github.com/rdhyee/66f1aa40b6ea520c9e6e. There's code to use the Ansible Python API to play the playbook -- though clearly I can use the command line to do …
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
anonymous
anonymous / elb-health-check.py
Created November 24, 2014 17:42
Determine if the instances in an autoscaling group are InService in its ELBs attached to that group. Used in conjunction with Ansible's ec2_asg module.
#!/usr/bin/env python
"""Determine if the instances in an autoscaling group are InService in its ELBs
attached to that group.
"""
import sys
import boto.ec2.elb
import boto.ec2.autoscale
import argparse
---
- name: Ansible tips
connection: local
hosts: localhost
tasks:
- name: Ping only if OSX
ping:
when: "{{ lookup('pipe', 'uname -s') | match('Darwin') }}"
@carsongee
carsongee / openssl-fix.yml
Last active July 5, 2017 02:23
Heartbeat / Heartbleed SSL Ansible check and correct play for Ubuntu
---
# Patches openssl problem and restarts needed services
- name: Apply common configration to all nodes
hosts: all
sudo: yes
# Uncomment to apply update one server at a time
# serial: 1
tasks:
- name: "Install packages and update cache"
---
# test SSH agent forwarding
- shell: echo "Client= [$SSH_CLIENT] Sock= [$SSH_AUTH_SOCK]"
sudo: no
register: myecho
- debug: msg="{{myecho.stdout}}"
- shell: ssh-add -l
sudo: no
register: myecho
- debug: msg="{{myecho.stdout}}"
@jeckel
jeckel / .dockerignore
Last active September 4, 2018 06:34
Production ready nodejs Dockerfile sample
# Ignore all .files except .babelrc
.*
!.babelrc
# Ignore build directories and dependencies
# everything that will be re-generated by the install/build steps
lib
dist
node_modules
@manicminer
manicminer / info.md
Last active November 1, 2018 22:44
RDS Production termination protection

RDS Production Termination Protection

Create a policy like this, substituting your AWS account number, then attach it to all groups and roles. It will prevent deletion of RDS instances containing the string "prod" in their name.

Note: This is intended to prevent accidental deletion, and is easily sidestepped.