Skip to content

Instantly share code, notes, and snippets.

View jim80net's full-sized avatar

Jim Park jim80net

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 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 / datadog-firehose-nozzle.yml
Created January 27, 2017 20:33
An example manifest to deploy a datadog firehose nozzle
---
name: datadog-firehose-nozzle
director_uuid: REPLACEME
stemcells:
- alias: bosh-openstack-kvm-ubuntu-trusty-go_agent-raw
os: ubuntu-trusty
version: '3263.15'
instance_groups:
- name: datadog-firehose-nozzle
azs: [nova]
@jim80net
jim80net / datadog.yml.erb
Created January 27, 2017 20:34
A concourse pipeline to push datadog config to various datadog accounts.
---
<%- environments = %W[
staging
prod
gap-cfsandbox-openstack
gap-cfdev-openstack
gap-cfprod-openstack
tracker-aws
] -%>
groups:
@jim80net
jim80net / apps_using_service.rb
Created March 20, 2017 22:28
A script to return a list of apps that use a CF service
#!/usr/bin/env ruby
require 'json'
require 'pry'
def cf_curl(resource, parameter='')
response = JSON.parse `cf curl /v2/#{resource}?#{parameter}`
raise "pagination" if response["total_pages"] && response["total_pages"] > 1
return response
end