Skip to content

Instantly share code, notes, and snippets.

View jim80net's full-sized avatar

Jim Park jim80net

  • Scribd
  • San Francisco, CA
  • 14:54 (UTC -07:00)
  • X @jim80net
View GitHub Profile
@jim80net
jim80net / bosh-healthmonitor.yml
Created January 27, 2017 20:25
An example manifest for deploying a bosh-healthmonitor instance with bosh_hm_forwarder
---
name: bosh-healthmonitor
director_uuid: REPLACEME
releases:
- name: bosh
version: 257.3+dev.3
- name: loggregator
version: 72
url: https://bosh.io/d/github.com/cloudfoundry/loggregator?v=72
sha1: 33320d62745c80ea0b7320547443883d9cc29362
@jim80net
jim80net / find_apps_for_example_com.sql
Last active November 8, 2016 22:26
up to CF v245: Query CCDB in Cloud Foundry for the app(s) that correspond to a domain
# CF <= v245
USE ccdb;
SELECT
apps.id AS AppID,
apps.name AS AppName,
apps.guid AS AppGUID,
apps.state AS AppState,
routes.id AS RouteID,
routes.host as RouteHost,
routes.path AS RoutePath,
@jim80net
jim80net / bosh-healthmonitor.yml
Created September 14, 2016 23:09
BOSH Healthmonitor deployment manifest
---
name: bosh-healthmonitor
director_uuid: abc123
releases:
- name: bosh
version: '257.3'
networks:
- name: environment-mgmt
subnets:
- range: 10.0.0.0/24
@jim80net
jim80net / datadog-firehose-nozzle.yml
Last active November 15, 2016 21:39
datadog-firehose-nozzle.yml
---
compilation:
cloud_properties:
availability_zone: nova
instance_type: m1.medium
network: datadog-firehose-nozzle-net
reuse_compilation_vms: true
workers: 1
director_uuid: REDACTED
jobs:
@jim80net
jim80net / keybase.md
Last active May 26, 2016 18:40
keybase.md

Keybase proof

I hereby claim:

  • I am jim80net on github.
  • I am jim80net (https://keybase.io/jim80net) on keybase.
  • I have a public key whose fingerprint is 410A 85A6 D549 CE8F EA6C 14F7 964A DB9D A2C7 7CE9

To claim this, I am signing this object:

@jim80net
jim80net / make_fast_storage.sh
Created March 4, 2016 00:06
Create premium storage account in azure for use in BOSH deployment
#!/bin/bash
function USAGE() {
echo "Usage: make_fast_storage.sh <storage_account_name>"
echo "Note: Should be logged into the Azure CLI before running"
echo "STDIN: none expected"
echo "STDOUT: Azure CLI output"
echo "STDERR: Azure CLI errput"
}
AZURE_REGION="southcentralus"
@jim80net
jim80net / gdb-stuck-ruby.txt
Created February 22, 2016 21:56 — forked from benweint/gdb-stuck-ruby.txt
An example of how to gather C and Ruby backtraces from a stuck Ruby process using gdb.
# Here's the script I'll use to demonstrate - it just loops forever:
$ cat test.rb
#!/usr/bin/env ruby
loop do
sleep 1
end
# Now, I'll start the script in the background, and redirect stdout and stderr
@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
@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 / 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() {