Skip to content

Instantly share code, notes, and snippets.

Pavel Odintsov pavel-odintsov

Block or report user

Report or block pavel-odintsov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View whyperlsucks.pl
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
my $my_data = { "ThisValueShouldbeInteger" => 111 };
# Expected output of this script is:
View gist:6c3f0c62fb84e7a6330cdaf0ef24c3d2
package main
import "fmt"
func main() {
inputSlice := []string{"aaa", "bbb", "cccc"}
for current_index, r := range inputSlice {
fmt.Printf("Current iteration: %d current item: %s\n", current_index, r)
@pavel-odintsov
pavel-odintsov / gobgp
Created Mar 8, 2016
GoBGP configuration file
View gobgp
description "GoBGP BGP daemon"
author "Pavel Odintsov <pavel.odintsov@gmail.com>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
# TODO: use path without version number
env DAEMON=/opt/gobgp_1_4_0_git/gobgpd
env CONFIGURATION_FILE=/etc/gobgpd.conf
env DAEMON_OPTIONS="--disable-stdlog --syslog yes"
@pavel-odintsov
pavel-odintsov / stabtest.cpp
Created Feb 17, 2016 — forked from cameron314/stabtest.cpp
Simple stability test that I whipped up for exercising my lock-free queue. Compile with g++ -std=c++11 -DNDEBUG stabtest.cpp -O3 -pthread
View stabtest.cpp
#include "readerwriterqueue.h"
using namespace moodycamel;
#include <exception>
#include <fstream>
#include <thread>
#include <cstdlib> // rand()
#include <unistd.h> // usleep()
View union_bitfield_cpp_issue.cpp
#include <iostream>
#include <cstdint>
#include <arpa/inet.h>
// g++ ../isolated_example.cpp -std=c++11
typedef union __attribute__((__packed__)) {
uint16_t reserved_flag : 1, dont_fragment_flag : 1, more_fragments_flag : 1, fragment_offset : 13;
uint16_t fragmentation_details_as_integer;
} fragmentation_details_t;
@pavel-odintsov
pavel-odintsov / could_not_start_monitoring_on_two_ports.cpp
Created Feb 6, 2016
could_not_start_monitoring_on_two_ports.cpp
View could_not_start_monitoring_on_two_ports.cpp
#include <stdio.h>
#include <iostream>
#include <string>
#define NETMAP_WITH_LIBS
#include "net/netmap_user.h"
#include <boost/thread.hpp>
// For pooling operations
#include <poll.h>
@pavel-odintsov
pavel-odintsov / netmap_monitor_multi_queue.c
Last active Feb 3, 2016
netmap_monitor_multi_queue.c
View netmap_monitor_multi_queue.c
#include <stdio.h>
#include <iostream>
#include <string>
#define NETMAP_WITH_LIBS
#include <net/netmap_user.h>
#include <boost/thread.hpp>
// For pooling operations
#include <poll.h>
View mongo_fixed_pkg_config
prefix=/opt/fastnetmon/libraries/mongo_cxx_3_0_0_rc0
includedir=${prefix}/include
libdir=${prefix}/lib
Name: libmongocxx
Description: The MongoDB C++11 Driver Library
URL: http://github.com/mongodb/mongo-cxx-driver
Version: 3.0.0-rc1-pre
Requires.private: libbson-1.0 >= 1.3.1, libmongoc-1.0
Requires: libbsoncxx >= 3.0.0-rc1-pre
View pps_meter_freebsd.sh
#!/usr/local/bin/bash
INTERVAL="1" # update interval in seconds
# pkg install bash
if [ -z "$1" ]; then
echo
echo usage: $0 [network-interface]
echo
View monitor_notify.patch
diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c
index 037d8e9..4027981 100644
--- a/sys/dev/netmap/netmap_monitor.c
+++ b/sys/dev/netmap/netmap_monitor.c
@@ -672,6 +672,7 @@ static int
netmap_monitor_parent_notify(struct netmap_kring *kring, int flags)
{
int error = 0;
+ int (*notify)(struct netmap_kring*, int);
ND(5, "%s %x", kring->name, flags);
You can’t perform that action at this time.