Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
credhub_pid=$(cat /var/vcap/sys/run/credhub/pid)
uaa_pid=$(cat /var/vcap/data/sys/run/uaa/uaa.pid)
lsof_output="$(lsof)"
total_open_files=$(echo "$lsof_output" | wc -l)
@mdelillo
mdelillo / login-fly.sh
Created June 4, 2018 21:13
Use your browser to automatically log in to fly
login-fly ()
{
expect <(cat <<EOF
spawn fly -t credhub login
expect "1: GitHub"
send -- "1\r"
expect -re "https://.*fly_local_port=\[0-9\]*"
set url [ string map { "\&" "\\\&" } \$expect_out(0,string) ]
system open \$url
@mdelillo
mdelillo / element-not-found-repro.go
Created December 19, 2017 15:55
Reproduction of "Element not found" error when hot attaching HCS endpoint to container
package main
import (
"crypto/rand"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"math"
"math/big"
# winrm quickconfig -q
cmd.exe /c 'winrm quickconfig -q'
"winrm quickconfig -q (Exit Code: ${LASTEXITCODE})"
# winrm quickconfig -transport:http
cmd.exe /c 'winrm quickconfig -transport:http'
"winrm quickconfig -transport:http (Exit Code: ${LASTEXITCODE})"
# Win RM AllowUnencrypted
cmd.exe /c 'winrm set winrm/config/service @{AllowUnencrypted="true"}'
@mdelillo
mdelillo / index.html
Last active April 20, 2016 14:00
PCF Dev CI
<html>
<head>
<style>
body {
border: none;
margin: 0px;
padding: 0px;
overflow: hidden;
}
iframe {
@mdelillo
mdelillo / prevent_default_spec.js
Last active June 22, 2016 21:54
Testing preventDefault in react
var preventDefaultHandler = jasmine.createSpy('defaultPreventedHandler');
React.addons.TestUtils.Simulate.click(
link,
{ preventDefault: function() { preventDefaultHandler.call(); }}
);
expect(preventDefaultHandler).toHaveBeenCalled();