Skip to content

Instantly share code, notes, and snippets.

View chrishantha's full-sized avatar

M. Isuru Tharanga Chrishantha Perera chrishantha

View GitHub Profile
@chrishantha
chrishantha / powerline-isuru.omp.json
Last active May 6, 2022 06:30
Powerline posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "root",
"style": "plain",
#!/bin/bash
# Copyright 2018 M. Isuru Tharanga Chrishantha Perera
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@chrishantha
chrishantha / summary.csv
Last active January 18, 2018 11:24
AWS Lambda Java Invocations via AWS Gateway - Results - Summary
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 22 columns, instead of 3. in line 4.
Function Name,Memory (MB),Label,Elapsed Time (ms),Elapsed Time (ms),Elapsed Time (ms),Calculated Time (ms),AWS Duration from CloudWatch logs (ms),AWS Duration from CloudWatch logs (ms),AWS Duration from CloudWatch logs (ms),Connect Time (ms),Connect Time (ms),Connect Time (ms),VM Startup Time (ms),VM Startup Time (ms),VM Startup Time (ms),Handler Init Time (ms),Handler Init Time (ms),Handler Init Time (ms),Request Processing Time (ms),Request Processing Time (ms),Request Processing Time (ms)
,,,Average,Min,Max,,Average,Min,Max,Average,Min,Max,Average,Min,Max,Average,Min,Max,Average,Min,Max
BallerinaHelloWorld,192,First Request,"9,867.71","9,352.00","10,752.00","8,478.43","1,330.55",921.96,"2,006.85","1,015.43",747.00,"1,900.00",515.50,410.00,655.00,"5,708.75","5,423.00","5,990.00","1,238.75",999.00,"1,697.00"
BallerinaHelloWorld,192,Subsequent Requests,498.06,300.00,"1,954.00",5.19,7.78,1.34,21.62,0.00,0.00,0.00,515.50,410.00,655.00,"5,708.75","5,423.00","5,990.00",5.19,0.00,20.00
JavaHelloWorld,192,First Req
@chrishantha
chrishantha / apim_start.sh
Last active May 2, 2017 10:32
Test Script to run JMeter with multiple concurrent users
#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_121
if pgrep -f "carbon" > /dev/null; then
echo "Shutting down APIM"
/home/ubuntu/apim-product/wso2am-2.1.0/bin/wso2server.sh stop
sleep 30
fi
log_files=(/home/ubuntu/apim-product/wso2am-2.1.0/repository/logs/*)
if [ ${#log_files[@]} -gt 1 ]; then
@chrishantha
chrishantha / metrics_jmx_operations.js
Created December 2, 2015 05:56
A script to invoke JMX operations on Metrics Manager MBean in a WSO2 Server
/*
* Copyright 2015 WSO2 Inc. (http://wso2.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@chrishantha
chrishantha / .bashrc
Last active July 4, 2021 07:01
My .bashrc
# Set dircolors
# https://github.com/microsoft/WSL/issues/2343
LS_COLORS=$LS_COLORS':tw=01;36'
LS_COLORS=$LS_COLORS':ow=01;36'
export LS_COLORS
export JAVA_HOME=/usr/lib/jvm/jdk8u275-b01
export PATH=$PATH:$JAVA_HOME/bin
export M2_HOME=/opt/isuru/apache-maven-3.6.3
@chrishantha
chrishantha / .bash_aliases
Last active November 20, 2020 00:52
My Bash Aliases
alias mcid="mvn clean install -Dmaven.javadoc.skip=true -Dfindbugs.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Dcobertura.skip=true -Dmaven.test.skip=true -DskipTests"
alias mcit="mvn clean install -Dmaven.javadoc.skip=true -Dfindbugs.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Dcobertura.skip=true"
alias mci="mvn clean install"
# go back x directories
b() {
str=""
count=0
@chrishantha
chrishantha / CompareEclipseProfile.java
Last active April 21, 2017 04:11
CompareEclipseProfile
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;