Skip to content

Instantly share code, notes, and snippets.

View predominant's full-sized avatar
🦄

Graham Weldon predominant

🦄
View GitHub Profile
@predominant
predominant / .git-autocomplete
Created January 31, 2013 07:41
Git Autocompletion
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# Description:
# Log all the things to ElasticSearch then lets you ask hubot what you missed
#
# Dependencies:
# None
#
# Configuration:
# ELASTICSEARCH_HOSTNAME - E.G. elasticsearch.example.com:9200, where to send the put requests
# ELASTICSEARCH_USERNAME - OPTIONAL basic auth username
# ELASTICSEARCH_PASSWORD - OPTIONAL basic auth password
@predominant
predominant / gist:4967413
Created February 16, 2013 15:42
BASH Command Prompt with Visual output
export PS1='$( RET=$?; if [ $RET == 0 ]; then echo "😃 "; else echo "😡 "; fi )\n\h:\W \u\$ '
#!/bin/bash
INTERFACE="en0"
MACCMD="ifconfig $INTERFACE ether"
MACREAL="aa:aa:aa:aa:aa:aa"
MACFAKE="bb:bb:bb:bb:bb:bb"
function usage {
echo "Usage:"
echo " mac fake"
search("users", "*:*").each do |user_data|
user user_data['id'] do
comment user_data['comment']
uid user_data['uid']
gid user_data['gid']
home user_data['home']
shell user_data['shell']
end
end
@predominant
predominant / drone.log
Created August 17, 2015 05:49
Drone error when deleting repo
2015/08/17 01:55:16 http: panic serving 10.68.10.81:64815: runtime error: invalid memory address or nil pointer dereference
goroutine 26 [running]:
net/http.func·011()
/usr/local/go/src/pkg/net/http/server.go:1100 +0xb7
runtime.panic(0xb3b7a0, 0x11ae913)
/usr/local/go/src/pkg/runtime/panic.c:248 +0x18d
github.com/drone/drone/plugin/remote/github.DeleteKey(0xc2080457c0, 0xc20816cb78, 0x4, 0xc20816cb90, 0x7, 0xc208172460, 0x1b, 0xc2080aa780, 0x17d, 0x0, ...)
/var/cache/drone/src/github.com/drone/drone/plugin/remote/github/helper.go:250 +0xfe
github.com/drone/drone/plugin/remote/github.(*GitHub).Deactivate(0xc2080265b0, 0xc208042c60, 0xc208056e00, 0xc208160310, 0x64, 0x0, 0x0)
/var/cache/drone/src/github.com/drone/drone/plugin/remote/github/github.go:207 +0x164
protected void PlaneSplit1() {
Mesh mesh = this.GetMesh();
Vector3[] vertices = mesh.vertices;
for (int pass = 0; pass < this.Passes; pass++) {
// Pick a random point in the Sphere
Vector3 splitVector = Random.insideUnitSphere;
for (int i = 0; i < mesh.vertices.Length; i++) {
// Get the DOT product of that random point
make deps gen
go get -u golang.org/x/tools/cmd/cover
go get -u golang.org/x/tools/cmd/vet
go get -u github.com/kr/vexp
go get -u github.com/eknkc/amber/...
go get -u github.com/eknkc/amber
go get -u github.com/jteeuwen/go-bindata/...
go get -u github.com/elazarl/go-bindata-assetfs/...
go get -u github.com/dchest/jsmin
go get -u github.com/franela/goblin
@predominant
predominant / gist:c38add95a33f8fc7cf3b
Created January 9, 2016 05:49
Chef-Server cookbook fail
😄 ~ cd chef-repo/cookbooks/r-chef-server/
😄 r-chef-server git:(feature/os-updates) ✗ kitchen list
Instance Driver Provisioner Verifier Transport Last Action
default-ubuntu-1404 Vagrant ChefZero Busser Ssh <Not Created>
default-ubuntu-1204 Vagrant ChefZero Busser Ssh <Not Created>
default-centos-71 Vagrant ChefZero Busser Ssh <Not Created>
default-centos-67 Vagrant ChefZero Busser Ssh <Not Created>
{
"type": "chef-solo",
"skip_install": true,
"prevent_sudo": false,
"execute_command": "echo 'vagrant' | {{ if .Sudo }}sudo -H -S -E{{ end }} chef-solo --no-color -c '{{ .ConfigPath }}' -j '{{ .JsonPath }}'",
"override": {
"generic-vmware": {
"execute_command": "echo 'ubuntu' | {{ if .Sudo }}sudo -H -S -E{{ end }} chef-solo --no-color -c '{{ .ConfigPath }}' -j '{{ .JsonPath }}'"
}
},