Skip to content

Instantly share code, notes, and snippets.

View selboo's full-sized avatar
😀
Selboo

Selboo selboo

😀
Selboo
View GitHub Profile
@selboo
selboo / mirror-port.sh
Created December 27, 2022 10:39 — forked from lonelymtn/mirror-port.sh
Mirror traffic between two interfaces using Linux's traffic controll subsystem (tc)
#!/usr/bin/env bash
# Time-stamp: <2014-07-31 13:31:43 (ryanc)>
#
# Description: Mirror traffic between two interfaces using Linux's
# traffic control subsystem (tc)
trap cleanup EXIT
CLEANUP=1
SRC_IFACE=$1
diff -ruNa openresty-1.21.4.1/bundle/nginx-1.21.4/src/core/ngx_times.c openresty-1.21.4.1.time_fmt/bundle/nginx-1.21.4/src/core/ngx_times.c
--- openresty-1.21.4.1/bundle/nginx-1.21.4/src/core/ngx_times.c 2021-11-05 13:06:14.000000000 +0800
+++ openresty-1.21.4.1.time_fmt/bundle/nginx-1.21.4/src/core/ngx_times.c 2022-05-20 13:16:54.000000000 +0800
@@ -31,8 +31,10 @@
volatile ngx_str_t ngx_cached_err_log_time;
volatile ngx_str_t ngx_cached_http_time;
volatile ngx_str_t ngx_cached_http_log_time;
+volatile ngx_str_t ngx_cached_http_log_time_data;
volatile ngx_str_t ngx_cached_http_log_iso8601;
volatile ngx_str_t ngx_cached_syslog_time;
@selboo
selboo / access.lua
Created May 18, 2022 08:28 — forked from mariocesar/access.lua
Nginx Lua script redis based for Basic user authentication
function password_encode(password)
local bcrypt = require 'bcrypt'
return bcrypt.digest(password, 12)
end
function check_password(password, encoded_password)
local bcrypt = require 'bcrypt'
return bcrypt.verify(password, encoded_password)
end
@selboo
selboo / megaraid_status.py
Last active April 18, 2021 09:12 — forked from jrelo/megaraid_status.py
megaraid_status.py
#!/usr/bin/python
# $Id: megaclisas-status,v 1.52 2015/04/18 02:49:07 root Exp root $
#
# Written by Adam Cecile <gandalf@NOSPAM.le-vert.net>
# Modified vy Vincent S. Cojot <vincent@NOSPAM.cojot.name>
#
import os
import re
import sys
@selboo
selboo / openvpn
Last active March 24, 2023 15:59
python openvpn
#!/usr/bin/python
import pyotp
import sys,os
import re
import MySQLdb
def DB_Check(User, Pass):
db = MySQLdb.connect(