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
provider "aws" { | |
version = "~> 2.0" | |
region = "eu-west-2" | |
} | |
# Providing a reference to our default VPC | |
resource "aws_default_vpc" "default_vpc" { | |
} | |
# Providing a reference to our default subnets |
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
# Set the command-line arguments to pass to the server. | |
ARGS='-web.listen-address=:9100 -collector.diskstats.ignored-devices="^(ram|loop|fd)\\d+$"' | |
# Prometheus-node-exporter supports the following options: | |
# -collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$": Regexp of devices to ignore for diskstats. | |
# -collector.filesystem.ignored-mount-points="^/(sys|proc|dev)($|/)": Regexp of mount points to ignore for filesystem collector. | |
# -collector.ipvs.procfs="/proc": procfs mountpoint. | |
# -collector.megacli.command="megacli": Command to run megacli. | |
# -collector.ntp.server="": NTP server to use for ntp collector. | |
# -collector.textfile.directory="": Directory to read text files with metrics from. |
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
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB | |
#/32 = 496630545 = 473MB | |
#/64 = 248315272 = 236MB | |
#/128 = 124157636 = 118MB | |
#/256 = 62078818 = 59MB | |
#/512 = 31039409 = 29MB | |
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762 | |
#/25165760 = 623 # half of max_connections = 1993.6MB | |
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608 | |
#*(3/4) #default innodb pool size = 11922309120 |
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
# Kernel sysctl configuration file for Red Hat Linux | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
# sysctl.conf(5) for more details. | |
# Controls source route verification | |
net.ipv4.conf.default.rp_filter = 1 | |
# Do not accept source routing | |
net.ipv4.conf.default.accept_source_route = 0 |
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
# | |
# Cutom Environment Variables for Tomcat | |
# | |
############################################ | |
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre | |
export PATH=${JAVA_HOME}/bin:${PATH} | |
############################################ | |
# | |
# JAVA_OPTS |
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
vi /etc/environment | |
add these lines... | |
LANG=en_US.utf-8 | |
LC_ALL=en_US.utf-8 |
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 os | |
import sys | |
import time | |
import argparse | |
import boto3 | |
if os.environ.get('AWS_PROFILE') is None: | |
sys.exit('Environment variable AWS_PROFILE not set') | |
argparser = argparse.ArgumentParser(description='Snapshot EC2 instance volume with volume ID specified by argument') |
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 os | |
import sys | |
import time | |
import argparse | |
import boto3 | |
if os.environ.get('AWS_PROFILE') is None: | |
sys.exit('Environment variable AWS_PROFILE not set') | |
argparser = argparse.ArgumentParser(description='Snapshot EC2 instance volume with volume ID specified by argument') |
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 | |
# Run as sudo. for weekly backup of db. and upload to s3 bucket. | |
DBHOME="/home/priyank/crontabs/dbbackups/" | |
BUCKETNAME="yourAWSbucket" | |
SCRIPTNAME="$(basename $BASH_SOURCE)" | |
SCRIPTFULLPATH="$(pwd)/$(basename $BASH_SOURCE)" | |
mkdir -p $DBHOME | |
chown -R postgres:postgres $DBHOME | |
cp $SCRIPTFULLPATH $DBHOME | |
SCHEMA_BACKUP="$DBHOME/$(date +%w).sql" |
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 | |
set -e | |
REPO_DIR=~/.iam_lookup/complete-aws-iam-reference | |
REPO_URL=https://github.com/widdix/complete-aws-iam-reference | |
if [[ $1 == "update" ]];then | |
if [[ -e $REPO_DIR ]];then | |
(cd "$REPO_DIR" && git pull) | |
else |
NewerOlder