openssl genrsa -out test.com.key 4096
This is a simple little Python script to let you query EC2 metadata from consul-template. It's only requirement is boto. It uses the EC2 internal metadata service so it does not require any API keys or even a region. The only caveat is that this can only be run on a machine on EC2.
You can give no arguments for full dictionary output or one or more arguments to get specific key(s). Put it somewhere on your machine, chmod +x it and give the full path to consul-template.
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
#!/bin/bash -e | |
CONSUL_ADDR=${CONSUL_ADDR="http://consul.service.consul:8500"} | |
CONSUL_ENDPOINT=${CONSUL_ENDPOINT="/v1/catalog/services"} | |
while true; do | |
INDEX_FILE="$(mktemp -t consul_index_)" | |
CONSUL_INDEX=$( | |
curl -isL \ | |
-H 'X-Consul-Index: 1' \ |
import socket | |
class Netcat: | |
""" Python 'netcat like' module """ | |
def __init__(self, ip, port): | |
self.buff = "" | |
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import datetime | |
import json | |
import logging | |
import os | |
import socket | |
import time |
*.gpg filter=gpg diff=gpg | |
*.asc filter=gpg diff=gpg |
I hereby claim:
- I am marceloalmeida on github.
- I am marceloalmeida (https://keybase.io/marceloalmeida) on keybase.
- I have a public key whose fingerprint is 586B 41A6 EF3F E801 D4B9 3F6E E509 8C68 B9B1 823D
To claim this, I am signing this object: