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 | |
usage() { | |
echo "Usage: $0 [options] [action] [branch]" | |
echo "Actions: " | |
FORMAT=" %-30s %s\n" | |
printf "$FORMAT" "curr" \ | |
"prints the current version" | |
printf "$FORMAT" "incr major|minor|patch" \ | |
"prints the version with incremented major, minor or patch" |
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 | |
# | |
# The MIT License | |
# | |
# Copyright (c) 2011 Mathias Leppich <mleppich@muhqu.de> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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 | |
# | |
# lets you run xcode from any subdirectory of your project | |
# | |
function findproj { | |
if [ "/" != "$1" ]; then | |
p=$(basename $1/*.xcodeproj); | |
if [ "*.xcodeproj" = "$p" ]; then | |
up=$(dirname $1); | |
if [ "/" != "$up" ]; then |
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
function (doc) { | |
// DOESN'T WORK: | |
var version = /(\d+)\.?(\d+)?\.?(\d+)?/.exec("1.3"); | |
emit(version); | |
} |
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 | |
URL="http://127.0.0.1:5984" | |
DBNAME_A="deletion_conflicts_test_a" | |
DBNAME_B="deletion_conflicts_test_b" | |
echo "setup" | |
curl -H 'Content-Type:application/json' -X DELETE "$URL/$DBNAME_A" | |
curl -H 'Content-Type:application/json' -X DELETE "$URL/$DBNAME_B" | |
curl -H 'Content-Type:application/json' -X PUT "$URL/$DBNAME_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 | |
DB_URL=http://localhost:5984 | |
DB_READS_300=$(curl -sg $DB_URL'/_stats/couchdb/database_reads?range=300' \ | |
| python -m 'json.tool' \ | |
| grep current \ | |
| sed -e 's/[^0-9\.]//g' \ | |
|| echo 0) | |
DB_READS_SEC=$(echo "scale=4; $DB_READS_300/300" | bc) |
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 | |
(cat | awk '{ | |
if ($1 ~ /^[0-9]/) { | |
cmd = "sipcalc " $1; | |
address = ""; mask = ""; bits = ""; | |
while (cmd | getline > 0) { | |
if ($1 == "Network" && $2 == "address") | |
address = $4; | |
else if ($1 == "Network" && $2 == "mask" && $3 == "-") | |
mask = $4; |
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
<?php | |
function main() { | |
$limit = 100; | |
$offset = 0; | |
$iter = new NextIteratorCallbackIterator(function() use ($orm, $limit, &$offset) { | |
printf("selecting next bunch at offset %d\n", $offset); | |
$recs = $orm->select($filter, $sorting, $limit , $offset); |
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 -e | |
usage() { | |
cat <<USAGE | |
usage: $(basename $0) REPL_JSON COUCH_URL [ --cancel | --advance SEQ ] [ --cycle [SLEEP] ] | |
USAGE | |
} | |
usageHelp() { | |
usage; |
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 -e | |
usage() { | |
echo "Usage: $(basename $0) [ -i|--internal ] [ -s|--skip-cached ] [ --name NAME | --prefix PREFIX ] [-- options]" | |
echo " -i | --internal use internal IPs instead of external" | |
echo " -e | --external use external IPs instead of internal (default)" | |
echo " -s | --skip-cached skip the cached result of ec2-describe-instances, it gets cached for max 1 hour" | |
echo " --name NAME filter the output by instance NAME" | |
echo " --prefix PREFIX filter the output by instance name PREFIX" |