http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
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
#By www.danhilltech.com | |
#package manager get fastest server + partners | |
sudo apt-get update | |
sudo apt-get install aptitude openssh-server | |
#switch to ssh | |
sudo sh -c 'echo "dan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' |
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 | |
# JQ is required to more easily parse json. | |
AWS_IAM_ROLE=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/` | |
AWS_ACCESS_KEY_ID=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.AccessKeyId'` | |
AWS_SECRET_ACCESS_KEY=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.SecretAccessKey'` | |
AWS_TOKEN=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.Token'` | |
AWS_AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone` | |
AWS_DEFAULT_REGION="`echo \"$AWS_AZ\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`" | |
LOCAL_IP=`curl -sL http://169.254.169.254/latest/meta-data/local-ipv4` | |
PUBLIC_IP=`curl -sL http://169.254.169.254/latest/meta-data/public-ipv4` |
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
# /etc/ssh/ldap.conf | |
# See ldap.conf(5) for details | |
# This file should be world readable but not world writable. | |
BASE ou=People,dc=example,dc=org | |
URI ldap://localhost |
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 | |
# set up some variables | |
NOW_DATE=$(date '+%Y-%m-%d-%H-%M') | |
RESTORE_FROM_INSTANCE_ID=<source name> | |
TARGET_INSTANCE_ID=<target name> | |
TARGET_INSTANCE_CLASS=db.m4.large | |
VPC_ID=<vpc subnet id> | |
NEW_MASTER_PASS=<root password> |
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
# License: CC0 1.0 or newer | |
# https://creativecommons.org/publicdomain/zero/1.0/ | |
# You can download this script here: https://gist.github.com/vazhnov/fcb487e6ea432fec056793ef710b5a28 | |
wget "http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+xenial_all.deb" | |
sudo dpkg -i zabbix-release_3.0-1+xenial_all.deb | |
sudo apt-get update | |
sudo apt-get install zabbix-server-pgsql zabbix-frontend-php libapache2-mod-php php-bcmath php-mbstring php7.0-xml php-pgsql | |
# Zabbix can't work without password (with ident), so you need to create user with password: |
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
Disk encryption benchmarks: | |
$ cryptsetup benchmark | |
# Tests are approximate using memory only (no storage IO). | |
PBKDF2-sha1 352344 iterations per second | |
PBKDF2-sha256 196215 iterations per second | |
PBKDF2-sha512 156784 iterations per second | |
PBKDF2-ripemd160 237449 iterations per second | |
PBKDF2-whirlpool 73470 iterations per second | |
# Algorithm | Key | Encryption | Decryption |
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
### variables | |
variable "env" {} | |
variable "riak_count" {} | |
variable "elastic_count" {} | |
### hostname.tpl | |
${name}-${env}-${format("%02s",index)} ${extra} | |
### ansible.tpl |
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 | |
user_name="$1" | |
echo "Removing user: ${user_name}" | |
echo "Deleting Access Keys:" | |
keys=("$(aws iam list-access-keys --user-name "${user_name}" | jq -r '.AccessKeyMetadata[] | .AccessKeyId')") | |
if [[ "${#keys}" -gt "0" ]]; then | |
# shellcheck disable=SC2068 |
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 bash | |
# set -o nounset | |
set -o errexit | |
shopt -s dotglob | |
# Remove oldest .tgz files, if free space less than 50GB | |
# | |
# License: CC0 1.0 or newer | |
# https://creativecommons.org/publicdomain/zero/1.0/ | |
# |
OlderNewer