Skip to content

Instantly share code, notes, and snippets.

View maguec's full-sized avatar

Chris Mague maguec

View GitHub Profile
#####################################################
# Consul Generated # {{ $role := env "ROLE" }} # {{ $role_tree := printf "%q" (print "mysql-proxy/" $role "/settings") | replaceAll "\"" "" }}
#####################################################
OPTIONS="{{range tree $role_tree }} --{{.Key}}={{.Value}}{{end}}"
server {
listen 80;
server_name _;
location / {
add_header Content-Type text/plain;
return 200 'yo';
}
}
#!/bin/bash
# Takes URL as an argument
# Send a very large cookie to test for Cookies Of Unusual Size
curl -v --cookie "foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
variable "region" {}
variable "profile" {}
provider "aws" {
region = "${var.region}"
profile = "${var.profile}"
version = "~> 1.0"
}
@maguec
maguec / ssl_enumerate_sentinel_masters.py
Created May 9, 2019 17:04
Using python and ssl to get list of sentinel masters
import redis
'''
The Cert comes from /etc/opt/redislabs/proxy_cert.pem!
'''
try:
conn = redis.StrictRedis(
host='HOSTNAME',
import redis
'''
The Cert comes from /etc/opt/redislabs/proxy_cert.pem!
'''
redis_host = '1.2.3.4'
redis_port = 14873
redis_password = 'MyPassword'
@maguec
maguec / ip_range_lookup.py
Created December 18, 2019 19:13
Check to see if an IP address is in a range in Redis
#!/usr/bin/python3
import redis, ipaddress
r = redis.Redis(host='localhost', port=6379)
def ip2long(ip):
"""
Convert an IP string to long
"""
resource "aws_route53_resolver_endpoint" "re-dns-in-endpoint" {
name = "re-dns-in-endpoint"
direction = "INBOUND"
security_group_ids = [
module.nodes.re-security-group,
]
ip_address {
subnet_id = module.vpc.subnets-public[0]
package main
import (
b64 "encoding/base64"
"fmt"
"regexp"
"strings"
"time"
)
@maguec
maguec / load_wpoi.py
Created January 19, 2021 23:40
Load Data using the batch indexer example
#!/usr/bin/env python3
from redisearch import Client, TextField
import csv
client = Client('WPOI',
host='localhost',
password='',
port=6379
)