Skip to content

Instantly share code, notes, and snippets.

View fritz0705's full-sized avatar
๐ŸŽ‚

Fritz fritz0705

๐ŸŽ‚
View GitHub Profile
#!/usr/bin/env python3
# coding: utf-8
import netaddr
import lglass
import sys
from progress.bar import Bar
from progress.spinner import Spinner
routes = lglass.bird.Parser().parse_routes(sys.stdin.read())
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#define WINDOW 32
int main()
{
int i;
int32_t in[WINDOW] = {0};
@fritz0705
fritz0705 / defconfig
Created October 21, 2012 07:01
current Kernel configuration (3.5.7)
CONFIG_EXPERIMENTAL=y
CONFIG_LOCALVERSION="-FRITZ"
CONFIG_KERNEL_XZ=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_FHANDLE=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
# coding: utf-8
class Route:
def __init__(self, network):
self.network = network
class BGPRoute(Route):
def __init__(self, network, origin="IGP", as_path=[], next_hop=None,
community=[], med=0):
Route.__init__(self, network)
#!/usr/bin/env python3
# coding: utf-8
import sys
peerings = []
print("graph dn42 {")
for line in sys.stdin:
_as = line.split(" ")[:-1]
i = 0
while i < len(_as) - 1:
@fritz0705
fritz0705 / O0.s
Created September 30, 2012 20:45
x86_64 gcc optimizations
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl -4(%rbp), %eax
movl %eax, %edx
@fritz0705
fritz0705 / rotat.css
Created May 25, 2012 09:36
A rotating "@"
@keyframes rotat {
0% {
transform: rotate(0deg);
-ms-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
}
25% {
transform: rotate(90deg);
@fritz0705
fritz0705 / .Xdefaults
Created April 20, 2012 08:22
Some dotfiles
Xft.antialias: true
Xft.autohint: false
Xft.rgba: rgb
URxvt*transparent: 0
URxvt*print-pipe: cat > $(TMPDIR=$HOME mktemp urxvt.XXXXXX)
URxvt*scrollBar: False
URxvt*letterSpace: -1
URxvt*font: xft:DejaVu Sans Mono:size=8
@fritz0705
fritz0705 / gist:2010592
Created March 10, 2012 06:28
Some snippet to count lines of code
find \( -name '*.[chSs]' -or -name '*.asm' \) -exec cat {} \; | grep -vP "^[\s]*([\#]|[\/]?\*|$|\/\/)" | wc -l
#include <arpa/inet.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <netinet/in.h>
// gcc -o ipv6_addr ipv6_addr.c -std=c99