Skip to content

Instantly share code, notes, and snippets.

Working from home

Kasun Thennakoon tmkasun

Working from home
View GitHub Profile
squarewf / rrdbackup
Last active Jun 13, 2021
OpenWrt /etc/init.d/ script to backup and restore the rrd (collectd) database, to preserve data across reboots
View rrdbackup
#!/bin/sh /etc/rc.common
# OpenWrt /etc/init.d/ script to backup and restore the rrd (collectd) database, to preserve data across reboots
# howto:
# - upload this file as /etc/init.d/rrdbackup
# - (optional) adjust BACKUP_DIR below to point to a different target directory for the backup (e.g., a USB drive)
# - # chmod +x /etc/init.d/rrdbackup
# - # /etc/init.d/rrdbackup enable
tmkasun /
Last active Oct 17, 2019
Setup APIM server and Run it with it's depending servers, Will only be useful until API manager product properly pack the dependencies in to final product. Till we get there ...
#! /usr/bin/env bash
# HOW TO USE: Put this file inside the directory where you would like to extract and run the product-APIM build file (.zip file)
# Change the below path variables accordingly *** NOTE: No trailing `/` slashes has been used
# This will only work with APIM 3.0.0 latest version with Carbon 4.x kernel. Addition to coping and unziping the pack,
# This script will only create symbolic links to the carbon-apimgt repository files.
volkancakil /
Last active Feb 4, 2021
How to install GNU Global 6.5.6 on Ubuntu 16.10
echo " ...."
echo "install package for GNU global..."
sudo apt-get update
sudo apt-get -y install curl
sudo apt-get -y install wget
sudo apt-get -y install ncurses-dev
benkulbertis /
Last active Jun 6, 2021
Cloudflare API v4 Dynamic DNS Update in Bash
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
ip=$(curl -s
rozifus / Python SimpleHTTPServer with SSL
Last active Jun 13, 2021
Python SimpleHTTPServer with SSL
View Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from
debasishg / gist:b4df1648d3f1776abdff
Last active Jan 20, 2021
another attempt to organize my ML readings ..
View gist:b4df1648d3f1776abdff
  1. Feature Learning
  1. Deep Learning
imesh /
Created Dec 26, 2013
Copy CEP artifacts from source to server deployment folders
# -----------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
mrrooijen / run.rb
Created May 28, 2013
Quick `open3` wrapper for running a synchronous system command and returning the pid, exit_status, stdout and stderr of the provided command.
View run.rb
require "open3"
def run(cmd)
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
return {
exit_status: wait_thr.value.to_i,
creativeaura /
Created May 9, 2013
Modifying Python's SimpleHTTPServer to accept directory aliases
import os
import posixpath
import urllib
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
# modify this to add additional routes
# [url_prefix , directory_path]
['/media', '/var/www/media'],
amueller /
Created Mar 17, 2012
Multi-Layer Perceptron for scikit-learn with SGD in Python
import numpy as np
import warnings
from itertools import cycle, izip
from sklearn.utils import gen_even_slices
from sklearn.utils import shuffle
from sklearn.base import BaseEstimator
from sklearn.base import ClassifierMixin
from sklearn.preprocessing import LabelBinarizer