Skip to content

Instantly share code, notes, and snippets.

View kasunbg's full-sized avatar
🐶

Kasun Gajasinghe kasunbg

🐶
View GitHub Profile
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@kasunbg
kasunbg / rsync-for-carbon-depsync.sh
Last active March 9, 2019 15:36
wso2 carbon DepSync via rsync
#!/bin/sh
#A snippet to synchronize the CARBON_HOME/repository/deployment/server folders between manager and all worker nodes.
#Add a file called workers-list.txt that has a syntax like follows separated by new lines.
#ubuntu@192.168.1.1:~/setup/192.168.1.1/as/as_worker/repository/deployment/server
manager_server_dir=~/wso2as-5.2.1/repository/deployment/server
pem_file=~/.ssh/carbon-440-test.pem
#delete the lock on exit
@kasunbg
kasunbg / release-script.sh
Created June 1, 2016 11:38
automated-maven-release-process
#!/bin/sh
REPO_NAME=$1
#possible values: 1.7 1.8
JDK_TO_USE=$2
HOME=/build/release-builds/kasung/
JDK_18=/build/software/java/jdk1.8.0_20
JDK_17=/build/software/java/jdk1.7.0_51
@kasunbg
kasunbg / gist:7b9b0d896bab5359f89f639fb6c9fbaa
Created August 24, 2016 04:56 — forked from bahayman/gist:9369651
tcpdump http monitor
Use TCPDUMP to Monitor HTTP Traffic
1. To monitor HTTP traffic including request and response headers and message body:
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i all
2. To monitor HTTP traffic including request and response headers and message body from a particular source:
tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
3. To monitor HTTP traffic including request and response headers and message body from local host to local host:
INFO [org.apache.axis2.transport.http.HTTPSender] - Unable to sendViaPost to url[https://localhost:9853/services/AuthenticationAdmin]
org.apache.axis2.AxisFault: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.comm
@kasunbg
kasunbg / config
Last active September 17, 2017 01:18
Terminator for Linux: Better keybindings and theme support. cat ~/.config/terminator/config
[global_config]
focus = system
title_transmit_bg_color = "#5cb05e"
window_state = maximise
[keybindings]
close_term = <Primary><Shift>w
close_window = <Primary>q
copy = <Primary>c
paste = <Primary>v
search = <Primary>f
@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'}

@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 / 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 / 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