Check if a Directory exists:
if [ -d "./data" ]
then echo "true"
else echo "false"
fi
import getpass | |
text = getpass.getpass(prompt='Enter your passphrase to encrypt ') | |
print("You have entered: {}".format(text)) |
#!/usr/bin/python | |
import requests | |
import json | |
baseurl = 'https://coindata.co.za/api.php' | |
r = requests.get(baseurl).content | |
j = json.loads(r) | |
for crypto in j: |
#!/usr/bin/env bash | |
# Wrapper MySQL Client for IAM Based Authentication for MySQL and Amazon Aurora on RDS | |
# Read: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html | |
# Usage: [app] [aws_profile] [rds_endpoint] [rds_mysql_username] | |
command_exists() { | |
type "$1" &> /dev/null ; | |
} |
#!/bin/bash | |
#set -e | |
python -c "import $1" > /dev/null 2>&1 | |
code=$? | |
if [ $code == 0 ] | |
then | |
echo "good" | |
echo "Status Code: $code" | |
else |
#!/usr/bin/env bash | |
mkdir -p ~/workspace/go | |
cd /tmp | |
wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz | |
tar -xf go1.8.1.linux-amd64.tar.gz | |
sudo chown -R root:root ./go | |
sudo mv go /usr/local | |
rm -rf go1.8.1.linux-amd64.tar.gz | |
echo 'export GOPATH=$HOME/workspace/go' >> ~/.profile | |
echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.profile |
package main | |
import ( | |
"io/ioutil" | |
"os" | |
"fmt" | |
) | |
var ( | |
input_filename string |