Skip to content

Instantly share code, notes, and snippets.

@upa
upa / vyatta-kernel-module
Created September 24, 2012 07:14
How to compile kernel module on vyatta
package {
repository community {
components main
distribution stable
url http://packages.vyatta.com/vyatta
}
repository jaist {
components main
distribution squeeze
url http://ftp.jaist.ac.jp/pub/Linux/Debian
@upa
upa / lispd-mob.sh
Created September 25, 2012 16:13
lispd of lispmob start/stop script
#!/bin/sh
# Start/Stop the lispd of lispmob daemon.
#
NAME=lispd
DAEMON=/usr/local/sbin/lispd
CONFIG=/etc/lispd.conf
PIDFILE=/var/run/lispd.pid
@upa
upa / gist:4116074
Created November 20, 2012 04:41
vyatta pacifica apt repositories
package {
repository jaist {
components main
distribution squeeze
url http://ftp.jaist.ac.jp/pub/Linux/Debian
}
repository pacifica {
components main
@upa
upa / xml2dict
Created November 27, 2012 02:53
xml2dict
def xmltodict (node) :
def _xmltodict (node) :
if len (node) > 0:
dic = {}
for child in node :
[key, value] = _xmltodict (child)
if dic.has_key (key) :
if isinstance (dic[key], list) :
dic[key].append (value)
@upa
upa / pktgen.sh
Created March 16, 2013 15:14
simple pktgen script
#!/bin/bash
# pktgen.conf -- Sample configuration for send
modprobe pktgen
DEVICE=$1
PKTLEN=$2
if [ -z $DEVICE ]; then
echo "$0 [IFNAME]"
@upa
upa / rvmx.py
Last active December 17, 2015 17:49
Remote control command for multiple ESX 5.1 HVs.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Remote VMware ESX 5.1 Control Commands
# Requires
# - sshpass
# - VMware-ovf-tools
#
import re
@upa
upa / gist:6634704
Created September 20, 2013 08:26
strsplit
int
strsplit (char * str, char ** args, int max)
{
int argc;
char * c;
for (argc = 0, c = str; *c == ' '; c++);
while (*c && argc < max) {
args[argc++] = c;
while (*c && *c > ' ') c++;
ovs-vsctl add-br ovsbr0
ip netns list
ip netns add ns0
ip netns add ns1
ip link add name veth0a type veth peer name veth0b
ip link add name veth1a type veth peer name veth1b
ip link set dev veth0b netns ns0
ip link set dev veth1b netns ns1
ip netns exec ns0 ifconfig lo up
ip netns exec ns1 ifconfig lo up
@upa
upa / LICENSE
Last active August 23, 2022 16:42
Ansible Module for Linux Bridge and VLAN
MIT License
Copyright (c) 2021 Ryo Nakamura
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@upa
upa / neutron-port-state-change.py
Created June 24, 2014 07:12
Change port stauts via neutron api using neutron-python binding
#!/usr/bin/env python
import sys
import json
from neutronclient.v2_0 import client as neutronclient
authurl = 'http://10.0.2.15:5000/v2.0'
username = 'demo'
password = 'pass'
tenantname = 'demo'