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
/** | |
* load all Node.js (including Express) route definitions. | |
* in most cases you should only need to modify the app_routes[] array. | |
* | |
* inspired by the article: | |
* - http://stackoverflow.com/questions/5778245/expressjs-how-to-structure-an-application | |
* | |
* @author William Yeh <[email protected]> | |
* @date 2014-04-09 | |
* @license MIT |
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 | |
MONGODB_NAME=$1 | |
MONGODB_PASS=$2 | |
MONGODB_HOST=$3 | |
MONGODB_PORT=${4:-27017} | |
if [ $# -lt 3 ]; then | |
echo "Simple tool to enable MongoDB balancer." | |
echo "Usage: enable-mongodb-balancer.sh username password host [port]" |
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 | |
MONGODB_NAME=$1 | |
MONGODB_PASS=$2 | |
MONGODB_HOST=$3 | |
MONGODB_PORT=${4:-27017} | |
if [ $# -lt 3 ]; then | |
echo "Simple tool to disable MongoDB balancer." | |
echo "Usage: disable-mongodb-balancer.sh username password host [port]" |
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 | |
MONGODB_NAME=$1 | |
MONGODB_PASS=$2 | |
MONGODB_HOST=$3 | |
MONGODB_PORT=${4:-27017} | |
if [ $# -lt 3 ]; then | |
echo "Simple tool to db.fsyncLock() on MongoDB." | |
echo "Usage: lock-mongodb.sh username password host [port]" |
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 | |
MONGODB_NAME=$1 | |
MONGODB_PASS=$2 | |
MONGODB_HOST=$3 | |
MONGODB_PORT=${4:-27017} | |
if [ $# -lt 3 ]; then | |
echo "Simple tool to db.fsyncUnlock() on MongoDB." | |
echo "Usage: unlock-mongodb.sh username password host [port]" |
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 perl | |
=pod | |
SUMMARY: A simple tool to query the IP ranges for GCE zones. | |
REFERENCE: http://stackoverflow.com/a/19434481 | |
LICENSE: released to public domain. | |
AUTHOR: William Yeh <[email protected]> |
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
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
# | |
# provision script; pull Docker image | |
# | |
docker_image = "busybox" | |
$script = <<SCRIPT |
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
# | |
# fix some errors of 'units.dic' file in common mmseg packages | |
# | |
# URL: https://gist.github.com/William-Yeh/95f7dd1a60242f7d5b62 | |
# | |
# @ref https://github.com/kuan-ming/concise-core/blob/master/src/org/sustudio/concise/core/mmseg/dictionary/units.dic | |
# @ref https://github.com/medcl/elasticsearch-rtf/blob/master/config/mmseg/units.dic | |
# | |
#---------- | |
# |
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 | |
# | |
# Extract a range of lines from stdin and print to stdout. | |
# | |
# Usage: | |
# | |
# head2tail.sh starting-line [number-of-lines] | |
# | |
# Example: | |
# |
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 sbt._ | |
import Keys._ | |
import com.typesafe.sbt.osgi.SbtOsgi._ | |
import sbtunidoc.Plugin._ | |
import UnidocKeys._ | |
import sbtassembly.Plugin._ | |
import AssemblyKeys._ | |
object Build extends Build { |
OlderNewer