Skip to content

Instantly share code, notes, and snippets.

View kasunbg's full-sized avatar
🐶

Kasun Gajasinghe kasunbg

🐶
View GitHub Profile
@kasunbg
kasunbg / Jenkinsfile
Created December 30, 2018 13:00
Jenkinsfile with Docker
pipeline {
agent {
docker { image 'mysql:5.6.37' }
}
stages {
stage('Run tests') {
steps {
sh 'pwd'
sh """
@kasunbg
kasunbg / test.sh
Last active August 13, 2019 09:43
Testgrid test.sh template
set -euxo pipefail # This provide better error handling for shell scripts
HOME=`pwd`
TEST_SCRIPT=test.sh
function usage()
{
echo "
Usage bash test.sh --input-dir /workspace/data-bucket/in --output-dir /workspace/data-bucket/out
@kasunbg
kasunbg / infrastructure.properties
Last active May 23, 2019 12:03
Sample testgrid.yaml
#Sample Testgrid deployment / infrastructure.properties file.
#Thu May 23 11:59:20 UTC 2019
DepValue1=12345
TESTGRID_TINKERER_PASSWOR=********
TESTGRID_TINKERER_ENDPOINT=http\://localhost\:8080/deployment-tinkerer/v0.9
BallerinaVersionType=RC
dockerhub_ballerina_scenarios_username=ballerinascenarios
RCLocation=https\://product-dist.ballerina.io/nightly/0.992.0-m2-SNAPSHOT/ballerina-0.992.0-m2-SNAPSHOT.zip
ElasticSearchEndpoint=https\://search-testgrid-dev-********.us-east-1.es.amazonaws.com
IS_TESTGRID=True
@kasunbg
kasunbg / nginx.conf
Created August 15, 2018 08:39
Nginx configuration for Nexus Sonatype that apache maven built artifacts
listen *:80;
server_name maven.kasunbg.org;
access_log /var/log/nginx/maven.kasunbg.org/access.log;
error_log /var/log/nginx/maven.kasunbg.org/error.log;
# allow large uploads of files - refer to nginx documentation
client_max_body_size 3072m;
# optimize downloading files larger than 1G - refer to nginx doc before adjusting
Jenkins.instance.getItemByFullName("manuri/test-build")
.getBuildByNumber(123)
.finish(
hudson.model.Result.ABORTED,
new java.io.IOException("Aborting build")
);
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "usage: sh thread-analyze.sh <pid> <number-of-dumps> <interval>"
exit
fi
count=$2
for i in `seq 1 $count`;
do
jstack -l $1 > thread_dump_`date "+%F-%T"`.txt &
@kasunbg
kasunbg / README.md
Created January 18, 2018 07:58 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@kasunbg
kasunbg / stooge_loader.rb
Created November 23, 2017 18:22 — forked from bowsersenior/stooge_loader.rb
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@kasunbg
kasunbg / buildAllExtensions.sh
Created October 10, 2017 12:54 — forked from pulasthi7/buildAllExtensions.sh
Clones all the IS extensions repos
echo "building framework"
cd identity-framework
mvn clean install -Dmaven.test.skip=true
if [ $? -ne 0 ]
then
cd ..
echo Build failed at identity-framework
notify-send "Build failed at identity-framework"
exit 1
else
@kasunbg
kasunbg / README.md
Created September 30, 2017 10:23
Atom language-log log highlighting for Java log4j logs

This content should be copied into ~/.atom/packages/language-log/grammars/log.cson folder. The content in the existing should be replaced.

If you do not like replacing the entire file, then you need to do two things.

  1. Get the 'log4j': section and paste it into your log.cson.
  2. Include following line under the top-level 'patterns' tag.

{'include': '#log4j'}