bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
All these are already installed on epyc.
kafkacat
(conda install -c conda-forge kafkacat
)
kt
(grab it from https://github.com/fgeller/kt/releases)
kafka-*
(come with kafka, if you yum install
if from Confluent's repo, or via Docker if you're so inclined). Warning -- JVM based and dreadfully slow.
jq
(conda install -c conda-forge jq
or use your favorite package manager)
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
# UPDATED 17 February 2019 | |
# Redirect all HTTP traffic to HTTPS | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name www.domain.com domain.com; | |
return 301 https://$host$request_uri; | |
} | |
# SSL configuration |
aws s3api put-bucket-versioning \
--bucket bucket \
--versioning-configuration '{"MFADelete":"Enabled","Status":"Enabled"}' \
--mfa 'arn:aws:iam::aws_account_id:mfa/root-account-mfa-device passcode'
aws s3api get-bucket-versioning --bucket bucket
#place in /etc/letsencrypt/renewal-hooks/post | |
export AWS_ACCESS_KEY_ID=XXX | |
export AWS_SECRET_ACCESS_KEY=XXX | |
#certs must be in us-east-1 to use with cloudfront | |
export AWS_DEFAULT_REGION=us-east-1 | |
#run without --certificate-arn first time then specify arn for updates | |
aws acm import-certificate --certificate file:///etc/letsencrypt/live/site.com/cert.pem --private-key file:///etc/letsencrypt/live/site.com/privkey.pem --certificate-chain file:///etc/letsencrypt/live/site.com/chain.pem --certificate-arn specifyarnforupdate |
#!/usr/bin/env python | |
# Prereq: PyCrypto | |
# Validation: https://www.samltool.com/decrypt.php | |
# Usage: ./decrypt_saml_response.py --key PRIVATE_KEY --pretty-print RESPONSE_XML | |
import sys | |
import optparse | |
import base64 |
javascript:!function(){var n,e,r,i;n=window,e=document.body,r=JSON.parse,i=JSON.stringify,n.isf||(e.innerHTML="<pre>"+i(r(e.innerText),null,4).replace(/\"(.*)[^\:]\:/g,'<span style="color:#9C3636">$1:</span>')+"</pre>",n.isf=!0)}(); | |
//usage: | |
//save as bookmark and click it whenever you open a json response in a browser tab/window |