Setting Environment Variables:
$ export MYSQL_HOSTNAME="/test/ruan/mysql/db01/mysql_hostname"
$ export MYSQL_USERNAME="/test/ruan/mysql/db01/mysql_user"
#!/bin/bash | |
#set -e | |
python -c "import $1" > /dev/null 2>&1 | |
code=$? | |
if [ $code == 0 ] | |
then | |
echo "good" | |
echo "Status Code: $code" | |
else |
package main | |
import ( | |
"io/ioutil" | |
"os" | |
"fmt" | |
) | |
var ( | |
input_filename string |
## Resources: | |
# https://pypi.python.org/pypi/coinmarketcap/ | |
# https://coinmarketcap.com/api/ | |
import json | |
import requests | |
from coinmarketcap import Market | |
c = Market() |
>>> import random, string | |
>>> key = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for x in range(32)) | |
>>> iv = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for x in range(16)) | |
>>> print(key, len(key)) | |
('eXS8qhYpisQf4zm60pBeMGbCTh5dfXiQ', 32) | |
>>> print(iv, len(iv)) | |
('mjVRMZ3WSd31fEVn', 16) |
# get the csv from: | |
# https://resources.console.aws.amazon.com/r/tags | |
import csv | |
from collections import Counter | |
with open('resources.csv', 'rb') as csvfile: | |
print("Missing Tags Per Service:") | |
print("=========================") | |
reader = csv.DictReader(csvfile) |
from flask import Flask | |
from flask_caching import Cache | |
import random | |
app = Flask(__name__) | |
cache = Cache(app, config={'CACHE_TYPE': 'simple'}) | |
@app.route("/route1") | |
@cache.cached(timeout=10) | |
def route1(): |
git checkout master | |
git checkout --orphan version | |
for x in `git ls-files`; do git rm --cached $x; done | |
for x in `ls`; do rm -rf $x; done | |
touch README.md | |
git add README.md | |
git commit -m "initial commit for empty version branch" | |
git push origin version |
#!/bin/bash | |
set -ex | |
K=$1 | |
K=${K:=BLANK_VARS} | |
if [ "$K" == "BLANK_VARS" ] ; | |
then echo "blanks" && exit 1 ; | |
else echo $K ; |
from flask import Flask | |
from flask_caching import Cache | |
from time import strftime | |
app = Flask(__name__) | |
app.config['CACHE_TYPE'] = 'simple' | |
app.cache = Cache(app) | |
def get_time(): |