Skip to content

Instantly share code, notes, and snippets.

View SaveTheRbtz's full-sized avatar

Alexey Ivanov SaveTheRbtz

View GitHub Profile
static const struct ixgbe_info *ixgbe_info_tbl[] = {
[board_82598] = &ixgbe_82598_info,
[board_82599] = &ixgbe_82599_info,
[board_X540] = &ixgbe_X540_info,
};
/* ixgbe_pci_tbl - PCI Device ID Table
*
* Wildcard entries (PCI_ANY_ID) should come last
* Last entry must be all 0s
@SaveTheRbtz
SaveTheRbtz / fact_eval1.py
Last active August 29, 2015 13:56
python factorials
from itertools import imap
fact_eval1 = lambda n: eval("*".join(imap(str, xrange(1, n + 1)))) if n > 1 else 1
#!/bin/sh
#
# Simple utility to check that all *.crt files match corresponding *.key's
#
for FILE in *.crt; do
CERT="$FILE"
KEY="${FILE%crt}key"
@SaveTheRbtz
SaveTheRbtz / patch-apc_red.patch
Created December 3, 2011 00:18
APC cache: RED As Workaround For Thundering Herd Problem
Index: apc_cache.c
===================================================================
--- apc_cache.c (revision 320057)
+++ apc_cache.c (working copy)
@@ -705,6 +705,13 @@
volatile apc_cache_entry_t* value = NULL;
unsigned long h;
+ /* APC-RED PATCH */
+ const int drop_cf = 75;
@SaveTheRbtz
SaveTheRbtz / gist:2117117
Created March 19, 2012 15:55 — forked from verm666/gist:2049204
djb2.py
#!/usr/bin/env
# -*- coding: utf-8 -*-
from collections import Counter
from contextlib import contextmanager
def djb2(uuid):
""" See for details: http://www.cse.yorku.ca/~oz/hash.html """
_hash = 5381
@SaveTheRbtz
SaveTheRbtz / Python_Essential_Reference_errata.rst
Last active October 3, 2015 20:28
My tiny errata for Python Essential Reference

Errata for Python Essential Reference

Fourth Edition (by David M. Beazley)

Chapter 9

p. 170 ++++ I'm myself by no means UTF-8 guru but there is some inconsistency with RFC3629:

@SaveTheRbtz
SaveTheRbtz / 80-iosched.rules
Created June 15, 2012 15:02
/etc/udev/rules.d/80-iosched.rules
root@ws36-000:~# cat /etc/udev/rules.d/80-iosched.rules
# Default CFQ settings does not perform well in our environment. Switch it to
# IOPS mode and use NCQ.
#
# XXX: This applies even for SATA drives. If you want to disable IOPS mode on
# SATA drives uncomment following line:
#ENV{ID_BUS}=="ata", GOTO="end_iosched"
SUBSYSTEM!="block", GOTO="end_iosched"
KERNEL=="dm-*", GOTO="end_iosched"
@SaveTheRbtz
SaveTheRbtz / Linux_Kernel_Development_errata_and_wishlist.rst
Created July 10, 2012 00:47
My wishlist for next edition of Linux Kernel Development

Linux Kernel Development

Third Edition by Robert Love is an excellent book, but still there is a way for improvement. I'll attached tiny errata and my wishlist below.

Chapter 7: Interrupts and Interrupt Handlers

Wishlist

@SaveTheRbtz
SaveTheRbtz / gist:3734932
Last active October 10, 2015 18:48
Added "fade" readahead type
commit e95636528228a11ed22e5d17e160d69325e8572f
Author: Alexey Ivanov <rbtz@yandex-team.ru>
Date: Tue Jul 31 01:48:45 2012 +0400
YANDEX: Added "fade" readahead type
This replaces comlicated logic with simple one:
* If we've already read more than file size -- read 8 pages
* Else if we read more than file size / 2 -- read (ra_pages / 4) pages
* Otherwise read 8 pages
@SaveTheRbtz
SaveTheRbtz / README.txt
Created December 1, 2012 14:10
mDNSResponder
Note: Developers writing applications for OS X do not need to incorporate
this code into their applications, since OS X provides a system service to
handle this for them. If every application developer were to link-in the
mDNSResponder code into their application, then we would end up with a
situation like the picture below:
+------------------+ +------------------+ +------------------+
| Application 1 | | Application 2 | | Application 3 |
+------------------+ +------------------+ +------------------+
| mDNS Core | | mDNS Core | | mDNS Core |