Skip to content

Instantly share code, notes, and snippets.

View smallzhong's full-sized avatar
😆
库洛牌,我现在命令你,快点变回你原来的样子!

小钟 smallzhong

😆
库洛牌,我现在命令你,快点变回你原来的样子!
View GitHub Profile
@smallzhong
smallzhong / decent_request.py
Created December 21, 2023 04:51 — forked from laixintao/decent_request.py
Send HTTP requests using python-requests with timeout, tcp reuse(session) and retry.
from requests.adapters import HTTPAdapter, Retry
from requests import Session
retries = Retry(
total=5, backoff_factor=1, status_forcelist=[502, 503, 504]
)
session = Session() # reuse tcp connection
session.mount("http://", HTTPAdapter(max_retries=retries))
session.mount("https://", HTTPAdapter(max_retries=retries))
//this requires being able to run at kernel mode and assumes you're using MSVC
//this also uses an unnamed structure for cr0_t, which is a nonstandard extension of the C language
//data structure for cr0
typedef union _cr0_t
{
struct
{
uint64_t protection_enable : 1;
@smallzhong
smallzhong / keybase.md
Created June 20, 2022 07:00
keybase.md

Keybase proof

I hereby claim:

  • I am smallzhong on github.
  • I am smallzhong (https://keybase.io/smallzhong) on keybase.
  • I have a public key ASAOkBjK71ls20wsJc_qyGn8i20jy7ZPJqppPwKmXv1CgAo

To claim this, I am signing this object: