Skip to content

Instantly share code, notes, and snippets.

View johnmccabe's full-sized avatar
🍕
eat sleep rebase repeat

John McCabe johnmccabe

🍕
eat sleep rebase repeat
View GitHub Profile
@johnmccabe
johnmccabe / gist:f60f900ea05ce2a222dd13cebe028981
Created May 18, 2016 09:46
GeoscalingDNS + external config supplier - deadlock?
"brooklyn-jetty-server-8443-qtp878715618-32" prio=10 tid=0x00007f7ecd87d000 nid=0x7371 waiting on condition [0x00007f7eba19a000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007be966a90> (a java.util.concurrent.FutureTask)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:425)
at java.util.concurrent.FutureTask.get(FutureTask.java:187)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
at org.apache.brooklyn.util.time.Durations.get(Durations.java:43)
@johnmccabe
johnmccabe / cloudstack-sethostname.sh
Created April 25, 2016 18:55 — forked from makuk66/cloudstack-sethostname.sh
dhclient hook for setting the hostname, updating /etc/hosts, and re-generating ssh keys on Ubuntu.Useful for creating CloudStack templates.See https://issues.apache.org/jira/browse/CLOUDSTACK-4556
#!/bin/sh
echo "Running dhclient change hostname script for Ubuntu. reason=${reason}"
timestamp=$(date +%s)
if grep localhost /etc/hostname; then
echo "Current hostname:"
cat /etc/hostname
echo "Attempting to configure hostname"
if [ "x$reason" = "xBOUND" ]; then
hostname=$new_host_name
#!/bin/sh
# Filename: /etc/dhcp/dhclient-exit-hooks.d/sethostname
# Purpose: Used by dhclient-script to set the hostname of the system
# to match the DNS information for the host as provided by
# DHCP.
# logs in /var/log/syslog
#
echo dhclient-exit-hooks.d/sethostname: reason = $reason, interface = $interface
@johnmccabe
johnmccabe / sample_marathon_task.json
Created March 25, 2016 13:20
Triggering the UNMANAGED ON_FIRE
MARATHON_URL=http://xxx.xxx.xxx.xxx:8080
curl -X POST ${MARATHON_URL}/v2/apps -d @sample_marathon_task.json -H "Content-type: application/json"
@johnmccabe
johnmccabe / steps.txt
Created February 17, 2016 11:14
compiling go cli
mkdir ~/tmp_gopath_dir
cd ~/tmp_gopath_dir
export GOPATH=`pwd`
go get -d github.com/brooklyncentral/brooklyn-cli/br
cd $GOPATH/src/github.com/brooklyncentral/brooklyn-cli/br
godep go install
@johnmccabe
johnmccabe / gist_tag.rb
Created January 26, 2016 22:12 — forked from imathis/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers. [Working as of 26/01/2016]
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@johnmccabe
johnmccabe / USAGE.md
Last active January 25, 2016 10:34
Github checkout PR bash function

View Help

git_clone_pr

Checkout PR 1234 from the apache remote to default branch pr1234

git_clone_pr apache 1234
@johnmccabe
johnmccabe / USAGE.md
Last active January 26, 2016 21:37
Bash function(s) to download Youtube videos using Docker

Add the bash functions to your profile, either directly in ~/.bash_profile or preferably by loading the snippets from ~/.bash_profile.d - for example add the following to your .bash_profile:

# Run snippets
for script in ~/.bash_profile.d/*.sh ; do
        if [ -r $script ] ; then
                . $script
        fi
done
@johnmccabe
johnmccabe / test_catalog.bom
Created January 13, 2016 11:45
#212 test
brooklyn.catalog:
version: 0.9.0-SNAPSHOT # BROOKLYN_VERSION
items:
# load everything in the classpath with a @Catalog annotation
- scanJavaAnnotations: true
- id: server
description: |
Provision a server, with customizable provisioning.properties and credentials installed,
@johnmccabe
johnmccabe / cockpit_trusty.md
Last active December 12, 2021 03:56
Cockpit on Ubuntu Trusty 14.05

Installing Cockpit on Trusty

Doesn't really work too well, assumes systemd which isn't present, installation steps are as follows:

sudo add-apt-repository ppa:jpsutton/cockpit
sudo apt-get update
sudo apt-get install cockpit
sudo apt-get install glib-networking
sudo apt-get install pcp
sudo /usr/sbin/remotectl certificate --ensure --user=root