Skip to content

Instantly share code, notes, and snippets.

View gm3dmo's full-sized avatar

David Morris gm3dmo

  • GitHub Staff
  • York
  • 18:44 (UTC +01:00)
View GitHub Profile
@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:

@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}
#!/bin/env python
import sys
import yum
from rpmUtils.miscutils import *
def get_rpm_name_components(package):
"""
"""
@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])
@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 / 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')