-XX:NativeMemoryTracking=detail
jps
ps -p <PID> -o pcpu,rss,size,vsize
Mount Separately | |
---------------- | |
# mount nvme SSDs to /dataN when available for specific instance types | |
# There are only 4 nvme slots in r5 instances. /dev/nvme0n1 is root EBS volume. | |
for i in $(seq 1 4); do | |
if [ -e "/dev/nvme${i}n1" ] | |
then | |
echo "Mounting /dev/nvme${i}n1 to /data${i}" | |
sudo mkfs.ext4 -E nodiscard /dev/nvme${i}n1 | |
sudo mkdir -p /data${i} |
-- hot reload init.lua script | |
function reloadConfig(files) | |
doReload = false | |
for _,file in pairs(files) do | |
if file:sub(-4) == ".lua" then | |
doReload = true | |
end | |
end | |
if doReload then | |
hs.reload() |
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]). | |
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch. | |
Following are the changes that I made to make it work. | |
$ sudo apt-get update | |
$ sudo apt-get install lirc | |
# Add the following lines to /etc/modules file | |
lirc_dev | |
lirc_rpi gpio_in_pin=18 gpio_out_pin=17 |
# PDSH Usage | |
export PDSH_SSH_ARGS_APPEND="-q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/private.key" | |
pdsh -R ssh -w ^slaves.txt | |
# parallel-ssh Usage | |
parallel-ssh -x "-oStrictHostKeyChecking=no -i ~/.ssh/private.key" -i -h slaves.txt "sudo -u root jps | grep "LlapDaemon" | cut -f1 -d' '" | |
# remote heap-dump | |
# Add the following contents to jcmds.sh and use parallel-scp to copy the script to all hosts | |
#!/bin/bash |
{{ $all := . }} | |
{{ $servers := .Servers }} | |
{{ $cfg := .Cfg }} | |
{{ $IsIPV6Enabled := .IsIPV6Enabled }} | |
{{ $healthzURI := .HealthzURI }} | |
{{ $backends := .Backends }} | |
{{ $proxyHeaders := .ProxySetHeaders }} | |
{{ $addHeaders := .AddHeaders }} | |
# Configuration checksum: {{ $all.Cfg.Checksum }} |
chrome.tabs.query({'active': true, 'lastFocusedWindow': true, 'currentWindow': true}, function (tabs) { | |
var url = tabs[0].url; | |
console.log(url); | |
}); |
apt-get update | |
apt-get install -y python curl vim | |
curl -O https://bootstrap.pypa.io/get-pip.py | |
export PATH=~/.local/bin:$PATH | |
python get-pip.py --user | |
pip install awscli --upgrade --user | |
mkdir -p ~/.aws | |
vim ~/.aws/config | |
[default] |
set vpn_name to "'VPN_NAME'" | |
tell application "System Events" | |
set rc to do shell script "scutil --nc status " & vpn_name | |
if rc starts with "Connected" then | |
do shell script "scutil --nc stop " & vpn_name | |
else | |
-- get current clipboard contents as a string | |
set CurrentClipboard to the clipboard as string | |
Download Eclipse MAT from https://www.eclipse.org/mat/ | |
Change Xmx depending on heap dump size being analyzed in ini file. If GC errors are observed then add -XX:-UseGCOverheadLimit option too | |
vim ~/home/pkgs/mat/MemoryAnalyzer.ini | |
~/home/pkgs/mat/ParseHeapDump.sh heapdump.hprof |