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
""" alembic_helper.py | |
Copyright (c) 2016 Jonathan M. Altman | |
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 copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject |
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
### Keybase proof | |
I hereby claim: | |
* I am jonathana on github. | |
* I am async_io (https://keybase.io/async_io) on keybase. | |
* I have a public key whose fingerprint is FAA7 9642 2B31 D4F6 91F6 9E89 335C 076F 41A0 559E | |
To claim this, I am signing this object: |
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 fs = require('fs'), | |
zlib = require('zlib'); | |
var r = fs.createReadStream('file.txt'); | |
var z = zlib.createGzip(); | |
var w = fs.createWriteStream('file.txt.gz'); | |
r.pipe(z).pipe(w); |
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
# Common directory under which all our servers will live. Set this to where you keep your vagrant servers | |
export VAGRANT_SERVERS=__SET_THIS_TO_THE_PATH_WHERE_YOUR_VAGRANT_SERVER_SETUPS_ARE | |
# Grab the subcommands out of the no-arg invocation of vagrant | |
VAGRANT_SUBCMDS=`vagrant list-commands | awk 'BEGIN { in_subs=0 }; /^$/ { if (in_subs == 0) { in_subs=1; next } }; { if (in_subs) { print $1 } };'` | |
# FUNCTION: vgt | |
# PURPOSE: shell "command" to run a vagrant sub-command against a specific VM | |
# USAGE: vgt _server_name_ _vagrant_subcommand_ | |
# ARGUMENTS: |
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 sys, os, glob | |
from datetime import datetime | |
sys.path.append(os.environ.get("MAHOUT_CORE")) | |
for jar in glob.glob(os.environ.get("MAHOUT_JAR_DIR") + "/*.jar"): | |
sys.path.append(jar) | |
from org.apache.mahout.common import RandomUtils | |
from org.apache.mahout.cf.taste.common import TasteException | |
from org.apache.mahout.cf.taste.eval import * |