Skip to content

Instantly share code, notes, and snippets.

@cyberjso
cyberjso / install-ansible-centos.sh
Created June 29, 2020 20:49
Steps to install ansible on Centos
sudo yum install -y python3 -y
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py --user
pip install ansible --user
@cyberjso
cyberjso / check-topic-lag.sh
Created January 7, 2020 13:01
Check Lag of a given kafka topic
#!/bin/bash
./bin/kafka-consumer-groups.sh \
--bootstrap-server localhost:9092 \
--describe --group group-name
@cyberjso
cyberjso / check-topic-lag.sh
Created January 7, 2020 13:01
Check Lag of a given kafka topic
#!/bin/bash
./bin/kafka-consumer-groups.sh \
--bootstrap-server localhost:9092 \
--describe --group group-name
@cyberjso
cyberjso / check-topic-size.sh
Last active January 7, 2020 12:59
how to count number for messages on on given kafka topic
#!/bin/bash
bin/kafka-run-class.sh kafka.tools.GetOffsetShell \
--broker-list localhost:9092
-topic topic-name
@cyberjso
cyberjso / prometheus-setup.sh
Created December 5, 2019 13:18
Scripts for prometheus setups
wget https://github.com/prometheus/prometheus/releases/download/v2.14.0/prometheus-2.14.0.linux-amd64.tar.gz
tar -xvf prometheus-2.14.0.linux-amd64.tar.gz
@cyberjso
cyberjso / telemetry.sh
Created November 23, 2019 17:18
Install VictoriaMetrics, Grafana and telegraf for metrics ingestion
wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.29.4/victoria-metrics-v1.29.4.tar.gz
sudo mkdir $storage_dir
tar -zxvf victoria-metrics-v1.29.4.tar.gz
rm victoria-metrics-v1.29.4.tar.gz
sudo ./victoria-metrics-prod -httpListenAddr=:80
@cyberjso
cyberjso / postgres-db-size.sql
Created November 19, 2019 16:24
Show the size of a given postgres database
select db_name,pg_database_size(db_name) database_size, pg_size_pretty(pg_database_size(db_name)) as database_size_pretty from
(select datname as db_name, pg_database_size(datname) from pg_database
where datname <>'rdsadmin') x
order by database_size
@cyberjso
cyberjso / .net-frameworkds.MD
Last active August 20, 2019 10:56
List of interesting components to run .net microserivces.
@cyberjso
cyberjso / gist:960763d3d6500dbc5bc3968bce05eb94
Last active August 14, 2019 18:01
C# and JVM interapoerability solutions
1) http://lampwww.epfl.ch: Convert scala code to run on .NET.
2) Glossary to understand the terms: https://docs.microsoft.com/en-us/dotnet/standard/glossary
3) ikvm not compatible with .netcore
3.1) https://github.com/wwrd/ikvm8/issues/3
3.2) https://github.com/KevM/tikaondotnet/issues/75
@cyberjso
cyberjso / instal-dot-net-core.sh
Last active August 4, 2019 23:13
Install .net core on ubuntu
#!/bin/bash
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-2.2