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
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 $$; |
logging: | |
driver: "json-file" | |
options: | |
max-file: "20" | |
max-size: "100m" |
#!/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 |
#!/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" |
python -c 'import secrets,string; print("".join(secrets.choice(string.ascii_letters+string.digits) for i in range(34)))' |
update_config: | |
delay: 3m | |
parallelism: 1 | |
failure_action: rollback |
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
/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>
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)) |