This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'hipchat-api' | |
require 'getopt/long' | |
require 'socket' | |
require 'erb' | |
#Do not modify these constants! (after you set these up, of course) | |
HipApiKey='ABCDEFGHKJHKJHKJHKJH' | |
Room='Nagios' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExodusWriter { | |
private JdbcTemplate jdbcTemplate; | |
private TransactionTemplate transactionTemplate; | |
public ExodusWriter(DataSource dataSource) { | |
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource); | |
jdbcTemplate = new JdbcTemplate(transactionManager.getDataSource()); | |
transactionTemplate = new TransactionTemplate(transactionManager); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output { | |
# <SNIP> other outputs <SNIP> | |
# | |
# Ping me if anything is about to explode, or if any important massage pass by | |
# | |
xmpp { | |
tags => 'warn_me' | |
host => "ejabberd.example.io" | |
message => "time='%{@timestamp}', host='%{@source_host}', tags='%{@tags}',path='%{@source_path}', type='%{@type}', field='%{@fields}' message='%{@message}'," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git pull | |
git push | |
git branch | |
git commit | |
git checkout | |
git status | |
git log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"checks": { | |
"mycheck": { | |
"pagerduty": { | |
"service": "oncall" | |
}, | |
"sendgrid": { | |
"mail_to": "ops@myemail.com" | |
}, | |
"runbook": "https://wiki.url.to.runbook", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creates a bootable ISO from CoreOS' PXE images. | |
# Also adds a run script to the OEM partition and converts the ISO so it can boot from USB media. | |
# Based heavily off https://github.com/nyarla/coreos-live-iso - Thanks Naoki! | |
set -e | |
# Default configurations | |
SYSLINUX_VERSION="6.02" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// ./generatelookup -l lookupkey -p somekey* -a attribute | |
var redis = require('redis').createClient(); | |
var async = require('async'); | |
var opt = require('optimist'); | |
opt.usage('$0 -l lookup -p pattern -a attribute'); | |
opt.demand(['l', 'p', 'a']); | |
var argv = opt.argv; | |
var iter = '0'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
import java.util.concurrent.TimeUnit; | |
import com.google.common.base.Stopwatch; | |
/** | |
* Sample example demonstrating usage of Stopwatch API of Google Guava. | |
* | |
* @see <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Stopwatch.html">Guava Stopwatch</a> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set the ROOM_ID & AUTH_TOKEN variables below. | |
# Further instructions at https://www.hipchat.com/docs/apiv2/auth | |
ROOM_ID=XXX | |
AUTH_TOKEN=XXX | |
MESSAGE="Hello world!" | |
curl -H "Content-Type: application/json" \ |
OlderNewer