Skip to content

Instantly share code, notes, and snippets.

View deferraz's full-sized avatar
:octocat:

Andre Ferraz deferraz

:octocat:
View GitHub Profile
[root@xxxx linux-2.6.32]# modinfo bnx2x
filename: /lib/modules/2.6.32.46-grsec-7.yos.x86_64/kernel/drivers/net/bnx2x.ko
firmware: bnx2x-e1h-5.2.13.0.fw
firmware: bnx2x-e1-5.2.13.0.fw
version: 1.52.1-7
license: GPL
description: Broadcom NetXtreme II BCM57710/57711/57711E Driver
author: Eliezer Tamir
srcversion: 386CA02B991532F59771546
alias: pci:v000014E4d00001650sv*sd*bc*sc*i*
[root@centos ~]# modinfo bnx2x
filename: /lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/bnx2x/bnx2x.ko
firmware: bnx2x/bnx2x-e2-7.0.23.0.fw
firmware: bnx2x/bnx2x-e1h-7.0.23.0.fw
firmware: bnx2x/bnx2x-e1-7.0.23.0.fw
version: 1.70.00-0
license: GPL
description: Broadcom NetXtreme II BCM57710/57711/57711E/57712/57712_MF/57800/57800_MF/57810/57810_MF/57840/57840_MF Driver
author: Eliezer Tamir
srcversion: 6A5A19EFF0B787AC073CB60
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "tlpi_hdr.h"
#ifndef BUF_SIZE
#define BUF_SIZE 1024
#endif
@deferraz
deferraz / mod_qos_withproxy.patch
Created November 5, 2012 15:00
mod_qos withproxy patch
diff -uNr a/apache2/mod_qos.c b/apache2/mod_qos.c
--- a/apache2/mod_qos.c 2012-11-01 19:30:30.000000000 -0200
+++ b/apache2/mod_qos.c 2012-11-01 20:36:33.000000000 -0200
@@ -223,6 +223,8 @@
#define qos_unixd_set_global_mutex_perms unixd_set_global_mutex_perms
#endif
+#define QS_CONN_WITHPROXY(r) apr_table_get(r->headers_in, "X-Forwarded-For")
+
#ifdef QS_MOD_EXT_HOOKS
@deferraz
deferraz / cciss-2.6.32-g8.patch
Created November 21, 2012 13:40
Support for G8 SmartArray Controllers on 2.6.32 -longterm
diff -uNr a/drivers/block/cciss.c b/drivers/block/cciss.c
--- a/drivers/block/cciss.c 2012-10-22 16:19:36.000000000 -0200
+++ b/drivers/block/cciss.c 2012-10-22 16:50:40.000000000 -0200
@@ -1,6 +1,6 @@
/*
* Disk Array driver for HP Smart Array controllers.
- * (C) Copyright 2000, 2007 Hewlett-Packard Development Company, L.P.
+ * (C) Copyright 2000, 2010 Hewlett-Packard Development Company, L.P.
*
* This program is free software; you can redistribute it and/or modify
root@XXXX:/usr/lib/pymodules/python2.6/rq# diff /tmp/utils.py utils.py
11a12,13
> from compat import is_python_version
>
137c139,142
< super(ColorizingStreamHandler, self).__init__(*args, **kwargs)
---
> if is_python_version((2,6)):
> logging.StreamHandler.__init__(self, *args, **kwargs)
> else:
d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done
if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then
# if in Debian packaging tree with unset $QUILT_PATCHES
QUILT_PATCHES="debian/patches"
QUILT_PATCH_OPTS="--reject-format=unified"
QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
fi
diff -uNr a/src/Application.cpp b/src/Application.cpp--- a/src/Application.cpp 2013-03-04 17:55:40.000000000 -0300
+++ b/src/Application.cpp 2013-03-04 18:27:12.000000000 -0300
@@ -306,13 +306,15 @@ // Common code (for all security modes)
// Check UID/GID of script
- if (scriptFile.getUser().getUid() < config.getMinUid()) {
+ if ((scriptFile.getUser().getUid() < config.getMinUid()) &&
+ scriptFile.getUser().getUid() != config.getExceptUid()) { std::string error = "UID of script \"" + scriptFilename + "\" is smaller than min_uid"; logger.logWarning(error);
throw SoftException(error, __FILE__, __LINE__);
}- if (scriptFile.getGroup().getGid() < config.getMinGid()) {+ if ((scriptFile.getGroup().getGid() < config.getMinGid()) &&+ scriptFile.getGroup().getGid() != config.getExceptGid()) {
# Use those functions to enumerate all interfaces available on the system using Python.
# found on <http://code.activestate.com/recipes/439093/#c1>
import socket
import fcntl
import struct
import array
def all_interfaces():
max_possible = 128 # arbitrary. raise if needed.
@deferraz
deferraz / semtex.c
Last active December 17, 2015 10:09
/*
* linux 2.6.37-3.x.x x86_64, ~100 LOC
* gcc-4.6 -O2 semtex.c && ./a.out
* 2010 [email protected], salut!
*
* update may 2013:
* seems like centos 2.6.32 backported the perf bug, lol.
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
*/