This file contains hidden or 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 boto.ec2 | |
from boto.ec2 import EC2Connection | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
csv_file = open('instances.csv','w+') | |
def process_instance_list(connection): |
This file contains hidden or 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
wget -O w1.txt http://aws.amazon.com/whitepapers/ && for i in `awk -F'"' '$0=$2' w1.txt | grep pdf | grep -v http`; do wget http:$i ; done |
This file contains hidden or 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 | |
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
echo `date` " - Internet OK - IP:" `ifconfig vlan2 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*'` >> /tmp/script.out | |
exit 0 | |
else | |
echo `date` " - Internet NOK - IP:" `ifconfig vlan2 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*'` >> /tmp/script.out | |
killall -SIGUSR1 udhcpc | |
killall -SIGUSR2 udhcpc | |
sleep 600 |
This file contains hidden or 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 | |
# (optional) You might need to set your PATH variable at the top here | |
# depending on how you run this script | |
#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
# Export the aws keys | |
export AWS_ACCESS_KEY_ID= | |
export AWS_SECRET_ACCESS_KEY= | |
This file contains hidden or 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
#download files from bucket | |
#group logs | |
cat *.log >> single.txt && mv single.txt single.log | |
#IPS GET | |
cat single.log| grep -v POST | awk '{print $3}' | cut -d : -f 1 | sort | uniq -c | sort -nr | |
#IPS POST | |
cat single.log| grep -v GET | awk '{print $3}' | cut -d : -f 1 | sort | uniq -c | sort -nr |
This file contains hidden or 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
on run | |
set folderList to (choose folder with multiple selections allowed) | |
tell application "Photos" | |
activate | |
This file contains hidden or 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 | |
#1) Create your private subnet, SGs, and etc... and get the route table ID from privates subnets that need a NAT instance / allocate a new Elastic IP and get the ID. | |
#2) create a launch configuration with the script bellow (dont use user-data text, upload a file with '.sh' extension) | |
# use the this policy in AMI role: | |
#ec2-role-policy | |
# { | |
# "Version": "2012-10-17", | |
# "Statement": [ | |
# { |
This file contains hidden or 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
==== GLUSTERFS CENTOS 6 ==== | |
========repo====== | |
vim /etc/yum.repos.d/gluster.repo | |
[rhel6.8-gluster] | |
name=RHEL 6.8 gluster repository | |
baseurl=http://buildlogs.centos.org/centos/6/storage/x86_64/gluster-3.8/ | |
gpgcheck=0 | |
enabled=1 |
This file contains hidden or 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
Pré Requisitos: | |
Gerar o dump com EXP, e não EXPDP | |
Passos para importar: | |
1) Criar uma Ec2, t2.micro com a AMI: OL7.2-x86_64-HVM-2015-12-10 (ami-b24acede) | |
2) Habilitar swap na máquina |
This file contains hidden or 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
# set variable AWS_PROFILE= to credentials | |
import boto3 | |
# CHANGE REGION HERE- | |
ec2 = boto3.resource('ec2', 'sa-east-1') | |
#check your own tags before run this script | |
#loop for tag Name | |
def tag_name(): | |
print "Loop for TAG Name" | |
for volume in ec2.volumes.all(): |
OlderNewer