Skip to content

Instantly share code, notes, and snippets.

View subh007's full-sized avatar

Subhash Kumar Singh subh007

View GitHub Profile
@subh007
subh007 / postman_collection.json
Created April 4, 2019 13:32 — forked from vermauv/postman_collection.json
Camunda Postman Examples (create w/wo embedded forms, deploy, complete/assign/approve tasks)
{
"info": {
"_postman_id": "767f8402-3259-1c5a-5597-fb9a62a77193",
"name": "Camunda OC Demo",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Task List",
"request": {
@subh007
subh007 / 0_reuse_code.js
Created June 3, 2017 15:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.function.Predicate;
public class Main{
@subh007
subh007 / MethodReference.java
Created May 2, 2017 11:57
Understand Method reference
import java.awt.Color;
import java.util.function.Function;
public class Main {
public static void execute(Function<NewBrightColor, Color> func) {
func.apply(new NewBrightColor());
}
public static void main(String[] args) {
@subh007
subh007 / Async.java
Created March 21, 2016 21:08
Listenable callback
public class AsyncRequest{
ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(8));
public void makeRequest(String url) throws Exception{
// task to execute in executor
Callable<String> asyncTask = new Callable<String>() {
@Override
public String call() throws Exception {
@subh007
subh007 / Async.java
Created March 21, 2016 20:22
Async_Architecture
interface Fetcher {
public void downloadURL(String url, FetcherCallback callbackHandler);
}
interface FetcherCallback {
public void onData(String data);
public void onError(Exception e);
}
@subh007
subh007 / upgrade_ovs_in_mininet.sh
Created September 30, 2015 10:16 — forked from pichuang/upgrade_ovs_in_mininet.sh
Installing new version of Open vSwitch 2.3.0 use Mininet
#!/bin/sh -ev
# Reference: https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch
# How to test: ovs-vsctl -V
# Check permission
test $(id -u) -ne 0 && echo "This script must be run as root" && exit 0
#Remove old version ovs
aptitude remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch -y
Exercise 1:
First Hello Program
1. First to the root directory of Hello project:
$ cd /home/opendaylight/bootcamp/opendaylight-application-dev-training/Code-Sample/Md-Sal-Demo/hello
How we generated the project directory structure:
2. Compile the code
$ mvn clean install -DskipTests -X ( -o to build offline)
@subh007
subh007 / rest_app.py
Last active April 9, 2016 18:02
This is firewall udp firewall application.- Drop all the udp packets.- Allow all the other traffic.
import requests
from requests.auth import HTTPBasicAuth
from websocket import create_connection
"""
Executing the file:
$ python rest_app.py (edit the BASEURL according to the controller ip (address, port))
Steps to follow to test the code:
@subh007
subh007 / ctags.setup
Last active August 29, 2015 14:14 — forked from nazgob/ctags.setup
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"