- Follow the original instructions at
- See more at
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def r(new_value, old_values): | |
if len(old_values) > 10: | |
old_values.pop(0) | |
old_values.append(new_value) | |
average = sum(old_values) / len(old_values) | |
return average, old_values | |
history = [] | |
for i in range(100): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use jq to read the terraform state file | |
# all id's | |
jq '.resources[].instances[].attributes.id?' terraform.tfstate | |
# all display names | |
jq '.resources[].instances[].attributes.display_name?' terraform.tfstate | |
# all environment id's | |
jq '.resources[].instances[].attributes.environment[]?.id' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Cloudflare as Dynamic DNS | |
# From: https://letswp.io/cloudflare-as-dynamic-dns-raspberry-pi/ | |
# Based on: https://gist.github.com/benkulbertis/fff10759c2391b6618dd/ | |
# Original non-RPi article: https://phillymesh.net/2016/02/23/setting-up-dynamic-dns-for-your-registered-domain-through-cloudflare/ | |
# Update these with real values | |
auth_email="email@example.com" | |
auth_key="global_api_key_goes_here" | |
zone_name="example.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine | |
# Used to provide DDNS service for my home | |
# Needs the DNS record pre-creating on Cloudflare | |
# Proxy - uncomment and provide details if using a proxy | |
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport> | |
# Cloudflare zone is the zone which holds the record |
Grab a copy of Docker for your platform here: https://www.docker.com/community-edition#/download Follow the installation guide and tune the docker system to run with as much memory and CPU as you're willing to feed to it.
Local Debian instance: debian:latest
Metasploit: remnux/metasploit
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups
command.
- List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe
Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.
- Reset the consumer offset for a topic (preview)
bonus tip: for more darkness > https://darkreader.org/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a directory | |
mkdir ~/tmux-install | |
cd ~/tmux-install | |
# Get the files | |
curl -OL https://www.openssl.org/source/openssl-1.0.2l.tar.gz | |
curl -OL https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz | |
curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz | |
# Extract them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#DOCKER_REGISTRY_URI=_DOCKER_REGISTRY_URI_ | |
#DOCKER_REGISTRY_USER=_DOCKER_REGISTRY_USER_ | |
#DOCKER_REGISTRY_PASS=_DOCKER_REGISTRY_PASS_ | |
expect <<EOF | |
spawn docker login -u $DOCKER_REGISTRY_USER $DOCKER_REGISTRY_URI | |
while (1) { | |
expect { |
NewerOlder