Skip to content

Instantly share code, notes, and snippets.

@johnseekins
johnseekins / proof.md
Created December 23, 2023 18:18
proof.md

$argon2id$v=19$m=512,t=256,p=1$J+Ahj0kCcBnA79zlyTtRFw$k0z+vi3mIdYTYaL5OT+h5Hac/u/802P13G9ls0Ct6zE

@johnseekins
johnseekins / download_geo_files.py
Last active January 13, 2023 15:59
Download division-level geo json files from OpenStates
#!/usr/bin/env python3
from datetime import datetime
import os
import requests
os_session = requests.Session()
os_session.headers.update(
{"Accept": "application/json", "X-Api-Key": os.environ["OPENSTATES_API_KEY"]}
#!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import logging
import re
from urllib.request import urlopen, Request
logger = logging.getLogger("wttr.in")
logger.addHandler(logging.StreamHandler())
@johnseekins
johnseekins / README.md
Last active October 19, 2020 22:13 — forked from ktmud/README.md
Enable Okta Login for Superset

This Gist demonstrates how to enable Okta/OpenID Connect login for Superset (and with slight modifications, other Flask-Appbuilder apps).

All you need to do is to update superset_config.py as following and make sure your Cliend ID (OKTA_KEY) and Secret (OKTA_SECRET) are put into the env.

#!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import json
import logging
from OpenSSL import crypto
import os
import pem
from pprint import pformat
import time
{
"xhrStatus": "complete",
"request": {
"method": "POST",
"url": "api/datasources/proxy/3/api/query",
"data": {
"start": 1537436672829,
"queries": [
{
"metric": "cpu.usr",
@johnseekins
johnseekins / Auth failure
Last active June 18, 2018 22:31
ACL File
INFO RuleEvaluator: Evaluating Decision for: res<kind:node, type:resource> subject<Username:testjseekins Group:rundeck_user Group:rundeck_ops_qa_user Group:user> action<read> env<rundeck:auth:env:project:OperationsEnvironment>: authorized: false: No context matches subject or environment => REJECTED_NO_SUBJECT_OR_ENV_FOUND (0ms)
INFO RuleEvaluator: Evaluating Decision for: res<kind:node, type:resource> subject<Username:testjseekins Group:rundeck_user Group:rundeck_ops_qa_user Group:user> action<read> env<rundeck:auth:env:project:OperationsEnvironment>: authorized: false: No context matches subject or environment => REJECTED_NO_SUBJECT_OR_ENV_FOUND (0ms)
INFO RuleEvaluator: Evaluating Decision for: res<kind:node, type:resource> subject<Username:testjseekins Group:rundeck_user Group:rundeck_ops_qa_user Group:user> action<read> env<rundeck:auth:env:project:OperationsEnvironment>: authorized: false: No context matches subject or environment => REJECTED_NO_SUBJECT_OR_ENV_FOUND (0ms)
INFO RuleEvaluator: Eval
INFO requests: [uri:/user/error, duration:67, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0, authToken:form, method:GET, secure:https, contentType:null, project:?]
INFO requests: [uri:/user/error, duration:67, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0, authToken:form, method:GET, secure:https, contentType:null, project:?]
DEBUG MemoryPageFragmentCachingFilter: No cacheable annotation found for GET:/grails/user/login.dispatch [controller=user, action=login]
INFO requests: [uri:/user/login, duration:2, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0, authToken:form, method:GET, secure:https, contentType:null, project:?]
INFO requests: [uri:/user/login, duration:2, remoteUser:null, remoteHost:172.19.250.77, userAgent:Mozilla/5.0 (X11; Fedora; Linux x86_64; rv
[root@ops-freeipa-devops-1 jseekins]# certutil -L -d /etc/httpd/alias/
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
CN=Master,L=Bozeman,ST=Montana,C=US C,,
CN=ops-freeipa-devops-1.dm.lan,L=Bozeman,ST=Montana,C=US Cu,u,u
DM.LAN CT,C,C
[root@ops-freeipa-devops-1 jseekins]# ipa-certupdate
@johnseekins
johnseekins / rebalance_brokers.sh
Last active January 17, 2019 20:23
Automatic Kafka Topic Re-balancing
#!/bin/bash
if [[ -z "${1}" ]]; then
THROTTLE=100000
else
THROTTLE="${1}"
fi
set -eou pipefail
KAFKABIN=${KAFKABIN:-/opt/kafka/bin}