Skip to content

Instantly share code, notes, and snippets.

View skyrocknroll's full-sized avatar

Yuvaraj L skyrocknroll

View GitHub Profile
@skyrocknroll
skyrocknroll / jolokia.md
Last active February 20, 2020 19:13
[Jolokia JVM Metrics] #jolokia #jvm #metrics
  • java -javaagent:jolokia-jvm-1.6.0-agent.jar=port=8888,host=0.0.0.0 -jar target/in.hack4geek.sppring2-1.0-SNAPSHOT.jar
  • java -jar jolokia-jvm-1.6.0-agent.jar start <pid/regex> for already running process
  • http://localhost:8778/jolokia/read/java.lang:type=Threading/ThreadCount
  • Use visualVM or JvisulaVM to get the list of Mbeans.
  • Mbean with value http://localhost:8778/jolokia/read/java.lang:name=MarkSweepCompact,type=GarbageCollector
  • The order matters java.lang:name=MarkSweepCompact,type=GarbageCollector if you try this java.lang:type=GarbageCollector,name=MarkSweepCompact this fails
  • curl "http://localhost:8778/jolokia/read/java.lang:name=MarkSweepCompact,type=GarbageCollector/LastGcInfo/memoryUsageBeforeGc" | jq
@skyrocknroll
skyrocknroll / Vagrantfile
Last active November 13, 2019 07:19
[Vagrant] #vagrant #multimachine
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
BOX_IMAGE = "ubuntu/xenial64"
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
@skyrocknroll
skyrocknroll / influxdb.md
Last active October 24, 2023 13:47
[Influxdb Cardinality Debug] #influxdb
  • SHOW TAG VALUES EXACT CARDINALITY WITH KEY = "index";
  • SHOW SERIES CARDINALITY group by "measurement"; → Important useful one.
  • influxdata/influxdb#8636 → Good examples are here
  • influx_inspect report -detailed /var/lib/influxdb/data/envoy/autogen/903 The best way to ficure out high cardinality series.
  • figure out series in each database use _internal ; select * from "database" where time > now() - 900s limit 10; Faced this error ERR: cannot delete data. DB contains shards using both inmem and tsi1 indexes. Please convert all shards to use the same index type to delete data.
find /var/lib/influxdb -type d -name index | while read index; do rm -Rf "$index" ; done
influx_inspect buildtsi -database envoy -datadir /var/lib/influxdb/data/ -waldir /var/lib/influxdb/wal
@skyrocknroll
skyrocknroll / opencensus-prometheus.java
Created August 4, 2018 08:30
opencensus prometheus java stats exporter
package io.opencensus.quickstart;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@skyrocknroll
skyrocknroll / docker-all.sh
Created July 12, 2018 17:53
docker nomad exec all containers
#!/bin/bash
containers=$(docker ps -q)
for item in $containers
do
echo $item
echo $1
docker exec $item netstat -tapln | grep :26379 | wc -l
done
@skyrocknroll
skyrocknroll / helpful-docker-commands.sh
Created July 12, 2018 17:40 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@skyrocknroll
skyrocknroll / mac.md
Last active April 10, 2018 17:18
sucking adventure into mac
  • Iterm2
  • Clipy
  • liquidprompt
  • devd
  • ngrok
  • secure pipe
  • https://github.com/dvorka/hstr
  • Install bash because mac ships with very old bash
  • Modify Iterm to start with /usr/local/bin/bash
  • Modify the f1 keys
@skyrocknroll
skyrocknroll / grok.md
Last active April 3, 2018 06:53
logstash grok envoy
    beats {
        host => "0.0.0.0"
        port => "5044"
    }
}

filter {
   if [fields][log_producer] == "envoy" {
 grok {
@skyrocknroll
skyrocknroll / sysctl.conf
Created March 14, 2018 14:02 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@skyrocknroll
skyrocknroll / docker.md
Last active February 23, 2018 08:20
docker image get all tags

curl -L -s 'https://registry.hub.docker.com/v2/repositories/envoyproxy/envoy/tags?page_size=100&amp;page=4'|jq '."results"[]["name"]'