A quick ruby command line to pretty-print piped json.
Put this somewhere in your path, with chmod +x
, then:
curl http://myapp.com/stuff.json | json
# "Install" (I use that term loosely) | |
# | |
# - Paste the function below in your .bashrc / .profile / .zshrc / etc. | |
# | |
# Usage: find /usr/local -type [m|g] -name [KEYWORD] | |
# | |
# -type m : google maps search | |
# -type g : google search | |
# | |
# all other types pass through to find |
#!/usr/bin/env bash | |
set -x | |
cd /tmp | |
rm -rf node | |
set -ue | |
git clone git://github.com/joyent/node.git | |
cd node |
#!/usr/bin/env bash | |
# | |
# Example usage: | |
# | |
# $ VERSION=1.3 sudo ./goinst.sh | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
A quick ruby command line to pretty-print piped json.
Put this somewhere in your path, with chmod +x
, then:
curl http://myapp.com/stuff.json | json
#!/usr/bin/env roundup | |
describe "redis-cli(1)" | |
# Start the redis server on port 9999 | |
port=9999 | |
printf "PORT $port\n" | ./redis-server - & | |
redis_pid=$! | |
# Give redis time to start listening |
type JSONContainer struct { | |
data []interface{} | |
} | |
func (j *JSONContainer) All() (objects []JSONObject) { | |
for _, v := range j.data { | |
objects = append(objects, JSONObject{data: v}) | |
} | |
return | |
} |
#!/usr/bin/env bash | |
# Simple script to start and seed a local splunk instances using Docker | |
# Usage: | |
# $ bash splunk.sh [USERNAME] [HEC TOKEN] | |
PASSWORD="$1" | |
TOKEN="$2" | |
test -z "$PASSWORD" && PASSWORD=password | |
test -z "$TOKEN" && TOKEN=token |
#!/bin/bash | |
BRANCHES=$(git branch -ra | grep $1) | |
NUM=$(echo "$BRANCHES" | wc -l) | |
# check for empty | |
if [ "X$BRANCHES" = "X" ] | |
then | |
echo "No branch matches $1" | |
fi |
# From a fresh install of squeeze | |
apt-get install ruby rubygems # Need ruby to use fpm | |
gem1.8 install fpm --no-ri --no-rdoc | |
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -zxvf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125 | |
rm -rf /tmp/ruby193 |