Skip to content

Instantly share code, notes, and snippets.

Kasun Thennakoon tmkasun

Block or report user

Report or block tmkasun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tmkasun / defaultTheme.js
Created Apr 13, 2020
Sample config to enable language switcher
View defaultTheme.js
const Configurations = {
/* Refer devportal/source/src/defaultTheme.js */
custom: {
languageSwitch: {
active: true,
languages: [
key: 'en',
image: '/site/public/images/flags/en.png',
imageWidth: 24, // in pixles
tmkasun / Ubuntu wake on
Created Feb 15, 2020
Setting up wakeonlan useful commands
View Ubuntu wake on

Check wake on lan supported and enabled in hardware

sudo ethtool <NIC>

wakeonland command installation

in mac use

View md.js
externals: {
Themes: 'AppThemes', // Should use long names for preventing global scope JS variable conflicts
MaterialIcons: 'MaterialIcons',
Config: 'AppConfig',
tmkasun /
Created Nov 28, 2019
Thread analyser for MAC
if [ "$#" -ne 3 ]; then
echo "usage: sh <pid> <number-of-dumps> <interval>"
for i in `seq 1 $count`;
mkdir -p report
tmkasun / nginx CORS
Last active May 25, 2020
How to configure Nginx to add CORS
View nginx CORS

This document explain how to

  • Generate SSL self sign certificate with subject alternative names using openssl tool
  • Configure nginx to add CORS OPTION call handler for none-cors endpoints

This gist is mostly for my future references 😄

  • First you need to have openssl configuration file to tell the tool what kind of certificate do you need, Following is a sample certificate file containing two SAN domains
tmkasun /
Created Nov 7, 2019
WSO2 API Manager 3.0 Publisher app read only mode


  "EnableMonetization" : false,
  "IsUnlimitedTierPaid" : false,
  "ExtensionHandlerPosition": "bottom",
  "RESTAPIScopes": {
    "Scope": [
tmkasun /
Last active May 25, 2020
How to configure nginx as a revers proxy for WSO2 API Manager SPA apps

For APIM 3.0.0

Update deployment.toml

proxyPort = 443

hostname = ""
View APIClient.js
const authorizations = {
OAuth2Security: {
token: { access_token: AuthManager.getUser(environment.label).getPartialToken() },
View sample_api_response.json
"id": "01234567-0123-0123-0123-012345678901",
"name": "CalculatorAPI",
"description": "A calculator API that supports basic operations",
"context": "CalculatorAPI",
"version": "1.0.0",
"provider": "admin",
"lifeCycleStatus": "CREATED",
"workflowStatus": "APPROVED",
"securityScheme": [
tmkasun /
Last active Aug 22, 2017
WSO2 API Manager get all subscriptions available for APIs created by given provider (user)
import requests, base64
configs = {
'credentials': {
'username': 'admin',
'password': 'admin',
'host': 'localhost',
'port': '9443',
'gateway_port': '8243',
You can’t perform that action at this time.