Skip to content

Instantly share code, notes, and snippets.

@xxxVxxx
xxxVxxx / ec2-metadata
Created March 4, 2022 02:36 — forked from yaronf/ec2-metadata
ec2-metadata: a simple tool for exploring Amazon EC2 metadata, extended with network and VPC info
#!/bin/bash
#
#########################################################################
#This software code is made available "AS IS" without warranties of any #
#kind. You may copy, display, modify and redistribute the software #
#code either by itself or as incorporated into your code; provided that #
#you do not remove any proprietary notices. Your use of this software #
#code is at your own risk and you waive any claim against Amazon #
#Digital Services, Inc. or its affiliates with respect to your use of #
#this software code. (c) 2006-2007 Amazon Digital Services, Inc. or its #
@xxxVxxx
xxxVxxx / aws_delete-default-vpc.sh
Created February 14, 2022 03:08 — forked from jokeru/aws_delete-default-vpc.sh
Script to delete all AWS default VPCs from all regions using AWS CLI
#!/usr/bin/env bash
if [ "$AWS_PROFILE" = "" ]; then
  echo "No AWS_PROFILE set"
  exit 1
fi
for region in $(aws ec2 describe-regions --region eu-west-1 | jq -r .Regions[].RegionName); do
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@xxxVxxx
xxxVxxx / fix_github_https_repo.sh
Created June 17, 2016 08:06 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@xxxVxxx
xxxVxxx / bootstrap_emr.tf
Created May 3, 2016 15:29 — forked from tsailiming/bootstrap_emr.tf
A terraform script to bootstrap EMR.
// EMR is not supported by terraform yet
// https://github.com/hashicorp/terraform/issues/2098
// This script will bootstrap the necessary VPC and related configs first.
provider "aws" {
#access_key = "ACCESS_KEY_HERE"
#secret_key = "SECRET_KEY_HERE"
region = "ap-southeast-1"
}
// get old
s3cmd get s3://elasticmapreduce/samples/spark/0.8.1/spark-0.8.1-emr.tgz
tar -xvf spark-0.8.1-emr.tgz
// get newer
curl "http://d3kbcqa49mib13.cloudfront.net/spark-1.0.0-bin-hadoop1.tgz" -o "spark-1.0.0-bin-hadoop1.tgz" # Grab the latest version of the prebuilt Spark jars. We grabbed Spark 1.0.0 with Hadoop 1 , spark-1.0.0-bin-hadoop1.tgz, from the Spark Downloads page
tar -xvf spark-1.0.0-bin-hadoop1.tgz
// old metrics properties files
@xxxVxxx
xxxVxxx / aws_usage.py
Created February 5, 2016 12:25 — forked from Bouke/aws_usage.py
Catch login failures / captcha input
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@xxxVxxx
xxxVxxx / How to download streaming video
Created February 5, 2016 12:19 — forked from danfinlay/How to download streaming video.md
How to download a streaming video with Google Chrome
#How to download streaming video
Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.
##Open Developer Tools
From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:
1. (On a mac): Command-option-J
2. (On a PC): Control-alt-J
@xxxVxxx
xxxVxxx / README.md
Created February 4, 2016 16:02 — forked from jewzaam/README.md

##Yet another gist to provide Graphite support for Dashing Pull data from Graphite and present in Dashing. Support both graph and number widget.

Quick install:

dashing install 5088efcc94de2fecad5e

Set the graphite host/port and names of metrics in jobs/graphite.rb