Skip to content

Instantly share code, notes, and snippets.

View lapthorn's full-sized avatar

Alan Lapthorn lapthorn

View GitHub Profile
@philandstuff
philandstuff / devopsdays.org
Last active October 12, 2017 21:05
Devopsdays london 2017

Devopsdays London 2017

initial session, bob walker (@rjw1)

  • welcome everyone!
  • we have a code of conduct
  • thanks to organisers, sponsors, etc

Humane Teams at home and around the world

@radeksimko
radeksimko / how-to.md
Last active June 22, 2022 11:44
VPC endpoint Terraform example setup

How to

ssh ec2-user@IP
aws configure set region us-west-2
aws s3 ls # listing s3 buckets over VPC endpoint privately
# to get a list of DS instances
aws ec2 describe-instances --output text | grep Name |grep ds | awk '{print $NF}'
# aws ec2 describe-instances --filters 'Name=tag:Name,Values=*.ds'
# aws ec2 describe-instances --filters 'Name=tag:Cluster,Values=dsclusterprod1' --output text | grep -w Name
aws ec2 describe-instances --filters 'Name=tag:Cluster,Values=dsclusterprod1' --output text | grep -w Name | awk '{print $NF}' > ds.instances
aws ec2 describe-instances --filters 'Name=tag:Cluster,Values=dsclusterstg1' --output text | grep -w Name | awk '{print $NF}' >> ds.instances
## to get instanceid of instances:
for instance in `cat ds.instances`;
@kixorz
kixorz / aws_autoscaling_cron.rb
Created March 20, 2013 22:41
Running cron jobs in AWS Auto Scaling group is tricky. When you deploy the same code and configuration to all instances in the group, cron job would run on all of them. You may not want that. This script detects the first instance in the group and allows only this instance to run the job. IAM user used by this script needs to have permissions to…
#!/usr/bin/env ruby
require 'syslog'
require 'net/http'
require 'aws-sdk'
Syslog.open
AWS.config({
:access_key_id => '<iam user key>',
:secret_access_key => '<iam user secret>'