Skip to content

Instantly share code, notes, and snippets.

@thspinto
thspinto / kafka_offset_reset.sh
Created June 16, 2020 22:31
Kafka batch reset offsets
#!/bin/bash
BOOTSTRAP_SERVER=kafka:9092
function reset_offsets() {
local GROUP=$1
local TOPIC=$2
kafka-consumer-groups.sh --bootstrap-server $BOOTSTRAP_SERVER --group $GROUP --topic $TOPIC --reset-offsets --to-latest --execute
}
function main () {
@thspinto
thspinto / add_all_org_repos_to_team.sh
Last active September 3, 2020 20:20
Github scripts
#!/bin/bash
team="teamname"
org="orgname"
repos=$(hub api orgs/$org/repos --paginate | jq -rc '.[] | select(.archived == false and .disabled == false) | .name')
IFS=$'\n'
for repo in $repos
do
echo "Adding $repo"
@thspinto
thspinto / kafkaCommands.md
Created May 10, 2018 14:58
Useful Kafka commands

kafka-topics --topic TestTopic --describe --zookeeper zk1:2181

@thspinto
thspinto / env-import
Last active August 3, 2017 00:04
Import dcos enviroment variables from aws instance tags
#!/bin/bash
if [ ! -f /opt/mesosphere/bin.quinto/aws ]; then
echo "Installing awscli"
# Install AWS CLI
/opt/mesosphere/bin/pip install awscli -t /opt/mesosphere/bin.quinto/
fi
tag="### Custom Envs ###"
tagline="$(grep -n "$tag" /opt/mesosphere/environment | cut -d : -f 1)"