Skip to content

Instantly share code, notes, and snippets.

View ishidawataru's full-sized avatar

Wataru Ishida ishidawataru

  • NTT
  • Tokyo, Japan
View GitHub Profile
@ishidawataru
ishidawataru / onlp_temp.py
Created June 19, 2020 19:05
Get temperature data using ONLP
import ctypes
import logging
import os
import json
import onlp.onlp
libonlp = onlp.onlp.libonlp
class OnlpMixin(object):
package main
import (
"fmt"
"github.com/spf13/cobra"
)
func main() {
subCmd := &cobra.Command{
Use: "sub",
@ishidawataru
ishidawataru / vpws.py
Last active December 22, 2016 08:58
of-dpa vpws
#! /usr/bin/env python
from OFDPA_python import *
import sys
def addL2UnfilteredInterfaceGroup(port):
group_id = new_uint32_tp()
uint32_tp_assign(group_id, 0)
ofdpaGroupTypeSet(group_id, OFDPA_GROUP_ENTRY_TYPE_L2_UNFILTERED_INTERFACE)
import unittest
from fabric.api import local
from lib import base
from lib.gobgp import *
from lib.quagga import *
import sys
import os
import time
import nose
from noseplugin import OptionParser, parser_option
@ishidawataru
ishidawataru / translate_gobgp_conf.py
Last active January 10, 2016 16:09
translate to latest gobgp configuration - from v1.3 to latest(366179f)
#!/usr/bin/env python
import toml
import yaml
import json
from argparse import ArgumentParser
import sys
def _camel2snake(camel):
snake = ''.join('-{0}'.format(c.lower()) if not c.islower() and i > 0 else c.lower() for i, c in enumerate(camel))
@ishidawataru
ishidawataru / add_community_policy.go
Last active October 19, 2016 20:02
show how to configure global policy via gRPC api
package main
import (
gobgp "github.com/osrg/gobgp/api"
"golang.org/x/net/context"
"google.golang.org/grpc"
"time"
)
func main() {
package main
import (
"fmt"
gobgp "github.com/osrg/gobgp/api"
"github.com/osrg/gobgp/gobgp/cmd"
"github.com/osrg/gobgp/packet"
"golang.org/x/net/context"
"google.golang.org/grpc"
"io"