Skip to content

Instantly share code, notes, and snippets.

@jshen28
jshen28 / ovs-cheat.md
Last active April 21, 2021 08:14 — forked from djoreilly/ovs-cheat.md
OVS cheat sheet

CTL

ovs-vsctl list open_vswitch
ovs-vsctl list interface
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl --format=table --columns=name,mac_in_use find Interface name=br-dpdk1
ovs-vsctl get interface vhub656c3cb-23 name/ofport
@jshen28
jshen28 / README.md
Created October 13, 2018 13:06 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@jshen28
jshen28 / README.md
Created October 21, 2018 09:40 — forked from smoser/README.md
MAAS and curtin debug

Debugging curtin from within MAAS

Deploying a node with MAAS cli

You can deploy a node with the maas cli which is often preferable to clicking a button on a web UI.

$ SYSTEM_ID=node-787b19d8-d25c-11e4-9f9e-00163eca91de
$ NAME="random-nodename"
$ MAASNAME="maaslocal"

$ maas $MAASNAME machine allocate "name=$NAME"

@jshen28
jshen28 / rabbitmq.txt
Created January 7, 2019 05:28 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@jshen28
jshen28 / howto_deb_repackage.txt
Created May 20, 2019 03:28 — forked from shamil/howto_deb_repackage.txt
Howto repackage deb packages
Use folowing steps to repackage dep package:
1: Extract deb package
# dpkg-deb -x <package.deb> <dir>
2: Extract control-information from a package
# dpkg-deb -e <package.deb> <dir/DEBIAN>
3. After completed to make changes to the package, repack the deb
# dpkg-deb -b <dir> <new-package.deb>
@jshen28
jshen28 / multicast-openstack.md
Created August 26, 2019 06:06 — forked from djoreilly/multicast-openstack.md
Multicast on OpenStack

Multicast on OpenStack

The following works with Neutron VLAN provider networks, and requires configuration on the physical switches. Multicast works on br-int because the ML2 OVS driver/agent uses OVS in standalone mode (no external controller). The packets on br-int hit the NORMAL flow action, and so get treated by the ovs-vswitchd code that does IGMP snooping (when enabled). All IGMP packets are sent to the slow path (userspace ovs-vswitchd).

The following will not work on Neutron tunnel backed networks (VxLAN, GRE), as the neutron-openvswitch-agent hardcodes flows on br-tun that treats multicast the same as broadcasts and the NORMAL action is not used.

+----------------------------+      +----------------------------+
|      +----+    +----+      |      |      +----+    +----+      |
|      | VM |    | VM |      |      |      | VM |    | VM |      |
|      +-+--+    +--+-+      |      |      +-+--+    +--+-+      |
@jshen28
jshen28 / route_dump.c
Created June 7, 2020 10:11 — forked from cl4u2/route_dump.c
Linux route monitoring example
/*
iflist.c : retrieve network interface information thru netlink sockets
(c) Jean Lorchat @ Internet Initiative Japan - Innovation Institute
v1.0 : initial version - Feb 19th 2010
This file was obtained at the following address :
http://www.iijlab.net/~jean/iflist.c
@jshen28
jshen28 / route_dump.c
Created June 7, 2020 10:11 — forked from cl4u2/route_dump.c
Linux route monitoring example
/*
iflist.c : retrieve network interface information thru netlink sockets
(c) Jean Lorchat @ Internet Initiative Japan - Innovation Institute
v1.0 : initial version - Feb 19th 2010
This file was obtained at the following address :
http://www.iijlab.net/~jean/iflist.c

Overview

For those that are unfamiliar with the project, PyPy is an implementation of the Python language that features a JIT Compiler. I have noticed a huge performance benefit in some personal projects by switching to PyPy. I have always been curious how it would perform on a large and complex project like OpenStack, but my early experiments ran into massive roadblocks around broken dependencies.

It has been six months since I last looked, so I figured it was time to try it again. Support has come a long way and, now that lxml is working, we are close enough to get a Proof-of-Concept running. Read on for instructions on running nova with PyPy.

Preparation

Start out with a base ubuntu 12.04 (precise) install and run devstack. I won't go through the details of getting devstack running here, because there are already instructions on the devstack site.

Simple vsock setup for QEMU

Configuration

Host Kernel: rawhide 4.13.0-0.rc6.git4.2.fc28.x86_64 (on Fedora 24)

QEMU is mainline built from sources: QEMU emulator version 2.10.50 (v2.10.0-105-g223cd0e)

Guest: clear-17460-kvm.img (which has vsock support)