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
| # task for Java Application | |
| # | |
| # Download this file: | |
| # curl -sSL https://gist.githubusercontent.com/ryanpadilha/5854213edbad8a9698c72c8a6dc66e24/raw/ -o nomad-operation-for-java-app.hcl | |
| # | |
| # Operation for job execution: | |
| # | |
| # validate job - $ nomad validate nomad-operation-for-java-app.hcl | |
| # plan job - $ nomad plan nomad-operation-for-java-app.hcl | |
| # execution plan - $ nomad run -check-index 55 nomad-operation-for-java-app.hcl |
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
| # server-cluster-nomad.hcl for AWS | |
| # | |
| # define to start an agent in server mode and elect as a leader | |
| # will manage state and make scheduling decisions | |
| # | |
| # Download this file: | |
| # curl -sSL https://gist.githubusercontent.com/ryanpadilha/4f8bfd75c0e48c8f773882165e22cbc7/raw/ -o server-cluster-nomad.hcl | |
| # | |
| # $ nomad agent -config=/var/wplex/devops/nomad-hashicorp/server-cluster-nomad.hcl |
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
| # client-cluster-nomad.hcl for AWS | |
| # | |
| # available to run tasks and interact with server | |
| # | |
| # Download this file: | |
| # curl -sSL https://gist.githubusercontent.com/ryanpadilha/59a0bfddf1895ed49ca12f13342040e5/raw/ -o client-cluster-nomad.hcl | |
| # | |
| # $ nomad agent -config=/var/wplex/devops/nomad-hashicorp/client-cluster-nomad.hcl | |
| # increase log verbosity |
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 | |
| # | |
| # Installation of Docker Environment | |
| # For Ubuntu 16.04 | |
| # https://www.digitalocean.com/community/tutorials/como-instalar-e-usar-o-docker-no-ubuntu-16-04-pt | |
| # adicional packages | |
| sudo apt-get update | |
| sudo apt-get install build-essential python-software-properties git |
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
| db: | |
| image: postgres:9.3 | |
| volumes: | |
| - ~/.docker-volumes/blog/db/:/var/lib/postgresql/data/ | |
| expose: | |
| - '5432' | |
| app: | |
| build: . | |
| command: bundle exec rails s -b 0.0.0.0 -p 3000 |
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
| # identify what installed package you have | |
| dpkg -l | grep -i docker | |
| # remove for docker.io | |
| sudo apt-get remove docker docker-engine docker.io | |
| sudo apt-get purge -y docker.io | |
| sudo apt-get autoremove -y --purge docker.io | |
| sudo apt-get autoclean | |
| sudo rm -rf /var/lib/docker |
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
| import gc | |
| def dump_garbage(): | |
| """ | |
| show us what's the garbage about | |
| """ | |
| # force collection | |
| print "\nGARBAGE:" | |
| gc.collect() |
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 | |
| # | |
| # Create the structure of folders for EC2 environment | |
| # | |
| echo "Initializing script for EC2 environment instance" | |
| G_COMPANY="company" | |
| create_directory() { |
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 | |
| # | |
| # Installation of Certbot for Ubuntu 16.04 (xenial) | |
| # https://certbot.eff.org/#ubuntuxenial-nginx | |
| add-apt-repository ppa:certbot/certbot | |
| apt-get update | |
| apt-get install -y software-properties-common | |
| apt-get install -y python-certbot-nginx |
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 | |
| # Delete all containers | |
| docker rm -f $(docker ps -a -q) | |
| # Delete all images | |
| docker rmi -f $(docker images -q) |