Skip to content

Instantly share code, notes, and snippets.

View subh007's full-sized avatar

Subhash Kumar Singh subh007

View GitHub Profile
@subh007
subh007 / ODL Activator
Created July 23, 2014 10:39
description of ODL activator
package org.opendaylight.controller.northboundtest.unittestsuite.internal;
import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
import org.apache.felix.dm.Component;
public class Activator extends ComponentActivatorAbstractBase {
/**
* Function called when the activator starts just after some
@subh007
subh007 / ovs-config
Last active August 26, 2021 16:45
OVS-config
#! /bin/sh
echo "setting the environment"
echo "if the br0 exist then delete the br0"
sudo ovs-vsctl del-br br0
echo "creating the veth"
sudo ip link add veth0 type veth peer name veth1
@subh007
subh007 / wireshark-1.12.1-install
Created November 7, 2014 13:11
Installation script for the wireshark 1.12.1
#!/bin/sh
sudo apt-get -y remove wireshark
sudo apt-get -y install libgtk-3-dev libqt4-dev flex bison
wget https://www.wireshark.org/download/src/wireshark-1.12.1.tar.bz2
tar xvfj wireshark-1.11.3.tar.bz2
cd wireshark-1.12.1
./configure
make -j4
sudo make install
from django.utils import simplejson
from django.core import serializers
from models import Apple, Orange
def AjaxQuery(request):
apple_json = serializers.serialize('json', Apples.objects.all() )
apple_list = simplejson.loads( apple_json )
orange_json = serializers.serialize('json', Orange.objects.all() )
orange_list = simplejson.loads( orange_json )
@subh007
subh007 / odl_flow programmer
Created December 12, 2014 14:32
This is sample xml post data for programming the flow in Helium.
<!-- http://test1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:72058212700834815/table/0/flow/161 -->
<flow xmlns="urn:opendaylight:flow:inventory">
<instructions>
<instruction>
<order>0</order>
<apply-actions>
<action>
<order>0</order>
<output-action>
alias gdbnew='/usr/local/Cellar/gdb/7.6/bin/gdb'
@subh007
subh007 / ctags.setup
Last active August 29, 2015 14:12 — 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"
variables begin with an uppercase letter.
you can assign a value to a variable exactly once
The = operator (not the variables) has the role of comparing values and complaining if they're different. If they're the same, it returns the value:
If you're testing in the shell and save the wrong value to a variable, it is possible to 'erase' that variable by using the function f(Variable).. If you wish to clear all variable names, do f()..
Erlang won't care about floats and integers in arithmetic, but will do so when comparing them
6> 5 =:= 5.
true
7> 1 =:= 0.
@subh007
subh007 / gist:abea0016e01b63b67612
Created January 9, 2015 20:55
channel, goroutine, sync
package main
import (
"fmt"
"sync"
)
func printNumber(i int) int {
fmt.Println(i)
return i
@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"