Skip to content

Instantly share code, notes, and snippets.

View clouetb's full-sized avatar

Benoît Clouet clouetb

View GitHub Profile
@clouetb
clouetb / cisco_macdb_flattener
Last active April 9, 2020 20:23
A utility for flattening CISCO 'show system internal l2fm l2dbg macdb' command output
#!/usr/bin/env python3
import regex as re
from sys import argv, exit
macdb_regexpr = r"""
# Some examples matched by this regexp :
# VLAN: 2324 MAC: d867.d972.0fc3
# Time If/swid Db Op Src Slot FE Count
# Mon Apr 6 20:37:34 2020 0x160003e6 0 INSERT 3 5 7
# Mon Apr 6 20:37:59 2020 0x160003e6 0 NON_PI_MOD 3 2 15 6
@clouetb
clouetb / Vagrantfile
Created November 2, 2019 21:37
Vagrant set usb controller present for VMWare
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/centos-8"
config.vm.provider "vmware_desktop" do |vm|
vm.vmx["usb_xhci.present"] = "TRUE"
vm.vmx["usb.present"] = "TRUE"
vm.vmx["ehci.present"] = "TRUE"
vm.vmx["usb_xhci.present"] = "TRUE"
--- go-ethereum-1.7.2/p2p/rlpx.go 2017-10-14 14:58:53.000000000 +0200
+++ rlpx.go 2018-04-07 19:07:05.000000000 +0200
@@ -173,17 +173,20 @@
var (
sec secrets
err error
+ initiator bool // A flag tracking if node is initiator of the handshakes
)
if dial == nil {
sec, err = receiverEncHandshake(t.fd, prv, nil)
@clouetb
clouetb / TornadoTank.py
Last active February 23, 2018 08:41
Base for a Tornado based robot control UI. Allows to stream mjpeg in the HTML page returned.
import tornado.ioloop
import tornado.web
import tornado.websocket
import tornado.tcpserver
import tornado.tcpclient
import tornado.httpclient
import tornado.iostream
import tornado.gen
import uuid
import json
@clouetb
clouetb / minimal.py
Last active December 15, 2015 09:48
libpruio-0.2 python wrapper
#!/usr/bin/python
from pruio import *
from time import sleep
# Create a ctypes *pointer* to the pruio structure
io = pruio_new(PRUIO_DEF_ACTIVE, 0, 0, 0)
# Note the *pointer* dereferencing using the contents member
if not io.contents.Errr:
pruio_config(io, 1, 0, 0, 0)
for i in range(4):