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/sh | |
# script to test bash dialog command | |
# creates a simple cli app that can view or edit a file containing key value | |
# pairs in the form | |
# <key>:<value> | |
file='./conf.txt' | |
tempfile1=/tmp/dialog_1_$$ | |
tempfile2=/tmp/dialog_2_$$ |
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
// Usage: mongo localhost}/{DbName} [-u {Username}] [-p {Password}] < ./print-collection-counts.js.j | |
var collections = db.getCollectionNames(); | |
print('Collections:'); | |
for(var i = 0; i < collections.length; i++){ | |
var name = collections[i]; | |
if(name.substr(0, 6) != 'system') | |
print("\t" + name + ": " + db[name].count()); |
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 | |
# checks if an array contains the specified element | |
containsElement () { | |
local e | |
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done | |
return 1 | |
} | |
REPO="git@github.com:USER/YOUR_PUPPET_REPO" |
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
s3cmd ls s3://sourcebucket/sourcefolder/ | awk '{ print $4 }' | tail -n +2 | sed -e 's!^s3://sourcebucket/sourcefolder/\([a-z0-9\_\.]*\)!s3cmd cp s3://sourcebucket/sourcefolder/\1 s3://targetbucket/targetfolder/\1!g' | bash |
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
<html> | |
<head> | |
<title>jsonp test</title> | |
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('#testlink').click(function(e){ | |
e.preventDefault(); | |
var url = 'http://localhost:3000/foo?cb=?'; |
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
var express = require('express'); | |
var app = module.exports = express.createServer(); | |
// this enables jsonp support | |
app.enable("jsonp callback"); | |
app.configure(function(){ | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'jade'); | |
app.use(express.bodyParser()); |