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
# Backup all in-use volumes in all regions | |
import boto3 | |
def lambda_handler(event, context): | |
ec2 = boto3.client('ec2') | |
# Get list of regions | |
reg = 'us-east-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
#!/bin/bash | |
cd /tmp | |
wget https://s3-us-west-1.amazonaws.com/amazon-ssm-us-west-1/latest/debian_amd64/amazon-ssm-agent.deb | |
sudo dpkg -i amazon-ssm-agent.deb | |
sudo service amazon-ssm-agent start |
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
PATH=$WORKSPACE/venv/bin:/usr/local/bin:$PATH | |
if [ ! -d "venv" ]; then | |
virtualenv venv | |
fi | |
. venv/bin/activate | |
pip install -r requirements.txt | |
. venv/bin/activate | |
nose2 --plugin nose2.plugins.junitxml --junit-xml |
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 | |
ansible_configuration=$1 | |
shift | |
cat <<-EOF | |
#! /bin/bash | |
set -o errexit |
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
#path: /etc/nginx/conf.d/ | |
server { | |
listen 80; | |
server_name localhost; | |
charset utf-8; | |
client_max_body_size 75M; | |
location ^~ /static/ { |
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 | |
cd /tmp | |
curl https://amazon-ssm-us-east-1.s3.amazonaws.com/latest/debian_amd64/amazon-ssm-agent.deb -o amazon-ssm-agent.deb | |
sudo dpkg -i amazon-ssm-agent.deb | |
sudo service amazon-ssm-agent start |
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
#Python OOP | |
class Employee: | |
raise_amount = 1.04 | |
num_emp = 0 | |
def __init__(self,first,last,pay): | |
self.First = first | |
self.Last = last |
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
for i in ./{a,b,c}-{1,2,3}.{txt,log,bin}; do echo $i > $i; done |
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
n = int(input('Enter a none prime number: ')) | |
def main(number): | |
f = [] | |
while not is_prime(number): | |
if number % 2 == 0: | |
f.append(2) | |
number = number // 2 | |
if is_prime(number): | |
f.append(number) |