Skip to content

Instantly share code, notes, and snippets.

View kurtcebe's full-sized avatar

Kurtcebe Eroglu kurtcebe

  • Amsterdam, The Netherlands
View GitHub Profile
import java.io.UnsupportedEncodingException;
public class WasPasswordEncoder {
public static void main(String[] args) {
// Test
String password = "testpw123";
String encodedPassword = encode(password);
System.out.println("encoded pw: " + encodedPassword);
// check from http://www.sysman.nl/wasdecoder/getEncodedString.jsp?waspwd=testpw123
// shall be KzosKy8obm1s
@kurtcebe
kurtcebe / gist:858fc14fcb12cc713be1
Created December 10, 2014 08:11
Merge WAS trace files
cat `ls -rt trace*.log` >> trace_merged.log
tprof -skex sleep 60
# produces sleep.prof.
# take javacores during this interval
# correlate thread id from tprof (decimal) to javacore (hex) using following
echo "obase=16; <decimal_thread_id>" | bc
@kurtcebe
kurtcebe / list_thread_pool_utilization
Created September 13, 2013 23:10
[WAS] Lists all thread pools, current utilisation and maximum pool size as reported by PMI
def nameToDict(nameString):
stringList = nameString.split(',');
dict = {};
for part in stringList:
keyValueList = part.split('=');
dict[keyValueList[0]] = keyValueList[1];
return dict;
pools = AdminControl.queryNames("WebSphere:*,type=ThreadPool").split("\n");
@kurtcebe
kurtcebe / [was] set runtime traces
Created July 23, 2013 12:52
[WAS] wsadmin script for setting runtime traces on multiple servers
import sys
if len(sys.argv) < 1:
print 'please supply trace string as parameter'
sys.exit(1)
print 'tracestring is:' , sys.argv[0]
tsc = AdminControl.queryNames('WebSphere:type=TraceService,*').split("\n")
@kurtcebe
kurtcebe / [was] set startup traces
Created July 23, 2013 12:48
[WAS] wsadmin script for setting startup traces on multiple servers servers
import sys
if len(sys.argv) < 1:
print 'please supply trace string as parameter'
sys.exit(1)
print 'tracestring is:' , sys.argv[0]
traceservices = AdminConfig.list('TraceService').split('\n')
for ts in traceservices:
@kurtcebe
kurtcebe / svmon_servers.sh
Last active October 31, 2018 14:11
Scripts to determine memory usage in AIX boxes. I use there for monitoring Application Server processes (Java), to get a better idea about how much of the resources are utilized by servers. svmon, used like this, does not take into account memory used as file system buffer, so gives a better idea compared to topas.
# memory usage for all active processes
svmon -P
# same as above, one line for each process
svmon -P -O summary=basic,unit=MB
# Total memory used and total number of processes
svmon -P -O summary=basic,unit=KB | tail +4 | awk '// {total+=$3} END {print "total mem=",total/1024/1024," GB, n=",NR}'
# Total memory used and total number of processes for Java processes only
@kurtcebe
kurtcebe / AIX_networkCapture
Created July 19, 2013 11:36
How to capture network traffic to a particular host on a AIX box.
tcpdump -s 0 -w output.cap host target_host_name
@kurtcebe
kurtcebe / jarForClass.sh
Last active December 19, 2015 23:59
Script to find which jar file contains a given class, searching through jar files in a directory hierarchy.
#!/bin/bash
for i in `find . -name '*.jar'`; do jar -tf "$i" | grep $1 | xargs -I{} echo "$i : {}" ; done
# if 'jar' is not in the path, you may use 'unzip -l' instead of 'jar -tf'