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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: AWS CloudFormation Sample Template for CFN Init | |
Parameters: | |
KeyName: | |
Description: Name of an existing EC2 KeyPair to enable SSH access to the instances | |
Type: AWS::EC2::KeyPair::KeyName | |
ConstraintDescription: must be the name of an existing EC2 KeyPair. | |
LatestLinuxAmiId: | |
Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>' |
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
# read more at: https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-public-parameters.html | |
# this will pickup the latest value of the parameter every time the template is run | |
# the parameter value must be the Key for that Parameter. Then CFN will retrieve the value | |
# this does not support SecureString SSM Parameter types | |
Parameters: | |
LatestLinuxAmiId: | |
Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>' | |
# obtain list with |
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 logging | |
import boto3 | |
from botocore.exceptions import ClientError | |
import time | |
AMI='ami-0f93b5fd8f220e428' | |
SUBNET='subnet-8f5e56e7' | |
SG=['sg-0d5d78dc3b411252b'] | |
REGION='us-east-2' | |
KEY='VyprVPN-us-east-2' |
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
https://www.internetstaff.com/multiple-ec2-network-interfaces-on-red-hat-centos-7/ |
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
FROM alpine:3.10.1 | |
RUN apk add --update / | |
python3 / | |
py-pip / | |
curl | |
##Example CMD exec form | |
#CMD ['python3','--version'] |
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
def duplSets(l): | |
l = set(l) | |
print (l) | |
#Libert R Schmidt | |
# http://www.practicepython.org/exercise/2014/05/15/14-list-remove-duplicates.html | |
def duplLoop(l): | |
newL=[] |
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
#!/bin/bash | |
#ffmg = ffmpeg -i 2.5-2.mp3 -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 2.5-2-e.mp3 | |
for i in $(ls *.mp3); do | |
#echo audio: $i | |
NAME=`echo "$i" | cut -d'.' -f1` |
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
#!/bin/sh | |
# to use, copy this file into your .git/hooks folder in your git repo | |
# Rename the file to: pre-commit | |
# make sure to add execute permissions using: chmod +x .git/hooks/pre-commit | |
command -v pngcrush >/dev/null 2>&1 || { | |
echo "\033[1mPlease install pngcrush to reduce images size before commit\033[0m" | |
echo "Install pngcrush with the following:" | |
echo "\t \033[1mbrew install pngcrush\033[0m" | |
echo "OR" | |
echo "\t Site: \033[1m\033[4mhttp://pmt.sourceforge.net/pngcrush/\033[0m" |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Outputs": { | |
"CCRoleArn": { | |
"Value": { | |
"Fn::GetAtt": [ | |
"CCRole", | |
"Arn" | |
] | |
} |
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
#Libert R Schmidt | |
#rschmidt@libert.xyz | |
#Practice Python http://www.practicepython.org/exercise/2014/04/02/09-guessing-game-one.html | |
import random | |
def start_game(): | |
num = int(input("Guess the number between 1 and 9 --> ")) | |
game(num) |