Skip to content

Instantly share code, notes, and snippets.

View KushalP's full-sized avatar

Kushal Pisavadia KushalP

View GitHub Profile
$ sudo docker run -lxc-conf=lxc.aa_profile=unconfined -privileged -v `pwd`:/go/src/github.com/dotcloud/docker docker hack/make.sh test
/proc/self/fd /go/src/github.com/dotcloud/docker
/go/src/github.com/dotcloud/docker
bundles/0.6.3-dev already exists. Removing.
---> Making bundle: test (in bundles/0.6.3-dev/test)
Wed Oct 16 15:31:38 UTC 2013
++ cd .
++ go test -v -ldflags '-X main.GITCOMMIT e1d4f0d -X main.VERSION 0.6.3-dev -d -w'
warning: building out-of-date packages:
[main]
storeconfigs = false
# Submit reports to PuppetDB.
report = true
reports = puppetdb
@KushalP
KushalP / log_example.go
Last active December 25, 2015 13:19
Currently, log output in docker is broken as it parses JSON strings and escapes them. Instead it should be nesting them within the struct that's used and cleanly exposing them as raw JSON. Here's an example that does this.
package main
import (
"encoding/json"
"fmt"
"time"
)
type JSONMessage struct {
Log interface{} `json:"log,omitempty"`
vagrant@precise64:/vagrant$ sudo docker run -lxc-conf=lxc.aa_profile=unconfined -privileged -v `pwd`
:/go/src/github.com/dotcloud/docker docker hack/make.sh test
/proc/self/fd /go/src/github.com/dotcloud/docker
/go/src/github.com/dotcloud/docker
bundles/0.6.3-dev already exists. Removing.
---> Making bundle: test (in bundles/0.6.3-dev/test)
Tue Oct 1 23:38:51 UTC 2013
++ cd .
++ go test -v -ldflags '-X main.GITCOMMIT 18e55ac-dirty -X main.VERSION 0.6.3-dev -d -w'
import json
import sys
def flatten(d, parent_key=''):
"""
Flattens a nested dictionary so that the keys follow the form of 'parent_child'.
"""
items = []
for k, v in d.items():
try:
@KushalP
KushalP / .tmux.reset.conf
Created August 14, 2013 10:13
If someone's added their own tmux config in /etc/tmux.conf this will reset all key bindings to the default for tmux
# First remove *all* keybindings
unbind-key -a
# Now reinsert all the regular tmux keys
bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key \" split-window
whitespace_chars = [
"\\u0009", # CHARACTER TABULATION
"\\u000A", # LINE FEED (LF)
"\\u000B", # LINE TABULATION
"\\u000C", # FORM FEED (FF)
"\\u000D", # CARRIAGE RETURN (CR)
"\\u0020", # SPACE
"\\u0085", # NEXT LINE (NEL)
"\\u00A0", # NO-BREAK SPACE
"\\u1680", # OGHAM SPACE MARK
(under (scores (are (great))))
;; can be written as
(-> great
are
scores
under)
if [ ! -f .ruby-version ]; then
export PATH=`echo $PATH | awk 'BEGIN { RS=":"; ORS=":" } !/rbenv/' | sed 's/:$//'`
fi
ᐅ lein test
lein test com.puppetlabs.puppetdb.examples
lein test com.puppetlabs.puppetdb.examples.report
lein test com.puppetlabs.puppetdb.fixtures
lein test com.puppetlabs.puppetdb.test.archive