This file contains hidden or 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 python | |
# Adapted from Mark Mandel's implementation | |
# https://github.com/ansible/ansible/blob/devel/plugins/inventory/vagrant.py | |
import argparse | |
import json | |
import paramiko | |
import subprocess | |
import sys | |
This file contains hidden or 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
alias vagrant-destroy='vagrant halt ; vagrant destroy --force' | |
_ansible_as_sudo_internal() { | |
local user="$1" | |
local host_pattern="$2" | |
shift | |
shift | |
ANSIBLE_HOST_KEY_CHECKING=false ansible "$host_pattern" \ |
This file contains hidden or 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
FROM node:0.10.36-slim | |
WORKDIR /opt | |
COPY . /opt | |
EXPOSE 8080 | |
CMD [ "node", "hello.js" ] |
This file contains hidden or 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
Vagrant.configure(2) do |config| | |
config.vm.box = "chef/centos-6.6" | |
config.vm.provision "shell", inline: <<-SHELL | |
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
yum -y install libmcrypt-devel nodejs npm | |
npm install mcrypt | |
# vagrant ssh ; cd /vagrant | |
# node example.js | |
SHELL |
This file contains hidden or 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 | |
# | |
# Simple Docker CLI wrapper: | |
# - let "docker pull" to pull public registry images | |
# from private registry. | |
# - let other "docker" commands to act as before. | |
# | |
# Will use environment variable PRIVATE_DOCKER_REGISTRY | |
# to pull images. | |
# |
This file contains hidden or 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 { |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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]> |