Skip to content

Instantly share code, notes, and snippets.

@thikade
thikade / OQL.md
Last active December 6, 2016 15:06
Eclipse MAT OQL Scratchpad

Get all Subjects and the count of principals contained:

SELECT s.principals, toString(s.principals.c.elements.first.item.username) AS WAS_UserName, toString(s.principals.c.elements.first.item.name) AS Username, s.principals.c.elements.size AS PrincipalCount FROM javax.security.auth.Subject s

@thikade
thikade / httrack
Created October 20, 2016 12:37
httrack cmd line hintsheet
# Mirror
httrack.exe http://127.0.0.1:8080/index.html -O c:\websites --single-log --robots=0 --sockets=1 --timeout=3 --connection-per-second=1000 --mirror
# Update Mirror
httrack.exe http://127.0.0.1:8080/index.html -O c:\websites --single-log --robots=0 --sockets=1 --timeout=3 --connection-per-second=1000 --update
- set level of concurrency by: --sockets=N
- rate limit by: --connection-per-second=N
@thikade
thikade / gist:4f8ac124b03e84f6962327e29bb96701
Created October 19, 2016 07:38
set Terminal window title from cmd line
perl -e 'print("\e]0;@ARGV\7");' $HOSTNAME

Keybase proof

I hereby claim:

  • I am thikade on github.
  • I am thikade (https://keybase.io/thikade) on keybase.
  • I have a public key ASB6-F_8FoNtOtrfmJzbDZMdj1iIi7-imeiBYuZwvcQ-vAo

To claim this, I am signing this object:

# set WLP Home dir
WLP_HOME=C:\wlp
# path to server cmd
WLP_CMD=%WLP_HOME%\bin\server
# loop over "server list" output to get all defined Liberty servers,
# then execute "server status" for each server
# The first line reads `The following servers are defined..` and will be ignored.
for /f "tokens=1" %G in ('%WLP_CMD% list ^|findstr /v "^The"') DO %WLP_CMD% status %G
@thikade
thikade / Git & Docker cmd aliases
Last active July 2, 2020 12:00
Docker hints & shortcuts
export HISTSIZE=50000; export HISTFILESIZE=50000
alias ll="ls -al"
alias git="git -c http.sslVerify=false "
alias gitc='git -c http.sslVerify=false'
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gco='git checkout'
@thikade
thikade / pom.xml
Created June 1, 2016 15:04
How to resolve IBM Liberty dependency in Maven
<!-- The problem was maven was only looking at the central repository. To add IBM's repository, you need the following in your POM: -->
<repositories>
<repository>
<id>Liberty</id>
<name>Liberty Repository</name>
<url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
</repository>
</repositories>
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
@thikade
thikade / was_headers_http.conf.
Created December 5, 2015 10:21
WAS headers with mod_proxy
# ===================================================================================
# SET WAS specific headers
# ===================================================================================
ProxyPreserveHost On
# for handling DNS aliases use env variables derived from 'Host' HTTP header
SetEnvIf Host ^host1 HOST1
SetEnvIf Host ^host2 HOST2
RequestHeader set $WSSN host1 env=HOST1
RequestHeader set $WSSN host2 env=HOST2
RequestHeader set $WSSP 80
@thikade
thikade / hintsheet
Created November 21, 2015 20:08
Chrome Config Hintsheet
chrome://net-internals/#hsts