Skip to content

Instantly share code, notes, and snippets.

View supunsandeeptha's full-sized avatar

Supun Sandeeptha supunsandeeptha

View GitHub Profile
supunsandeeptha / createSelfSignedCert.js
Created July 18, 2022 07:17 — forked from JensWalter/createSelfSignedCert.js
generate a self signed certificate with AWS Lambda
const exec = require('child_process').exec;
const fs = require("fs");
exports.handler = function(event, context) {
console.log("creating certificate");
exec('openssl req -x509 -newkey rsa:4096 -keyout /tmp/key.pem -out /tmp/cert.pem -subj "/C=DE/ST=Bavaria/L=Munich/O=apimeister org/OU=org unit/" -days 45 -nodes', (error, stdout, stderr) => {
if (error) {
throw error;
console.log("reading certificate");
supunsandeeptha / git.migrate
Created November 12, 2021 03:54 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
supunsandeeptha /
Created July 22, 2021 03:56 — forked from peterforgacs/
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

supunsandeeptha / gist:7f5d565107a73f2673122cbe7784d4a9
Created June 23, 2021 05:40 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions


Quick Legend

Description, Instructions, Notes
Instance Branch
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# These owners will be the default owners for everything in the repo.
* @defunkt
# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
# will be requested to review.
*.js @octocat @github/js
supunsandeeptha / Jenkinsfile
Created May 18, 2021 08:14 — forked from JCotton1123/Jenkinsfile
Sample Jenkinsfile for Python project
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '10')) // Retain history on the last 10 builds
ansiColor('xterm') // Enable colors in terminal
timestamps() // Append timestamps to each line
timeout(time: 20, unit: 'MINUTES') // Set a timeout on the total execution time of the job
agent {
// Run this job within a Docker container built using
// contained within your projects repository. This image should include
supunsandeeptha /
Created January 25, 2021 03:46 — forked from lukaslundgren/
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
sudo make install
cd ..
tar -xzf softhsm-2.3.0.tar.gz
./configure --help
make install
softhsm2-util --init-token --slot 0 --label "Token-1"
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
public class SoftHSM {
public static void main(String[] args) throws Exception {
name = SoftHSM
library = /usr/local/lib/softhsm/
slot = 1426856870
attributes(generate, *, *) = {
CKA_TOKEN = true
attributes(generate, CKO_CERTIFICATE, *) = {
attributes(generate, CKO_PUBLIC_KEY, *) = {