Skip to content

Instantly share code, notes, and snippets.

View nizq's full-sized avatar
🎯
Focusing

nizq nizq

🎯
Focusing
View GitHub Profile
@nizq
nizq / xdp_load_balancer.c
Created October 26, 2018 01:48 — forked from summerwind/xdp_load_balancer.c
XDP based load balancer with L3DSR support
#define KBUILD_MODNAME "load_balancer"
#include <uapi/linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
BPF_HASH(counter, uint32_t, long);
@nizq
nizq / pmml_bayesnet.ipynb
Created May 21, 2018 02:47 — forked from rtbs-dev/pmml_bayesnet.ipynb
Bayesian Network Models in PyMC3 and NetworkX
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nizq
nizq / docker-pid
Created November 27, 2016 13:35
Docker Scripts: Conveniently obtain the PID of a docker container by name or ID
#!/bin/sh
exec docker inspect --format '{{ .State.Pid }}' "$@"
@nizq
nizq / httpshark.lua
Created October 30, 2016 10:34 — forked from nicoster/httpshark.lua
#parse http request and response in wireshark #this was originally posted at http://blog.csdn.net/jasonhwang/article/details/5525700 by Huang Qiangxiong.
-- Decode param=value from "application/x-www-form-urlencoded" type http body
-- Original Author: Huang Qiangxiong ([email protected])
-- change log:
-- 2010-04-20
-- Just can play.
-- 2010-04-24
-- Add option "Turn on/off debug tree item" to preference window.
-- Add option "add_orig_item" to preference window.
------------------------------------------------------------------------------------------------
do
@nizq
nizq / pop3-main.bro
Created October 16, 2016 03:14 — forked from dcode/pop3-main.bro
basic pop3 analyzer for bro
##! Basic POP3 analyzer
# From here: https://github.com/albert-magyar/bro/blob/topic/pop3/scripts/base/protocols/pop3/main.bro
@load base/utils/numbers
@load base/utils/files
module POP3;
export {
redef enum Log::ID += { LOG };
@nizq
nizq / gist:06db7b19c25a689e5158da930c2c019c
Created August 9, 2016 14:28 — forked from artbikes/gist:2313040
auditd logstash pattern
AUDIT type=%{WORD:audit_type} msg=audit\(%{NUMBER:audit_epoch}:%{NUMBER:audit_counter}\): user pid=%{NUMBER:audit_pid} uid=%{NUMBER:audit_uid} auid=%{NUMBER:audit_audid} subj=%{WORD:audit_subject} msg=%{GREEDYDATA:audit_message}
AUDITLOGIN type=%{WORD:audit_type} msg=audit\(%{NUMBER:audit_epoch}:%{NUMBER:audit_counter}\): login pid=%{NUMBER:audit_pid} uid=%{NUMBER:audit_uid} old auid=%{NUMBER:old_auid} new auid=%{NUMBER:new_auid} old ses=%{NUMBER:old_ses} new ses=%{NUMBER:new_ses}
@nizq
nizq / pci_dss.md
Created July 1, 2016 07:59 — forked from diyan/pci_dss.md
PCI DSS. Useful resources
@nizq
nizq / netty-4-udp-demo.clj
Created December 2, 2013 07:47
使用netty-4.x的clojure udp服务,根据netty-4.x的java demo程序翻译过来的。
(ns mytest.udp
(:import (java.net InetSocketAddress
InetAddress)
(io.netty.bootstrap Bootstrap)
(io.netty.channel ChannelOption
EventLoopGroup
ChannelHandlerContext
ChannelInitializer
ChannelHandler
SimpleChannelInboundHandler)