Skip to content

Instantly share code, notes, and snippets.

View pgporada's full-sized avatar
πŸ•΅οΈβ€β™‚οΈ
PKEye

Phil Porada pgporada

πŸ•΅οΈβ€β™‚οΈ
PKEye
View GitHub Profile
/*
other configs go here
*/
resource "aws_security_group" "elb" {
name = "${var.env}-${var.tier}-elasticsearch-elb-sg"
vpc_id = "${var.vpc_id}"
description = "Allow http and https inbound traffic through the ELB."
tags {
---
- name: Give 50% of all memory to the JVM
set_fact:
elasticsearch_java_initial_heap_size: "{{ (2|pow(((ansible_memtotal_mb|log(2))|round|int)) * 0.50)|int }}m"
elasticsearch_java_maximum_heap_size: "{{ (2|pow(((ansible_memtotal_mb|log(2))|round|int)) * 0.50)|int }}m"
...
@pgporada
pgporada / gist:817a1258a8ea60cc9750b6ae4edf20ff
Created March 3, 2017 18:28
Using rkt to run containers
$ sudo rkt --insecure-options=image run docker://redis
stage1: warning: no volume specified for mount point "volume-data", implicitly creating an "empty" volume. This volume will be removed when the pod is garbage-collected.
stage1: Docker converted image, initializing implicit volume with data contained at the mount point "volume-data".
stage1: warning: no volume specified for mount point "volume-data", implicitly creating an "empty" volume. This volume will be removed when the pod is garbage-collected.
stage1: Docker converted image, initializing implicit volume with data contained at the mount point "volume-data".
[20030.471072] redis[5]: 5:C 03 Mar 18:14:10.858 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
[20030.471791] redis[5]: 5:M 03 Mar 18:14:10.859 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
[20030.472056] redis[5]: 5:M 03 Mar 18:14:10.859 # Server can't set maximum open fil
---
- hosts: localhost
connection: local
tasks:
- name: Install some pip modules
pip:
name: "{{ item }}"
with_items:
- python-consul
- docker-py
# /var/log/consul/consul.log
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
Version: 'v0.7.5'
Node ID: '788e2702-f4df-425d-bbad-8e282351f4d5'
Node name: 'ip-172-21-8-118'
Datacenter: 'beta'
Server: false (bootstrap: false)
Client Addr: 0.0.0.0 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400)
@pgporada
pgporada / gist:0110b3a5c56d0a140db3a61420371322
Created March 12, 2017 01:48
Terraform AWS provider example
variable "region" {}
variable "allowed_account_ids" {}
terraform {
required_version = ">= 0.8.8"
}
provider "aws" {
region = "${var.region}"
profile = "default"
---
- hosts myinventory
remote_user: dudeguy
gather_facts: true
roles:
- {role: ansible-role-repo-epel, tags: ["epel","repo"]}
- {role: ansible-role-httpd, tags: ["httpd"]}
- {role: ansible-role-jenkins, tags: ["jenkins"]}
- {role: ansible-role-jenkins-backups, tags: ["jenkins","backups"]}
@pgporada
pgporada / part_of_main.tf
Last active March 20, 2017 21:36
Phil's terraform-vpc
.
β”œβ”€β”€ bumpver.sh*
β”œβ”€β”€ environments/
β”‚Β Β  β”œβ”€β”€ mgmt/
β”‚Β Β  β”‚Β Β  └── mgmt.tfvars
β”‚Β Β  └── prod/
β”‚Β Β  └── prod.tfvars
β”œβ”€β”€ main.tf
β”œβ”€β”€ Makefile
β”œβ”€β”€ modules/
@pgporada
pgporada / gist:7369684744cb2f077dba541362c7723d
Last active March 23, 2017 03:29
everything and the kitchen sink
phil at laptappy in ~
$ kitchen sink
___
' _ '.
/ /` `\ \
| | [__]
| | {{
| | }}
_ | | _ {{

Keybase proof

I hereby claim:

  • I am pgporada on github.
  • I am pgporada (https://keybase.io/pgporada) on keybase.
  • I have a public key whose fingerprint is E4FE F2E5 C527 B320 695F AA0D 607D 013E EEA3 E2C0

To claim this, I am signing this object: