Skip to content

Instantly share code, notes, and snippets.

View jim80net's full-sized avatar

Jim Park jim80net

View GitHub Profile
@jim80net
jim80net / ssltest.py
Last active August 29, 2015 13:58 — forked from sh1n0b1/ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# Based off of https://gist.github.com/sh1n0b1/10100394
import sys
import struct
import socket
import time
@jim80net
jim80net / logmein
Created June 20, 2014 19:36
expect script to login to a normal user account then elevate privileges using su with a known list of root passwords
#!/usr/bin/expect -f
# This script creates an interactive session on a remote server
# Example usage: logmein 192.168.1.11
# Arguments:
# ip_address = IP Address to connect to
# Process CL arguments - password must use lindex because lrange messes with password when special characters are escaped
set target [lindex $argv 0]
@jim80net
jim80net / reset_pass
Created June 24, 2014 17:08
Reset root passwords interactively using su -
#!/usr/bin/expect -f
# This script creates an interactive session on a remote server
# Example usage: logmein 192.168.1.11
# Arguments:
# ip_address = IP Address to connect to
# Process CL arguments - password must use lindex because lrange messes with password when special characters are escaped
set target [lindex $argv 0]
@jim80net
jim80net / cipher_check.sh
Created June 25, 2014 21:54
Test SSL handshake against known handshake methods
#!/usr/bin/env bash
# http://superuser.com/questions/109213/is-there-a-tool-that-can-test-what-ssl-tls-cipher-suites-a-particular-website-of
# OpenSSL requires the port number.
SERVER=$1
DELAY=0
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
@jim80net
jim80net / gist:9c56d99c96f914871ca7
Created April 7, 2015 21:01
escape special chars
printf '%q ' $(cat temp)
@jim80net
jim80net / gist:0095d0c576713dfaf3d9
Created August 9, 2015 18:38
Make yosemite iso
From https://discussions.apple.com/thread/6619535
by tywebb13
If you prefer to make a bootable dvd, you can do it this way:
After downloading the full Yosemite installer app from the Mac App Store, run these 14 commands in Terminal to create a Yosemite.iso file and then burn it to a dual layer DVD with Disk Utility. You may then boot up from it by holding the option key down and then install Yosemite.
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
@jim80net
jim80net / null.yml
Created August 12, 2015 23:36
an empty bosh release
---
name: "null"
director_uuid: 12345
releases: []
networks:
- name: default
type: dynamic
@jim80net
jim80net / aws_who_am_i
Created October 8, 2015 17:31
aws_who_am_i - find out who you are, or what a iam_credential file refers to.
function aws_who_am_i_usage() {
printf "
aws_who_am_i
- with no args: who is the user that the ENV currently refers to (AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_DEFAULT_REGION)
- with 1 arg: provide a filename that can be sourced that has the above environment variables
- with 2 args: aws_who_am_i AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
"
}
function aws_who_am_i() {
@jim80net
jim80net / download_scripts_and_templates.rb
Created December 3, 2015 23:59
Download scripts and templates dir from a git repo. (useful for deploying OSS CF releases)
#!/usr/bin/env ruby
# Usage: ./download_scripts_and_templates <repo> <ref>
# Output: Directory of download
require 'bundler/setup'
require 'logger'
require 'octokit'
require 'base64'
def prereqs
@jim80net
jim80net / app_ctl.sh
Last active January 8, 2016 22:47
BOSH102 app_ctl
#!/bin/bash
JOB_NAME=app
RUN_DIR=/var/vcap/sys/run/$JOB_NAME
LOG_DIR=/var/vcap/sys/log/$JOB_NAME
CONFIG_DIR=/var/vcap/jobs/$JOB_NAME/config
EPHEMERAL=/var/vcap/data/$JOB_NAME
PERSISTENT=/var/vcap/store/$JOB_NAME
PIDFILE=$RUN_DIR/$JOB_NAME.pid
RUNAS=vcap