Skip to content

Instantly share code, notes, and snippets.

@mkRuby009
mkRuby009 / chain.json
Created June 21, 2023 09:13
test-core-2 chain registry
{
"$schema": "../chain.schema.json",
"chain_name": "persistencetestnet2",
"chain_id": "test-core-2",
"pretty_name": "Persistence Testnet",
"status": "live",
"network_type": "testnet",
"website": "https://persistence.one/",
"bech32_prefix": "persistence",
"daemon_name": "persistenceCore",
@mkRuby009
mkRuby009 / postgres-cheatsheet.md
Created March 28, 2023 11:17 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@mkRuby009
mkRuby009 / ObjectHeader32.txt
Created August 1, 2020 09:51 — forked from arturmkrtchyan/ObjectHeader32.txt
Java Object Header
|----------------------------------------------------------------------------------------|--------------------|
| Object Header (64 bits) | State |
|-------------------------------------------------------|--------------------------------|--------------------|
| Mark Word (32 bits) | Klass Word (32 bits) | |
|-------------------------------------------------------|--------------------------------|--------------------|
| identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal |
|-------------------------------------------------------|--------------------------------|--------------------|
| thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased |
|-------------------------------------------------------|--------------------------------|--------------------|
|
@mkRuby009
mkRuby009 / native-mem-tracking.md
Created July 18, 2020 07:05 — forked from prasanthj/native-mem-tracking.md
Native memory tracking in JVM

Enable native memory tracking in JVM by specifying the following flag

-XX:NativeMemoryTracking=detail

Know the <PID> of the java process

jps

To print ps based RSS

ps -p <PID> -o pcpu,rss,size,vsize

To print native memory tracking summary

@mkRuby009
mkRuby009 / ClassLoaderLeakExample.java
Created June 7, 2020 07:20 — forked from dpryden/ClassLoaderLeakExample.java
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,