Skip to content

Instantly share code, notes, and snippets.

View gm3dmo's full-sized avatar

David Morris gm3dmo

  • GitHub Staff
  • York
  • 06:36 (UTC +01:00)
View GitHub Profile
# I had this working on CentOS 7 haproxy 1.5 (haproxy-1.5.18-6.el7.x86_64)
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
import os
import sys
import csv
import pandas as pd
def main():
f = sys.argv[1]
df = pd.read_csv(f)
import sys
import csv
import json
import pprint
import time
import random
import string
import socket
import subprocess
'dmos-MacBook-Pro.local' 1513171640.174752 1513171652.03749 'upload2S3' 11.86
'dmos-MacBook-Pro.local' 1513171652.037659 1513171655.677226 'upload2S3encrypted' 3.64
'dmos-MacBook-Pro.local' 1513171655.677367 1513171660.954814 'downloadFromS3' 5.28
'dmos-MacBook-Pro.local' 1513171660.9549499 1513171667.74031 'downloadFromS3Encrypted' 6.79
'dmos-MacBook-Pro.local' 1513171667.740461 1513171671.101078 'upload2S3' 3.36
'dmos-MacBook-Pro.local' 1513171671.101224 1513171674.624882 'upload2S3encrypted' 3.52
'dmos-MacBook-Pro.local' 1513171674.625083 1513171681.1310039 'downloadFromS3' 6.51
'dmos-MacBook-Pro.local' 1513171681.131139 1513171687.3683252 'downloadFromS3Encrypted' 6.24
'dmos-MacBook-Pro.local' 1513171687.3685079 1513171690.7645981 'upload2S3' 3.40
'dmos-MacBook-Pro.local' 1513171690.7647538 1513171694.514485 'upload2S3encrypted' 3.75
@gm3dmo
gm3dmo / s3-bucket-list.py
Created December 8, 2017 10:07
Lists objects in an S3 bucket
#!/usr/local/aws/bin/python
import botocore.session
# wanted_profile should be set to the profile for the key you want to use
# normally found in ~/.aws/credentials
wanted_profile = 's3monster'
wanted_bucket = 's3monsters'
session1 = botocore.session.Session(profile=wanted_profile)
@gm3dmo
gm3dmo / prowler-s3
Created December 6, 2017 10:08
Prowler S3 Experiments
Get prowler installed in a virtual env. preferably pip env (don't do pip install prowler) prowler comes from github not pypi then one on pypi is not the amazon auditor.
languages:
java:
version:
- major: 1.8
- minor: 74
version:
- major: 1.8
- minor: 74
python:
version:
@gm3dmo
gm3dmo / r-studio-amazon.md
Last active November 28, 2017 06:11
R Studio Amazon S3

R Studio

Problems

Fetching file in R from AWS S3 fails with: Error in parse_aws_s3_response

Get a csv file from s3:

aws.signature::use_credentials(profile = "rstudio")
library("aws.s3")
bucketlist()
@gm3dmo
gm3dmo / Things-i-learned-hackathon
Last active July 23, 2017 21:51
Things I learned at a homeless hack hackathon
# Homeless Hack
My experience: I've never attended a hackathon before so didn't know what to expect. I liked the way a lot of time was spent introducing us to the subject matter. In our case it was homelessnes.
## Tweets
```
#whatilearned #homelesshack 11 you are designing and building something with 8-10 people who never met before. Try to get everyone involved.
#whatilearned #homelesshack 10 the people doing the coding parts are under extreme pressure. Cherish them. Get them a quiet space/area.
#whatilearned #homelesshack 9 a great space to work in like @infinityworks so kindly lent us must be a real multiplier of orgs effectiveness.
#whatilearned #homelesshack 8 the systems you want to get information from are mostly offline. Integrations are hard.
#whatilearned #homelesshack 7 someone will have an awesome idea that is so simple it's got to be what you build around ...
Amazon - A Duffer's Guide
SES: Sending E-Mail Outbound
A support ticket is needed to get out of the SES sandbox. Use this link to complete that process:
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html
SES: Set up a catch-all
Create a catch all rule that captures mail to your domain to an S3 bucket.