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 config. | |
# You can change the default config with `make cnf="config_special.env" build` | |
cnf ?= config.env | |
include $(cnf) | |
export $(shell sed 's/=.*//' $(cnf)) | |
# import deploy config | |
# You can change the default deploy config with `make cnf="deploy_special.env" release` | |
dpl ?= deploy.env | |
include $(dpl) |
In this step we'll create a swarm cluster from two nodes. You should've received access to two nodes in AWS.
- SSH in to the first node:
ssh -i docker_demo.pem ubuntu@IP1
- Figure out the internal IP address of the node:
ifconfig
and check the eth0 address (10.0....
) - Initialize the Swarm cluster: `docker swarm init --listen-addr INTERNAL_IP --advertise-addr INTERNAL_IP
- Open a new tab and SSH to the other node:
ssh -i docker_demo.pem ubuntu@IP2
- Check the internal IP of that node:
ifconfig
and eth0 - Join to the cluster with the command the previous command printed out. Before executing the command, you need to the extend it with the
--listen-addr
and--advertise-addr
parameters (using the internal IP of the second node):docker swarm join TOKEN --listen-addr 10.0.... --advertise-addr 10.0..... node1...
- Get back to the first node and verify the results:
docker node ls
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/python3 | |
# This script is a simple introduction to the python elasticsearch API. | |
# | |
# This script will populate an elasticsearch index from a file and then give a simple command line query interface. | |
# Each line of the input file will be mapped into a JSON document of the form { "text": "my file line..." } and added | |
# to the index. | |
# | |
# You can use Docker to spin up a local elasticsearch instance to play around with, e.g. | |
# docker run --name elasticsearch -d -p 9200:9200 elasticsearch:latest | |
# |
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
// Swap values for CHANGE FOR YOURSELF, and OBS: it's a novelty authentication, so improvements can and will happen | |
package main | |
import ( | |
"bufio" | |
"crypto/hmac" | |
"crypto/sha1" | |
"fmt" | |
"github.com/craigmj/gototp" |