This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@virgo:~ $ sudo tcpdump -vvvv -ttt -i eth1 icmp6 and 'ip6[40] = 134' | |
00:00:00.000000 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 200) fe80::b675:eff:fefa:1cb > ip6-allnodes: [icmp6 sum ok] ICMP6, router advertisement, length 200 | |
hop limit 0, Flags [managed, other stateful], pref medium, router lifetime 1800s, reachable time 0s, retrans time 0s | |
source link-address option (1), length 8 (1): b4:75:0e:fa:01:cb | |
0x0000: b475 0efa 01cb | |
mtu option (5), length 8 (1): 1280 | |
0x0000: 0000 0000 0500 | |
prefix info option (3), length 32 (4): 2a01:ffff:43f::/64, Flags [onlink, auto], valid time 7200s, pref. time 1800s | |
0x0000: 40c0 0000 1c20 0000 0708 0000 0000 2a01 | |
0x0010: ffff 043f 0000 0000 0000 0000 0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server_addr = "127.0.0.1" | |
server_port = 8888 | |
# debug level, can be debug, error, info, ... | |
loglevel = "debug" | |
paths = { | |
"route_set" : "/", | |
"interface_get" : "/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import builddriver | |
result = builddriver.execute("make debug") | |
result.status() | |
# can be True or False | |
result.log() | |
# return a path where the output is captured (/tmp/foo.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define N 1024 | |
int mul1[N][N]; | |
int mul2[N][N]; | |
int res[N][N]; | |
void calculate(void) | |
{ | |
int i, j, k; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ping heise.de -c 300 -ni 0.5 | awk -F '[= ]' {'print $(NF-1)'} | grep -E '[0-9]' > /tmp/ipv4.dat | |
ping6 heise.de -c 300 -ni 0.5 | awk -F '[= ]' {'print $(NF-1)'} | grep -E '[0-9]' > /tmp/ipv6.dat | |
cat << EOF > /tmp/ping-rtt.gpi | |
#!/usr/bin/gnuplot | |
set terminal svg size 1000,600 fname "Gill Sans" fsize 14 rounded dashed | |
set style line 80 lt 0 | |
set style line 80 lt rgb "#808080" | |
set style line 81 lt 3 | |
set style line 81 lt rgb "#808080" lw 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function alex_hash() { | |
var hash = 0; | |
if (this.length == 0) return hash; | |
for (i = 0; i < this.length; i++) { | |
char = this.charCodeAt(i); | |
hash1 = ((char)-hash)+char; | |
hash2 = ((char<<8)-hash)+char; | |
hash3 = ((char<<16)-hash)+char; | |
hash4 = ((char<<24)-hash)+char; | |
hash = (hash1 ^ hash2 ^ hash3 ^ hash4) & 0xFFFFFF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Various options for a JSON type for Python. | |
My best effort at using these libraries naturally for reading and writing JSON. | |
https://nelsonslog.wordpress.com/2016/01/08/a-better-python-object-for-json/ | |
""" | |
import json, copy | |
import dotmap, attrdict, easydict, addict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# remember to edit /etc/sudoers file and grant tcpdump without | |
# password access to work in a scripting environment. sudo visudo | |
# username ALL=NOPASSWD:ALL,/sbin/tcpdump,/usr/bin/kill | |
import os | |
import signal | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# aptitude install bridge-utils | |
if1=eth0 | |
if2=eth1 | |
ifconfig $if1 down | |
ifconfig $if2 down | |
ifconfig $if1 0.0.0.0 up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2006, Intel Corporation | |
* Copyright (C) 2012, Neil Horman <nhorman@tuxdriver.com> | |
* | |
* This file is part of irqbalance | |
* | |
* This program file is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License as published by the | |
* Free Software Foundation; version 2 of the License. | |
* |
NewerOlder