I hereby claim:
- I am percussiverepair on github.
- I am percussiverepair (https://keybase.io/percussiverepair) on keybase.
- I have a public key ASA4kHHLaugQkBSRmBo-nhdnIRjsK2PeRF_0QO4Znql8tgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #! /usr/bin/python | |
| # gets instance events from mulitple accounts/regions and posts to slack | |
| import boto3 | |
| from slackclient import SlackClient | |
| from tabulate import tabulate | |
| token = '<slack token>' | |
| creds = open('<creds location>', 'r') |
| #!/usr/bin/python | |
| #csv upload to gsheet | |
| import logging | |
| import json | |
| import gspread | |
| import time | |
| import re | |
| from oauth2client.client import SignedJwtAssertionCredentials |
| def get_asgs( key = None, secret = None ): | |
| """ get autoscaling groups """ | |
| boto3.setup_default_session( region_name='eu-west-1', aws_access_key_id=key, aws_secret_access_key=secret ) | |
| client = boto3.client('autoscaling') | |
| paginator = client.get_paginator('describe_auto_scaling_groups') | |
| groups = paginator.paginate().build_full_result() | |
| return groups['AutoScalingGroups'] |
| perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config | |
| # ssh autocomplete based on ~/.ssh/config | |
| # I use this in my bashrc to expand hosts defined in ~/.ssh/config: | |
| function _ssh_completion() { | |
| perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config | |
| } | |
| complete -W "$(_ssh_completion)" ssh | |
| # Here's a great article on how to setup your own ~/.ssh/config: | |
| # http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html |
| #build-pipeline-plugin-content { | |
| background-color: none; | |
| border-radius: 0; | |
| } | |
| #build-pipeline-plugin-content h1 { | |
| display: none; | |
| } | |
| tbody.pipelineGroup { |
| #!/usr/bin/env python | |
| ''' | |
| Send memory usage metrics to Amazon CloudWatch | |
| This is intended to run on an Amazon EC2 instance and requires an IAM | |
| role allowing to write CloudWatch metrics. Alternatively, you can create | |
| a boto credentials file and rely on it instead. | |
| Original idea based on https://github.com/colinbjohnson/aws-missing-tools | |
| ''' |
| #Encryption | |
| openssl enc -in important_backups.tar.gz -aes-256-cbc -e > important_backups_encrypted.tar.gz | |
| # Decryption | |
| openssl enc -in important_backups_encrypted.tar.gz -aes-256-cbc -d > important_backups_decrypted.tar.gz |