List AWS regions and parsing using jq:
"ap-south-1"
"eu-west-1"
"ap-southeast-1"
"ap-southeast-2"
"eu-central-1"
"ap-northeast-2"
``` | |
# Defines our Vagrant environment | |
# | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "dummy" | |
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'aws' |
#!/usr/bin/env bash | |
USERS=$(cat /etc/passwd) | |
while IFS=: read username password userID groupID gecos homedir usershell | |
do | |
if [ "$userID" -ge 1000 ] | |
then | |
sudo chown -R "$username". "$homedir" | |
fi |
List AWS regions and parsing using jq:
"ap-south-1"
"eu-west-1"
"ap-southeast-1"
"ap-southeast-2"
"eu-central-1"
"ap-northeast-2"
When using --filters option always check which ones are supported e.g. 'aws ec2 describe-vpcs help' (dhcp-options-id, isDefault, state, vpc-id).
Otherwise use tag-key and tag-value for key/value combination of a tag assigned to the resource:
$ aws ec2 describe-vpcs --profile xxx-sandbox --filters Name=tag-key,Values=Name Name=tag-value,Values=myVPC
{
"Vpcs": [
{
"VpcId": "vpc-55de7c32",
#!/usr/bin/env bash | |
# Dear Oracle: I know you employ more lawyers than engineers, but FFS please just make it possible to download that package with a simple curl or wget. | |
# Oh, and the fact that the certificate is invalid means that if this did come to a lawsuit, people would just claim that a MITM attack forged their agreement to the licence. | |
wget -q --no-cookies --no-check-certificate --header \ | |
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \ | |
"http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.rpm" | |
sudo yum localinstall -y jdk-8u102-linux-x64.rpm |
$ docker-machine create --driver virtualbox swarm-1 | |
$ docker-machine create --driver virtualbox swarm-2 | |
$ docker-machine create --driver virtualbox swarm-3 | |
$ docker-machine ls | |
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS | |
swarm-1 - virtualbox Running tcp://192.168.99.100:2376 v1.12.1 | |
swarm-2 * virtualbox Running tcp://192.168.99.101:2376 v1.12.1 |
$ docker-machine create -d virtualbox node1 | |
$ docker-machine create -d virtualbox node2 | |
$ docker swarm init --advertise-addr 192.168.99.100 | |
Swarm initialized: current node (3e9deoyqmm4q95xmxegtlusi0) is now a manager. | |
To add a worker to this swarm, run the following command: | |
docker swarm join \ | |
--token SWMTKN-1-05ii9ckfw8evswg3spzgtef8pvy9l2e1izzp16k0gxtwchr96u-b7q7ksfqdum2jrybdsb9qobrx \ |
$ docker run -d --name redis-server redis | |
e1da6218780ad8243dfcaf83bd2f712ae981089510a1ba4b67f689f11db54f4a | |
$ docker logs --tail 10 redis-server | |
`-._ `-._`-.__.-'_.-' _.-' | |
`-._ `-.__.-' _.-' | |
`-._ _.-' | |
`-.__.-' | |
1:M 22 Aug 15:02:57.686 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. |
$ cat vault.hcl | |
backend "consul" { | |
address = "consul:8500" | |
advertise_addr = "consul:8300" | |
scheme = "http" | |
} | |
listener "tcp" { | |
address = "0.0.0.0:8200" | |
tls_disable = 1 | |
} |