Skip to content

Instantly share code, notes, and snippets.

View farmerbean's full-sized avatar

Corcoran Smith farmerbean

  • London, England
View GitHub Profile
@vsomayaji
vsomayaji / template.yaml
Created September 14, 2018 18:22
Using a CFN custom resource to generate a random password
Resources:
PasswordGeneratorLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}-PasswordGenerator
RetentionInDays: 1
PasswordGeneratorRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
@benyanke
benyanke / boxstarter.ps1
Created November 30, 2017 22:44 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active April 24, 2024 00:11
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@trestletech
trestletech / instance-types.sh
Created June 15, 2016 16:41
Get all EC2 Instance Types in All Availability Zones
#!/bin/bash
echo "Getting list of Availability Zones"
all_regions=$(aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' | sort)
all_az=()
while read -r region; do
az_per_region=$(aws ec2 describe-availability-zones --region $region --query 'AvailabilityZones[*].[ZoneName]' --output text | sort)
while read -r az; do
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active April 23, 2024 13:04
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@mlapida
mlapida / FlowLogs-to-S3-Lambda.py
Last active April 15, 2021 05:39
A Lambda Function for streaming and translating flow logs on the fly. This example was used for HP ArcSight. A full writeup can be found on my site http://mlapida.com/thoughts/exporting-cloudwatch-logs-to-s3-lambda
import boto3
import logging
import json
import gzip
import urllib
import time
from StringIO import StringIO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
@aalbertson
aalbertson / sns_to_slack.js
Last active December 4, 2017 12:45 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
slack_notify = '<!channel>' // notification control: !channel = @channel, !here = @here, etc...
@vancluever
vancluever / aws-instance-region-az.sh
Last active May 15, 2018 15:35
AWS region/availability zone one-liners (from running instance)
# One can get the availability zone easily from within an AWS EC2 instance:
AVAILABILITY_ZONE=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
echo $AVAILABILITY_ZONE
# Take that a step further, and you can get the region easily by just chopping
# the last character off.
REGION=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/.$//g'`
echo $REGION
@ryanmaclean
ryanmaclean / ubuntu_devops_workstation_setup.md
Last active May 19, 2022 01:19
Ubuntu DevOps Workstation Setup

Ubuntu for DevOps and SRE Work

sudo sed -i '/cdrom/d' /etc/apt/sources.list

I'd certainly recommend moving to keys over passwords, but for now, it'll do...

sudo apt-get install -y openssh-server
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults