Skip to content

Instantly share code, notes, and snippets.

View yolabingo's full-sized avatar

Todd Jacobsen yolabingo

  • New Mexico, USA
View GitHub Profile

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

delete unassigned shards

@yolabingo
yolabingo / docker-compose-logging.yml
Last active January 7, 2022 04:05
docker-compose log file max size
   logging:
     driver: "json-file"
     options:
         max-file: "20"
         max-size: "100m"
@yolabingo
yolabingo / acm_search_certs.py
Last active February 11, 2022 00:57
list and simple search of AWS Certificate Manager SSL certs using python and boto3
#!/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
@yolabingo
yolabingo / how-to-build-debian-kernel.md
Last active March 5, 2022 17:24
Build debian kernel from source

Want a cool new kernel feature but it won't show up in Debian for years?

make deb-pkg makes it easy to install a custom Linux kernel from source.

as root/sudo:

apt install build-essential libncurses5-dev gcc libssl-dev bc bison flex rsync libelf-dev
mkdir /usr/local/src/kernel
chown nonrootuser /usr/local/src/kernel
su - nonrootuser
@yolabingo
yolabingo / osx_limits.md
Created June 24, 2022 20:42
OS X increase max files procs Monterey 12.4

/Library/LaunchDaemons/limit.maxfiles.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
@yolabingo
yolabingo / urljoin.py
Created September 1, 2022 01:52
python - join url fragments
def urljoin(*args):
""" Joins given arguments into an url, removing extra slashes """
return "/".join(map(lambda x: x.rstrip('/') if x.startswith('//') else x.strip('/'), args))
@yolabingo
yolabingo / xcode.md
Created October 13, 2022 17:48
xcode bullshit
@yolabingo
yolabingo / gist:afaf95b6ec24d1ecc2bc4efdb9c8adc5
Created October 18, 2022 02:24
quick and dirty react graphql
'use strict';
var query = `query PageRender { page(url: "/index") { url friendlyName } }`;
const e = React.createElement;
class EmptyElement extends React.Component {
constructor(props) {
super(props);
}
render() {
fetch('https://demo.dotcms.com/api/v1/graphql', {
method: 'POST',
@yolabingo
yolabingo / sdm-completion.bash
Last active November 4, 2022 20:49
strongDM bash completion of hostnames for "sdm ssh [hostname]"
#/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
python -c 'import secrets,string; print("".join(secrets.choice(string.ascii_letters+string.digits) for i in range(34)))'