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 | |
# Run this file to register these functions in your shell. | |
# You can include it in your .bashrc or .bash_profile like this: | |
# . ./scmhelper.sh | |
############################################################################### | |
# Helper function that figures out which SCM | |
# you are using. | |
function getScmType() |
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 | |
for i in {a..z}; do banner " $i"; festival -b "(SayText \"$i\")" 1>/dev/null; done |
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 | |
# takes one argument as domain name and checks if this domain is registered. | |
# | |
# usage: | |
# sss google.com | |
# | |
function sss() | |
{ |
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 printDebug() | |
{ | |
if [ ! -z "$debug" ]; then | |
echo "$1" | |
fi | |
} | |
debug="$1" |
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 | |
echo '*******************************************************************' | |
service httpd status; httpdStatus=$(echo $?) | |
service tomcat6 status; tomcatStatus=$(echo $?) | |
service mongod status; mongoStatus=$(echo $?) | |
echo '*******************************************************************' | |
if [[ $httpdStatus == 3 && $tomcatStatus == 3 && $mongoStatus == 3 ]]; then | |
echo "ALL SERVICES ARE STOPPED!" |
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
java -Xms1024M -Xmx4096M -Xss200M -XX:MaxPermSize=4096m -XX:+CMSClassUnloadingEnabled -jar `dirname $0`/sbt-launch.jar "$@" |
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
// You just need to ignore dup key errors :) | |
// in Mongo shell: ... | |
> | |
> var lastUpdateTime = ISODate("2013-09-10") | |
> var newUpdateTime = ISODate("2013-09-12") | |
> | |
> lastUpdateTime | |
ISODate("2013-09-10T00:00:00Z") |
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 | |
# Run with a single argument - number of minutes remaining. | |
# For example for 1 min countdown use: | |
# ./go_home_countdown.sh 1 | |
set -e | |
remaining=$(( $1 * 60 )) |
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 | |
# Collects system performance statistics such as CPU, memory, and disk | |
# usage as well as top processes ran by users. | |
# | |
# All size values are in KiB (memory, disk, etc). | |
# Takes these command line arguments: | |
# $1 - cpuThreshold in % of total across all CPUs. Default is provided in no-args option. |
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
case class Transformer[From, To](input: List[From], f: From => To) { | |
import scala.util.{Try, Success, Failure} | |
lazy val transformedWithIndex: List[(Try[To], Int)] = | |
input map { l => Try ( f(l) ) } zipWithIndex | |
def failuresWithIndex = | |
transformedWithIndex.filter { case (v, i) => v.isFailure } | |
lazy val failuresExist: Boolean = |
OlderNewer