This concept is very much like .jar
or .war
archives in Java.
NOTE: The built
.pyz
zipapp can run on both Python 2 & 3 but you can only build.pyz
zipapps with Python 3.5 or later.
resource "aws_secretsmanager_secret" "IRCSecrets" { | |
name = "irc/client/credentials" | |
description = "My IRC client credentials" | |
} | |
resource "aws_secretsmanager_secret_version" "IRCCredentials" { | |
secret_id = "${aws_secretsmanager_secret.IRCSecrets.id}" | |
secret_string = "{\"username\":\"AzureDiamond\",\"password\":\"hunter2\"}" | |
} |
/* | |
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command: | |
ssh -R 8080:127.0.0.1:8080 [email protected] | |
which opens a tunnel between the two endpoints and permit to exchange information on this direction: | |
server:8080 -----> client:8080 |
import boto | |
import boto.s3 | |
import os.path | |
import sys | |
# Fill these in - you get them when you sign up for S3 | |
AWS_ACCESS_KEY_ID = '' | |
AWS_ACCESS_KEY_SECRET = '' | |
# Fill in info on data to upload |
import boto3 | |
# you can assign role in the function like below | |
# ROLE_ARN = 'arn:aws:iam::01234567890:role/my_role' | |
# | |
# or you can pass role as an evironment varibale | |
# ROLE_ARN = os.environ['role_arn'] | |
ROLE_ARN = = os.environ['role_arn'] |
import argparse | |
import boto3 | |
import mimetypes | |
import os | |
# python3 s3dirupload.py --rolearn "arn:aws:iam::account:role/OrganizationAccountAccessRole" --destinationbucket "bucket" --sourcedirectory '/assets' | |
# Get CLI Arguments | |
parser = argparse.ArgumentParser(description='Upload directory to S3.') | |
parser.add_argument('--sourcedirectory', |
resource "aws_s3_bucket" "foobar_bucket_name" { | |
bucket = "${var.name_prefix}-foobar-name-${var.env}" | |
acl = "private" | |
lifecycle_rule { | |
id = "${var.name_prefix}-foobar-name-${var.env}-abort-incomplete-multipart" | |
enabled = true | |
abort_incomplete_multipart_upload_days = 7 | |
} |
# Example Run: bash tfinstall.sh "0.11.14" | |
# Example Run with Curl: curl https://gist.githubusercontent.com/jonathanhle/e7cbee565e61d34a57ded7edd6cdad6e/raw/4cf991ccd2ed3ed38bef4bf58dd5bc22bb7c1c8f/tfinstall.sh | bash -s "0.11.14" | |
export tfversion=$1 | |
# Check if terraform is installed | |
if which -s terraform | |
then | |
echo "Terraform client is already installed": | |
terraform --version |
import requests | |
from requests.adapters import HTTPAdapter | |
from requests.packages.urllib3.util.retry import Retry | |
with requests.Session() as s: | |
retries = Retry( | |
total=10, | |
backoff_factor=0.2, | |
status_forcelist=[500, 502, 503, 504]) |
This concept is very much like .jar
or .war
archives in Java.
NOTE: The built
.pyz
zipapp can run on both Python 2 & 3 but you can only build.pyz
zipapps with Python 3.5 or later.
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |