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
# 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
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
#!/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
# 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
# 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
# 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
#!/bin/bash | |
# | |
# Installation of Hashicorp Nomad for deploy process | |
# | |
# Download this file: | |
# curl -sSL https://gist.githubusercontent.com/ryanpadilha/351a4a4f17afdc8eb0d963897b98122a/raw/ -o nomad-install.sh | |
# | |
echo "Initializing script for devops - Nomad Hashicorp" |
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
psql -h 172.31.3.119 -U <username> -p 5492 <database> | |
\dt public.* | |
select * from pg_tables where schemaname='public'; | |
SELECT specific_catalog, specific_schema, specific_name, routine_name | |
FROM information_schema.routines | |
WHERE routine_type='FUNCTION' | |
AND specific_schema='public' | |
AND routine_name LIKE 'gin_%'; |
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 | |
# | |
# Jenkins 2.73.2 instructions for execute backup from .zip files of Thinbackup plugin | |
cd /opt/backup/jenkins | |
# global configuration for first use | |
git config --global user.email "[email protected]" | |
git config --global user.name "Ryan Padilha" | |
if [ -n "$(git status --porcelain)" ]; then |