Skip to content

Instantly share code, notes, and snippets.

View mr-brody's full-sized avatar

Mr. Brody mr-brody

View GitHub Profile
@mr-brody
mr-brody / multiple_ssh_setting.md
Created June 14, 2020 06:36 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@mr-brody
mr-brody / README.md
Created June 3, 2018 05:09 — forked from hofmannsven/README.md
My simply Git Cheatsheet
{
"AWSTemplateFormatVersion":"2010-09-09",
"Description":"This Template creates an Amazon Cloudwatch Alert for Trusted Advisor open ports, protocols, IAM credentials not rotated in 90 days and must be created in us-east-1.",
"Parameters":{
"EmailAddress": {
"Description": "Email Address for sending SNS notifications for TrustedAdvisor",
"Type": "String"
}
},
"Resources":{
import boto3
client = boto3.client('ec2', aws_access_key_id=access_key, aws_secret_access_key=secret_key,
region_name='us-east-1')
ec2_regions = [region['RegionName'] for region in client.describe_regions()['Regions']]
go-audit repo:
https://github.com/slackhq/go-audit
go-audit example configurations:
https://github.com/slackhq/go-audit/tree/master/examples
Blog post: Ryan Huber - Distributed Security Alerting
https://medium.com/several-people-are-coding
Video: NSA TAO Chief on Disrupting Nation State Hackers
@mr-brody
mr-brody / slack_webhook_post.py
Created March 15, 2018 05:37 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@mr-brody
mr-brody / s3signurl.py
Created December 9, 2017 21:26 — forked from obeattie/s3signurl.py
Quick, dirty Python script that spits out a signed url for Amazon S3
#!/usr/bin/env python
import optparse
import sys
from boto.s3.connection import S3Connection
def sign(bucket, path, access_key, secret_key, https, expiry):
c = S3Connection(access_key, secret_key)
return c.generate_url(
expires_in=long(expiry),
@mr-brody
mr-brody / S3_as_Yum_repo.md
Created December 2, 2017 16:03 — forked from phrawzty/S3_as_Yum_repo.md
Use S3 as a Yum repo

S3 as Yum repo

There are two parts to this:

  • Managing access to non-public S3 resources.
  • Building RPM repositories in an automated, deterministic way that Yum can use.

Environment

In general, a CentOS 7 x86_64 box in AWS EC2; in specific, this Packer profile.

@mr-brody
mr-brody / add_cloudflare_ips.sh
Created November 29, 2017 06:25 — forked from dduvnjak/add_cloudflare_ips.sh
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# iterate over the lines in the downloaded file
# make sure to set `--group-id` and `--port`; more details at http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html
while read p; do aws ec2 authorize-security-group-ingress --group-id sg-e0000000 --protocol tcp --port 80 --cidr $p; done< ips-v4