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 iptables_conntrack_configuration
# Generated by iptables-save v1.4.2 on Fri Jan 8 01:03:20 2010
*filter
:INPUT DROP [3:180]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [288:65758]
# allow traffic from loopback
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
# allow ping --icmp-type echo-request
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
@pavel-odintsov
pavel-odintsov / af_packet_rx_ring.c
Last active Feb 5, 2020
af_packet_rx_ring_habrahabr.c
View af_packet_rx_ring.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <boost/thread.hpp>
#include <sys/mman.h>
#include <poll.h>
#include <arpa/inet.h>
@pavel-odintsov
pavel-odintsov / af_packet_classic.c
Last active Dec 12, 2019
af_packet_classic_habrahabr
View af_packet_classic.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <boost/thread.hpp>
#include <arpa/inet.h>
#include <sys/socket.h>
@pavel-odintsov
pavel-odintsov / netmap_install.pl
Created Nov 20, 2015
Script for automatic install netmap with patched drivers from Pavel Odintsov
View netmap_install.pl
#!/usr/bin/perl
use strict;
use warnings;
# We could use old: 3.23.2.1 too
my $ixgbe_version = '4.1.5';
my $e1000e_version = '3.2.7.1';
my $igb_version = '5.3.3.2';
@pavel-odintsov
pavel-odintsov / pps.sh
Last active Sep 18, 2019
pps.sh for habrahabr
View pps.sh
#!/bin/bash
INTERVAL="1" # update interval in seconds
if [ -z "$1" ]; then
echo
echo usage: $0 [network-interface]
echo
echo e.g. $0 eth0
echo
View irq_balance_habrahabr.sh
#!/bin/bash
# from http://habrahabr.ru/post/108240/
ncpus=`grep -ciw ^processor /proc/cpuinfo`
test "$ncpus" -gt 1 || exit 1
n=0
for irq in `cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g`
do
f="/proc/irq/$irq/smp_affinity"
View irq_balance_manually.sh
#!/bin/bash
# from http://habrahabr.ru/post/108240/
ncpus=`grep -ciw ^processor /proc/cpuinfo`
test "$ncpus" -gt 1 || exit 1
n=0
for irq in `cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g`
do
f="/proc/irq/$irq/smp_affinity"
View gist:0a26894e7e93aa25902e
#!/bin/bash
INTERVAL="1" # update interval in seconds
if [ -z "$1" ]; then
echo
echo usage: $0 [network-interface]
echo
echo e.g. $0 eth0
echo
View dns_sniffer.go
package main
import "fmt"
import "sort"
import "strings"
import "code.google.com/p/gopacket"
import "code.google.com/p/gopacket/pcap"
import "code.google.com/p/gopacket/layers"
@pavel-odintsov
pavel-odintsov / gist:3e7351ba4ceca33b8cc6
Created May 4, 2014
vzprocess: ps with CTID filtration for OpenVZ
View gist:3e7351ba4ceca33b8cc6
#!/usr/bin/perl
use strict;
use warnings;
unless (scalar @ARGV == 1) {
die "Parameter needed, please pass ctid as parameter";
}
my $ctid = $ARGV[0];
You can’t perform that action at this time.