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 | |
region=YOUR REGION HERE | |
# Get a new Eip | |
allocated_eip=$(aws --region $region ec2 allocate-address --output table | perl -lne 'print $& if /(\d+\.){3}\d+/') | |
# Get the current Eip | |
old_ip=$(curl -s ident.me) |
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
#!/usr/bin/env python | |
import os | |
import gzip | |
import shutil | |
import datetime | |
import boto3 | |
import ntpath | |
from subprocess import Popen, PIPE |
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|": \d+,\n|": null,\n|": \d+\.\d+,\n|": false,\n|": true,\n|": ".*" |
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 | |
# | |
# USAGE: ec2ls sa-east-1 | |
# OUTPUT: | |
# Id ImageId Type PublicIp PrivateIp PrivateDNS | |
# i-0XX326X41X0254X25 ami-999X105X t2.small null 192.168.1.111 ip-192-168-1-111.sa-east-1.compute.internal | |
# | |
# | |
aws --region $1 ec2 describe-instances \ |
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 | |
# USAGE: route53subls | |
# | |
# OUTPUT: | |
# | |
# Domain |SubDomain |RecordType|RecordValue | |
# website.com. |sub.website.com. |A |dualstack.websitealb-12345678998.sa-east-1.elb.amazonaws.com. | |
# |
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 | |
# USAGE: route53ls | |
# | |
# OUTPUTS: | |
# | |
# Id |Domain |Records | |
# s/hostedzone/XXXXXXXXXXXXXX |mywebsite.com |5s | |
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 | |
# USAGE: rdsls sa-east-1 | |
# OUTPUT: | |
# Name |Engine |Ec2Type |CreatedAt | |
# myrdsdb |[email protected] |db.t2.micro |2017-09-20T18:54:21.212Zs | |
aws --region $1 rds describe-db-instances \ | |
| jq '.DBInstances[] | "\(.DBInstanceIdentifier) \(.Engine)@\(.EngineVersion) \(.DBInstanceClass) \(.InstanceCreateTime)"' \ | |
| column -t -N 'Name,Engine,Ec2Type,CreatedAt' -o ' |' \ | |
| sed -e 's/\"/\s/g' |
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
#!/usr/bin/python | |
__author__ = "Gabriel Luiz Pereira <[email protected]>" | |
from base64 import b64encode, b64decode | |
class B64Cypher: | |
def __init__(self, salt, iterations): | |
self.salt = salt | |
self.iterations = range(0, iterations) | |
def encode(self, text): |
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
#!/usr/bin/python | |
"""Crypt and decrypt a csv file content""" | |
import csv | |
import sys | |
import Crypto.Random | |
from Crypto.Cipher import AES | |
import hashlib | |
import base64 |
NewerOlder