Skip to content

Instantly share code, notes, and snippets.

View zenatuz's full-sized avatar
🎯
Focusing

Renato Batista zenatuz

🎯
Focusing
View GitHub Profile
@zenatuz
zenatuz / check_docker.py
Created December 16, 2019 19:07
Docker Containers
import socket
import os
# Porta 81
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('localhost',81))
if result == 0:
print "Port is open"
else:
os.system("docker run -p 81:80 -d dotnetapp:latest")
{
"infra-audit-store-%y%m%d-2022.02.03": {
"aliases": {}
},
"logstash-2022.02.03": {
"aliases": {}
},
"infra-keycloak-2022.02.25": {
"aliases": {}
},
from datetime import datetime,timedelta
from requests.auth import HTTPBasicAuth
import argparse
import json
import os
import requests
import sys
# Getting ENV Variables
ELASTIC_API_URL = os.getenv('ELASTIC_API_URL')