Skip to content

Instantly share code, notes, and snippets.

View Gerg's full-sized avatar

Greg Cobb Gerg

View GitHub Profile
@Gerg
Gerg / java_app_sniffer.py
Last active December 14, 2021 21:07
Python 3 script for detecting Cloud Foundry droplets using the java buildpack (for log4j reasons).
#!/usr/bin/env python3
# Usage:
# ./java_app_sniffer.py
#
# Environment Variables (optional):
# PAGE_SIZE - Specifies how many droplets to retrieve per API request (Default: 5000)
# BUILDPACK_NAME - Specifies the name of the java buildpack for targeted environment (Default: java_buildpack)
#
# Note:
#!/usr/bin/env ruby
require 'date'
require 'open3'
class Main
class << self
def resources
%w[
app_usage_events
#!/usr/bin/env ruby
require 'date'
require 'open3'
class Main
class << self
def resources
%w[apps]
end
@Gerg
Gerg / auto_pm.py
Created January 14, 2020 19:49
Automatic PM for VAT
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Instructions
# chmod +x auto_pm.py
# ./auto_pm.py
import json
import random
import base64
#!/usr/bin/env ruby
require 'rspec'
require 'open3'
require 'json'
require 'cgi'
RESOURCE_ENDPOINT = '/v3/routes'
RESOURCE_BODY = {
'host': '<random>',
@Gerg
Gerg / user_array.rb
Last active July 15, 2020 18:39
Acceptance script for CAPI user testing
#!/usr/bin/env ruby
require 'pp'
SCOPE_USERS = {
admin: 'admin',
admin_read_only: 'admin_read_only',
global_auditor: 'global_auditor',
}
### Keybase proof
I hereby claim:
* I am gerg on github.
* I am gcobb (https://keybase.io/gcobb) on keybase.
* I have a public key whose fingerprint is 3AD0 4F45 DF0C 3C20 43E8 D196 50F0 D2CE B363 B6CF
To claim this, I am signing this object:
@Gerg
Gerg / README.md
Last active August 29, 2015 13:56 — forked from sheelc/README.md

Jasmine 2 Phantom Runner

Use to run your Jasmine 2 specs using phantom.js. Useful for running your tests in your console or CI.

Setup:

  1. Download phantom_runner.js and put it in your project
  2. Include the phantom_callback.html snippet in your SpecRunner.html after other Jasmine files are included

To use:

@Gerg
Gerg / README.md
Last active August 29, 2015 13:56

Git Pair Timeout

Simple pre-commit hook to block commits if you haven't paired in the last 9 hours.

Setup

  1. Add the correct path to your .gitconfig file on line 5
  2. Put the script in your repo's .git/hooks/ directory
Acknowledgments

Built at Pivotal Labs

@Gerg
Gerg / README.md
Last active August 29, 2015 13:56
Example Custom Jasmine Matchers

Example Custom Jasmine Matchers

Note: Some matchers require underscore.js and/or jQuery.

General Purpose Matchers

  • toHaveElement
  • toContainText
  • toContainTranslation
  • toHaveLength