Skip to content

Instantly share code, notes, and snippets.

View mzpqnxow's full-sized avatar

AG mzpqnxow

View GitHub Profile
@mzpqnxow
mzpqnxow / python_custom_openssl.diff
Created March 5, 2024 13:56 — forked from eddy-geek/ python_custom_openssl.diff
Compile python with statically linked openssl
--- a/setup.py 2014-03-17 03:31:31.000000000 +0100
+++ b/setup.py 2014-03-17 19:06:03.000000000 +0100
@@ -750,10 +750,8 @@
exts.append( Extension('_socket', ['socketmodule.c'],
depends = ['socketmodule.h']) )
# Detect SSL support for the socket module (via _ssl)
- search_for_ssl_incs_in = [
- '/usr/local/ssl/include',
- '/usr/contrib/ssl/include/'
- ]
@mzpqnxow
mzpqnxow / global_address_report.py
Created June 12, 2023 11:37 — forked from p-sherratt/global_address_report.py
Produce a "CIDR report" from Netbox
#!/usr/bin/env python3
# quick hacky script to produce a "CIDR report" of your global address space from Netbox
# this is released to the public domain, free of copyright and licensing.
# by Paul Sherratt
import urllib3
urllib3.disable_warnings()
# This could use some cleanup and robustness changes, but it works for me. Modifications are welcome!
# How to setup a Ubiquiti EdgeRouter POE for FreeRADIUS
# Based on
# https://community.ui.com/questions/FreeRADIUS-on-Edgerouter-2-x/6869cef3-aeca-42c3-9081-e69daa44f397
# https://networkjutsu.com/freeradius-with-two-factor-authentication/
# https://wiki.freeradius.org/guide/Getting-Started
# SSH into your router
@mzpqnxow
mzpqnxow / kernel-5.10.patch
Created October 23, 2022 23:27 — forked from kyujin-cho/kernel-5.10.patch
MLNX_OFED 4.9-4.1.7.0 on Debian 11
diff -Naur /home/kyujin/mlnx-ofed-patch/mlnx-ofed-kernel-4.9-orig/include/linux/sched/mm.h include/linux/sched/mm.h
--- a/include/linux/sched/mm.h 2021-12-08 23:08:07.000000000 +0900
+++ b/include/linux/sched/mm.h 2022-08-05 17:28:35.539301521 +0900
@@ -35,18 +35,18 @@
#if !defined (HAVE_MMGET_STILL_VALID) && !defined(HAVE_MMGET_STILL_VALID_IN_SCHED_H) && !defined(HAVE_MMGET_STILL_VALID_IN_MM_H)
/*
* This has to be called after a get_task_mm()/mmget_not_zero()
- * followed by taking the mmap_sem for writing before modifying the
+ * followed by taking the mmap_lock for writing before modifying the
* vmas or anything the coredump pretends not to change from under it.
@mzpqnxow
mzpqnxow / filerotator.py
Created October 21, 2022 17:00 — forked from adejones/filerotator.py
Python class and utility for file rotation. Configurable daily, weekly and monthly retention; can use hard links to save space; supports `argparse` config files.
#!/usr/bin/env python3
# vim: ft=python ts=4 sw=4 expandtab
#
# Copyright (c) 2013 Reed Kraft-Murphy <reed@reedmurphy.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mzpqnxow
mzpqnxow / _.md
Created August 1, 2022 14:14 — forked from korniltsev/_.md
C/C++ header to IDA

Usage

In IDAPython,

execfile('<path>/cxxparser.py')
parse_file('<path>/a.cpp',[r'-I<path>\LuaJIT-2.0.5\src', '-D__NT__', '-D__X64__', '-D__EA64__'])
parse_file('<path>/malloc.c',['-target=x86_64-linux-gnu'])
@mzpqnxow
mzpqnxow / networkmap1.png
Created April 30, 2022 15:07 — forked from adrianmihalko/networkmap1.png
wireguard edgerouter mullvad config
!!!NOT WORKING!!!
configure
set interfaces wireguard wg0 address 10.xx.xxx.253/32
set interfaces wireguard wg0 listen-port 51820
set interfaces wireguard wg0 route-allowed-ips false
set interfaces wireguard wg0 peer JuE+ endpoint mullvadserverip:51820
set interfaces wireguard wg0 peer JuE+ allowed-ips 0.0.0.0/0
@mzpqnxow
mzpqnxow / idapython_cheatsheet.md
Created April 19, 2022 21:56 — forked from icecr4ck/idapython_cheatsheet.md
Cheatsheet for IDAPython
@mzpqnxow
mzpqnxow / install_quartus17.sh
Created March 27, 2022 22:06 — forked from arthurbeggs/install_quartus17.sh
Install Quartus Prime Lite 17.0 in Ubuntu
#!/bin/bash
################################################################################
### Install Quartus and ModelSim ###
################################################################################
# Source code at https://github.com/arthurbeggs/scripts #
################################################################################
# #
# Based on https://github.com/jessebarreto/ConfigureWorkspace script. #
# #
@mzpqnxow
mzpqnxow / pandas_cheat.py
Created November 25, 2021 23:01 — forked from pohzipohzi/pandas_cheat.py
Cheat sheet for the python pandas library
import numpy as np
import pandas as pd
#### creating dataframes, adding and dropping columns
df = pd.DataFrame(np.arange(1,10).reshape(3,3),['A','B','C'],['w','x','y'])
df.columns = ['W','X','Y'] # change column names
df['Z']=df['X']+df['Y'] # new column with values X+Y
df['XX']=df.apply(lambda row: row['X']*2, axis=1) # new column with values twice of column X
df['YY']=1 # new column of ones