Useful Commands & Tools


# Local Linux install

# Export measurement to line protocol

$ sudo influxd inspect export-lp --bucket-id <id> --engine-path /var/lib/influxdb/engine/ --measurement <name> --output-path <path-to-file>

# import measurement from line protocol

$ sudo influx write --org <org> -b <bucket> -f <path-to-file> --token $INFLUX_TOKEN

# delete measurements

$ sudo influx delete --org <org> --bucket <bucket> --start '1970-01-01T00:00:00Z' --stop $(date +"%Y-%m-%dT%H:%M:%SZ") --predicate '_measurement="<name>"' --token $INFLUX_TOKEN

# run v1 client

$ influx v1 shell

# backup

$ influx backup <target dir> -t $INFLUX_TOKEN

# list retention policies

$ influx v1 dbrp list

# create default retention policy

$ influx v1 dbrp create --db <db> --rp autogen --bucket-id <bucketid> --token $INFLUX_TOKEN


Web page timings from Windows Powershell:

Powershell version
PS > $PSVersionTable

Show current user certificate thumbprints
PS > get-ChildItem Cert:\CurrentUser\My

Set Tls version
PS > [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Measure page download time
PS > Measure-Command {Invoke-WebRequest -Uri "https://<>" -CertificateThumbprint ""}


Example curl request below prints out details about the timing and size of the request. Further details and options can be found on the man page for curl here:

$ curl -s -o /dev/null --cert <pem> --key <pem> --insecure -k "url" -w "URL=%{url_effective} RTT=%{time_total} SIZE=%{size_download} TTFB=%{time_starttransfer} CODE=%{http_code} DNS=%{time_namelookup} CONNECT=%{time_connect} appconnect=%{time_appconnect}\n"


A number of useful tools, but very useful for debugging and tracing socket streams used by chrome. Further details can be found here:


Linux monitoring with Excel macro for creating a spreadsheet or nmonchart for creating an html report. For more information see here:


# clone a repository

git clone <repository>

# checkout and track remote branch

git branch -a

# git checkout -b <feature-name> origin/<feature-name>

git status

git add .

git commit -m "commit message"

git push

# If feature branch is behind remote main, update local main and use rebase to preserve history.

git checkout main

git pull

git checkout <feature-name>

git rebase main

# If there are merge conflicts on added/removed files correct this using

git add/rm <filename>

# If there are merge conflicts on changed files, edit the file and remove the unwanted changes and conflict markers. Then add the updated file

git add <filename>

git rebase --continue

# Edit local git config on linux

git config --global --edit


keys *

type <key>

lrange <key> <start> <end>

del key



type <key>

delete all keys from a redis instance: 

redis-cli keys "*" | xargs -I {} redis-cli del {}


# Print command line flags available for the JVM (

java -XX:+PrintFlagsFinal

# Print ergonomically selected flags for the JVM that appeared on the command line

java -XX:+PrintCommandLineFlags

# Java17 - show the cgroup version, cpu and memory limits.

java -XshowSettings:system


# Print options

jcmd <pid>

# Get flags that can be set using jcmd

jcmd <pid> VM.flags -all | grep manageable

# Set flag

jcmd <pid> VM.set_flag <flag> <value>


# create heap dump of all objects in binary format

jmap -dump:format=b,file=/tmp/dump.hprof <pid>

Java Flight Recorder

Java flight recorder can be used for profiling a JVM with claimed low overhead. This is particularly useful as it can be used for looking at an already running JVM without having to enable command line options for the running application. JFR can provide useful information on e.g. heap use and object counts, GC activity and pause time, socket i/o, thread locking. For further information please see documentation here:

# Example commands to start JFR using jcmd are shown below.

jcmd <pid> JFR.start duration=60s

jcmd JFR.check

# Unless a filename is specified the default directory data is written to is /tmp.
# By default jfr will chunk up a recording in to separate files. To re-combine these into a single # file for analysis run:

jfr assemble <directory> output-file-name.jfr


# create a jks from pfx
# e.g. from chrome export certificate with all certificates in the chain and include private key

keytool.exe -importkeystore -srckeystore "<name.pfx" -srcstoretype pkcs12 -destkeystore "<name>.jks"


Container resource monitoring tool. This is very useful as can be run as a standalone binary with an HTTP UI with minimal install.


# display cpu by thread for a process

top -H -p <pid>

# sample processes every second, for 30 seconds and output to a file 

top -d 1 -n 30 -b > top-output-processes.txt

# sample threads for a processes every 100ms, for 30 seconds and output to a file 

top -H -p <pid> -d 0.1 -n 300 -b > top-output-threads-100ms.txt

# get the average running thread count for a process in a thread sample (e.g. above)

grep Threads top-output-threads-100ms.txt | tail -299 | tr -s ' ' | cut -d' ' -f4 | awk '{total += $1; n++}END{print total, total/n}'


A debug and administrative client for interacting with the containerd daemon

$ for i in ctr --namespace ls | grep <name> | cut -d' ' -f1;
ctr --namespace task ist | grep $i;

e.g. a087b8b5e433f80114dc5104f818d1a183af48bdb23774f0e28f9ee4b43ab5ae 4976 RUNNING

Load Average


0.29 0.17 0.15 1/586 249213


show dbs

use <db>




rabbitmq-diagnostics status

rabbitmqctl list_queues