curl -k --user admin:PASS https://prod-es1:9200
/_cluster/health?pretty
/_cat/nodes?pretty
/_cluster/health?level=indices&pretty
/_cluster/health?level=shards&pretty
python -c 'import secrets,string; print("".join(secrets.choice(string.ascii_letters+string.digits) for i in range(34)))' |
#!/usr/bin/env bash | |
# https://gist.github.com/yolabingo/f11e81b2cbdb00fff9b1ae0ef8076263 | |
# checks out dotcms/core GH repo, then prints the CUSTOM_STARTER_URL for demo site content | |
# for each tagged version release | |
# output formatted for docker-compose.yml | |
if ! which git > /dev/null | |
then | |
echo "'git' must be installed to run this script" |
#!/usr/bin/env python3 | |
""" | |
usage: acm_search_certs.py [-h] [--region REGION] [--san-names SAN_NAMES] [--identifiers IDENTIFIERS] | |
[--tags TAGS] [--issuers ISSUERS] [--cert-in-use {0,1}] [--json] [--and-filters] | |
Fetches ACM SSL certificates. | |
options: | |
-h, --help show this help message and exit |
logging: | |
driver: "json-file" | |
options: | |
max-file: "20" | |
max-size: "100m" |
DO $$ DECLARE | |
r RECORD; | |
BEGIN | |
-- if the schema you operate on is not "current", you will want to | |
-- replace current_schema() in query with 'schematodeletetablesfrom' | |
-- *and* update the generate 'DROP...' accordingly. | |
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP | |
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE'; | |
END LOOP; | |
END $$; |
General OpenSSL Commands
Generate a new private key and Certificate Signing Request
openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
Generate a self-signed certificate (see How to Create and Install an Apache Self Signed Certificate for more info)
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt
sudo yum install -y python3-devel gcc docker | |
sudo useradd -m -G docker -s /bin/bash docker | |
sudo su - docker | |
python3 -m venv python3-env | |
source python3-env/bin/activate | |
# or export PATH=$HOME/python3-env/bin:$PATH and add to .bash_profile | |
# upgrade pip first else you may get rust errors while building docker-compose | |
pip install --upgrade pip | |
pip install docker-compose |
#/usr/bin/env bash | |
# fetch server hostnames from `sdm status` to use as completions for `sdm ssh [hostname]` | |
# save the sdm status to a local file from a cron job to speed this up a lot: | |
# sdm status --filter 'TYPE:ssh*' | tail -n +2 | awk '{print $1}' | sort -u > /var/tmp/sdm-status | |
# h/t https://iridakos.com/programming/2018/03/01/bash-programmable-completion-tutorial | |
update_frequency=4h | |
compwords_file=/var/tmp/sdm-status |
""" | |
A simple proxy server, based on original by gear11: | |
https://gist.github.com/gear11/8006132 | |
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough. | |
Usage: http://hostname:port/p/(URL to be proxied, minus protocol) | |
For example: http://localhost:5000/p/www.google.com | |
""" | |
import re |