Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am bradleybeddoes on github.
  • I am bradleybeddoes (https://keybase.io/bradleybeddoes) on keybase.
  • I have a public key ASARixgMEJF6IPvIDu4tCAE8KJ6H0GVdBlBWGsf99zCffgo

To claim this, I am signing this object:

View docker.zsh
$ docker run<tab>
-- no matches found --
$ curl -fLo ~/.zprezto/modules/completion/external/src/_docker https://raw.githubusercontent.com/docker/docker/master/contrib/completion/zsh/_docker
$ docker run<tab>
-- images --
0a89c74fff6c -- latest in bradleybeddoes/docker-whale
-- repositories --
bradleybeddoes/docker-whale
View aaf-attribute-filter.xml
<?xml version="1.0" encoding="UTF-8"?>
<afp:AttributeFilterPolicyGroup id="ShibbolethFilterPolicy"
xmlns:afp="urn:mace:shibboleth:2.0:afp"
xmlns:basic="urn:mace:shibboleth:2.0:afp:mf:basic"
xmlns:saml="urn:mace:shibboleth:2.0:afp:mf:saml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:mace:shibboleth:2.0:afp classpath:/schema/shibboleth-2.0-afp.xsd
urn:mace:shibboleth:2.0:afp:mf:basic classpath:/schema/shibboleth-2.0-afp-mf-basic.xsd
urn:mace:shibboleth:2.0:afp:mf:saml classpath:/schema/shibboleth-2.0-afp-mf-saml.xsd">
View 0.readme.txt
Hacked on from original at http://hawkee.com/snippet/9027/
Save np.scpt at ~/Library/Application Scripts/com.codeux.irc.textual/np.scpt
Removed stuff I didn't need and fixed a bug
np.scpt:160:165: script error: Expected “then”, etc. but found identifier. (-2741) Y0
Enjoy.
View 0.bash
$> git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pull/*"
$> cd ~/development/myproj
~/development/myproj [develop] $> git checkout pull/XXXX
Branch pull/XXXX set up to track remote branch pull/XXXX from origin.
Switched to a new branch 'pull/XXXX'
~/development/myproj [pull/XXXX $] $>
View .0.readme.md

Developing on OSX with DNSMasq

Overview

Allows multiple VirtualBox nodes to operate within a local DNS context and supports failover for DNS servers when moving to a network (QUT in my case) that does not support resolution of DNS through the their firewall.

By default Google public DNS servers are utilised for speed, security and sane results.

Another benefit of this approach is that I no longer need to run a bind instance locally which seems to break between major OSX revisions and was more of a pain to configure.

View web.rb
require 'sinatra'
require 'json'
require 'json/jwt'
use Rack::Session::Pool, :expire_after => 3600
get '/' do
erb :index
end
View runMe.java
import java.io.PrintStream;
import java.text.SimpleDateFormat;
public class runMe {
public static void main(String[] args) {
my_printf("Hello %s\n", "Dave");
}
View gist:3662526
groovy> s = new String(request.getAttribute('cn').bytes)
groovy> println s
Иван Петров
View fr-config.groovy
serviceproviders {
shib23 {
displayName = "Shibboleth Service Provider (2.3.x)"
selected = true
entitydescriptor = '$host/shibboleth'
acs {
post {
uri = '$host/Shibboleth.sso/SAML2/POST'
index = 1
}