-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
132 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# -*- coding: utf-8 -*- | ||
# | ||
# activate your virtualenv quickly if not using pyenv-virtualenv | ||
# | ||
# usage: | ||
# | ||
# - activate: ``$ source ./bin/py/activate.sh`` | ||
# - deactivate: ``$ deactivate`` | ||
|
||
if [ -n "${BASH_SOURCE}" ] | ||
then | ||
dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
else | ||
dir_here="$( cd "$(dirname "$0")" ; pwd -P )" | ||
fi | ||
source ${dir_here}/python-env.sh | ||
source ${bin_activate} |
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
find md5 checksum of a file. | ||
""" | ||
|
||
import hashlib | ||
|
||
|
||
def find_md5_sum(path): | ||
md5 = hashlib.md5() | ||
with open(path, "rb") as f: | ||
md5.update(f.read()) | ||
return md5.hexdigest() | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
|
||
print(find_md5_sum(sys.argv[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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
#!/bin/bash | ||
# -*- coding: utf-8 -*- | ||
|
||
dir_here="$( cd "$(dirname "$0")" ; pwd -P )" | ||
dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
dir_bin="$(dirname "${dir_here}")" | ||
dir_project_root=$(dirname "${dir_bin}") | ||
|
||
source ${dir_bin}/py/python-env.sh | ||
|
||
print_colored_line $color_cyan "[DOING] create virtualenv for ${venv_name} at ${dir_venv} ..." | ||
if [ ${use_pyenv} == "Y" ]; then | ||
pyenv virtualenv ${py_version} ${venv_name} | ||
|
||
if [ ${os_is_windows} == "Y" ]; then | ||
virtualenv -p ${bin_global_python} ${dir_venv} | ||
${bin_pip} install --upgrade pip | ||
else | ||
|
||
if [ ${use_pyenv} == "Y" ]; then | ||
if this_command_exists "pyenv"; then | ||
pyenv virtualenv ${py_version} ${venv_name} | ||
${bin_pip} install --upgrade pip | ||
else | ||
print_colored_line $color_red "pyenv not installe, either install it from https://github.com/pyenv/pyenv, or set use_pyenv=\"N\" in ./bin/settings.sh" | ||
exit 1 | ||
fi | ||
else | ||
virtualenv -p ${bin_global_python} ${dir_venv} | ||
${bin_pip} install --upgrade pip | ||
fi | ||
|
||
fi |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# -*- coding: utf-8 -*- | ||
|
||
curl -s http://169.254.169.254/latest/dynamic/instance-identity/ -m 1 > /tmp/null # timeout 1 second | ||
if [ $? -eq 0 ]; then # if has response | ||
is_ec2="Y" | ||
else | ||
is_ec2="N" | ||
fi | ||
|
||
if [ -n "$CI" ]; then # if has value | ||
is_ci="Y" | ||
else | ||
is_ci="N" | ||
fi | ||
|
||
if [ -n "$TRAVIS" ]; then # if has value | ||
is_travisci="Y" | ||
else | ||
is_travisci="N" | ||
fi | ||
|
||
if [ -n "$CIRCLECI" ]; then # if has value | ||
is_circleci="Y" | ||
else | ||
is_circleci="N" | ||
fi | ||
|
||
if [ -n "$CODEBUILD_BUILD_ID" ]; then # if has value | ||
is_aws_codebuild="Y" | ||
else | ||
is_aws_codebuild="N" | ||
fi |