Skip to content

Instantly share code, notes, and snippets.

View gm3dmo's full-sized avatar

David Morris gm3dmo

  • GitHub Staff
  • York
  • 23:22 (UTC)
View GitHub Profile
@gm3dmo
gm3dmo / gelfsender.sh
Last active November 16, 2023 04:47
Send a log message to a gelf server using the shell.
# This script can be used to raise a graylog2/gelf message
# gzip it and send it to a graylog server using netcat (nc)
hostname='gelftester'
short_message='test message short version'
full_message='longer test message. dont\n worry be happy'
level=1
facility='gelftester'
# gnu date
date=$(date +'%s.%N')
@gm3dmo
gm3dmo / gist:7770062
Created December 3, 2013 14:30
Very basic shell script to generate a certificate signing request (CSR) for an SSL Certificate.
# usage:
# request_openssl dev|www
host=$1
domain='<somedomain.com>'
cert_csr_file=${host}.cert.csr
key_file=${host}.key.pem
cert_pem_file=${host}.cert.pem
key_length=4096
@gm3dmo
gm3dmo / gist:2b536d7a211225088431
Created November 10, 2014 12:19
Interact with yum in python and see if a list of rpm/packages are installed
#!/bin/env python
import yum
import sys
import platform
print(platform.dist()[0])
#!/bin/env python
import sys
import yum
from rpmUtils.miscutils import *
def get_rpm_name_components(package):
"""
"""
@gm3dmo
gm3dmo / create-date-versioned-snapshot
Created September 22, 2016 13:59
Create a date versioned lvm snapshot
shopt -s -o nounset
purpose=${1:-obfuscator}
lv=/dev/mongoman/mongo
date_of_snap=$(date +%Y%m%d)
timestamp_of_snap=$(date +%s)
size=100M
snapshot_name=mongo_${purpose}_${date_of_snap}_${timestamp_of_snap}_snap
lvcreate --size ${size} --snapshot --name ${snapshot_name} ${lv}
@gm3dmo
gm3dmo / keybase.md
Created September 30, 2016 07:31
keybase.md

Keybase proof

I hereby claim:

  • I am gm3dmo on github.
  • I am gm3dmo (https://keybase.io/gm3dmo) on keybase.
  • I have a public key ASCCuMqgEX_u_ukxnvencnTS5-3ykiPgy0brPN7eQRH06Ao

To claim this, I am signing this object:

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.
@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 ...
@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()
languages:
java:
version:
- major: 1.8
- minor: 74
version:
- major: 1.8
- minor: 74
python:
version: