Skip to content

Instantly share code, notes, and snippets.

View aelkz's full-sized avatar
👽
working hard

Raphael Abreu aelkz

👽
working hard
View GitHub Profile
@aelkz
aelkz / ParseHeapDump.sh
Created June 2, 2019 13:11 — forked from mrbuk/ParseHeapDump.sh
MAT headless mode
#!/bin/sh
#
# This script parses a heap dump.
#
# Usage: ParseHeapDump.sh <path/to/dump.hprof> [report]*
#
# The leak report has the id org.eclipse.mat.api:suspects
# The top component report has the id org.eclipse.mat.api:top_components
#
@aelkz
aelkz / troubleshooting-with-jcmd.md
Created May 31, 2019 13:47 — forked from noahlz/troubleshooting-with-jcmd.md
Troubleshooting Production JVMs with jcmd

Troubleshooting Production JVMs with jcmd

jcmd is a powerful new tool introduced in Java 7. Along with jstack and jps, it should be in your go-to tool for solving production problems on the JVM. (Come to think of it, with this tool you don't really need jps anymore)

Here's an example session with jcmd:

$ ssh wopr.qa.corp.local
$ jcmd -l
34739 sun.tools.jcmd.JCmd -l
import sys
import time
import logging
import random
from jaeger_client import Config
from opentracing_instrumentation.request_context import get_current_span, span_in_context
def init_tracer(service):
logging.getLogger('').handlers = []
logging.basicConfig(format='%(message)s', level=logging.DEBUG)
@aelkz
aelkz / IntelliJ IDEA - remote debugging.md
Last active March 23, 2019 01:27
intellij remote debugging (working with 183-5912.21)

REMOTE DEBUGGING USING INTELLIJ IDEA

1. Start your application server:

`./standalone.sh --debug``

You'll see something like the following output:

  JAVA_OPTS:  -server -verbose:gc -Xloggc:"/usr/local/devtools/rh-sso-7.2/standalone/log/gc.log" -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
@aelkz
aelkz / psensor-install-f28.sh
Created March 18, 2019 18:11 — forked from pgnunes/psensor-install-f28.sh
Install Psensor on Fedora 28
#/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "Please run this script as root"
exit 1
fi
dnf install -y gcc wget gtk3-devel GConf2-devel cppcheck libatasmart-devel libcurl-devel json-c-devel libmicrohttpd-devel help2man libnotify-devel libgtop2-devel make
wget -O /tmp/psensor-last-stable.tar.gz http://wpitchoune.net/psensor/files/psensor-last-stable.tar.gz
tar -xf /tmp/psensor-last-stable.tar.gz -C /tmp
rm -rf /tmp/psensor-last-stable.tar.gz
@aelkz
aelkz / setup-vmware-image-with-static-IP.markdown
Last active November 5, 2021 20:35
How to setup your VMWare Fusion 11.0.1 images to use static IP addresses on Mac OS X (working w/ Mojave 10.14) for use w/ CentOS 7 and RHEL 7

This tutorial is based on the following:
https://medium.com/upinatoms-com/sharing-a-network-between-your-vmware-fusion-linux-guest-and-your-mac-os-x-host-70d98271f142

How to setup your VMWare Fusion images to use static IP addresses on Mac OS X

Working w/ CentOS 7 and RHEL 7 linux images.

Therefore this configuration don't require any changes inside linux guest VM as it network interfaces will continue using BOOTPROTO=dhcp

1. Check your current configuration for "host-only" networking:

sudo vim /Library/Preferences/VMware\ Fusion/vmnet1/dhcpd.conf

@aelkz
aelkz / termux.md
Last active November 30, 2020 13:36
TERMUX development environment

TERMUX

ifconfig.co
ifconfig.me

ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'

Inside termux

apt update && apt upgrade
@aelkz
aelkz / openshift-recipes.sh
Created February 12, 2019 12:45
OC-RECIPES
export current_pod =
export current_project =
export current_application =
export current_cicd_project =
export current_template =
# show / explore all openshift resources
oc get all
# exame deployment configuration of a pod
@aelkz
aelkz / dnsmasq.md
Created February 3, 2019 03:04 — forked from tmslnz/dnsmasq.md
Setting up dnsmasq on OS X

Install dnsmasq

Via brew or other method

Set up DNS resolver order

In order to work on every connection and on any TLD, dnsmasq needs to be the first DNS resolver receving the query.

And since dnsmasq is a local process, all DNS queries need to go to 127.0.0.1

On macOS, /etc/resolv.conf is automaticaly created, depending on a variety of things (network settings, etc), so it cannot be edited.

@aelkz
aelkz / brew-instructions.sh
Created February 3, 2019 03:03 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache