Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

akkuman

💭
I may be slow to respond.
View GitHub Profile
@akkuman
akkuman / parse.go
Created Oct 13, 2021
[go解析导出表] golang解析pe的导出表 #golang #pe
View parse.go
package main
import (
"fmt"
"os"
"github.com/fcharlie/buna/debug/pe"
)
func main() {
@akkuman
akkuman / enum_heaps.c
Created Sep 16, 2021 — forked from reinsteam/enum_heaps.c
Sample code of heap enumeration without using Tool Help functions <tlhelp32.h>
View enum_heaps.c
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#pragma warning (push)
/* 4820: '<struct-name>' : 'n' bytes padding added after data member '<member-name>'*/
# pragma warning (disable : 4820)
# include <windows.h>
# include <stdio.h>
@akkuman
akkuman / action.yml
Last active Aug 20, 2021
我的github pages action
View action.yml
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build Akkuman Github Pages
on:
push:
branches:
- hugo
@akkuman
akkuman / dllmain.go
Created Aug 13, 2021 — forked from NaniteFactory/dllmain.go
An implementation example of DllMain() entrypoint with Golang. $ go build --buildmode=c-shared -o my.dll && rundll32.exe my.dll Test
View dllmain.go
package main
//#include "dllmain.h"
import "C"
@akkuman
akkuman / detect_browser_bot.py
Created Aug 5, 2021
[检测浏览器是否为爬虫] #爬虫 #python
View detect_browser_bot.py
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(
headless=False,
proxy={
'server': 'http://127.0.0.1:8080',
}
)
page = browser.new_page(java_script_enabled=True)
@akkuman
akkuman / rate_limit.py
Created Jul 22, 2021
[线程安全的第二类漏桶限流器] #python
View rate_limit.py
import threading
import time
import functools
import typing
class RateExceededException(Exception):
'''当频率超出限制时抛出该异常
Attributes:
@akkuman
akkuman / leaky_bucket.py
Last active Jul 20, 2021
[漏桶算法] 实现第一类漏桶算法 #python
View leaky_bucket.py
#ref: https://en.wikipedia.org/wiki/Leaky_bucket#As_a_meter
class RateLimitExceededException(Exception):
pass
class LeakyBucketRateLimiter:
'''漏桶算法实现
Attributes:
@akkuman
akkuman / supervisord.conf
Created Jul 20, 2021
[supervisor django celery样例] #python #supervisor #celery
View supervisord.conf
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
[supervisord]
nodaemon=true
pidfile=/var/run/supervisord.pid
logfile=/var/log/supervisord.log
@akkuman
akkuman / qq_mail_card.html
Created Jul 15, 2021
[qq邮箱资料卡] #html
View qq_mail_card.html
<html>
<body>
<div>
<hr align="left" style="margin: 0 0 10px 0; border: 0; border-bottom: 1px solid #e4e5e6; height: 0; line-height: 0; font-size: 0; padding: 20px 0 0 0; width: 50px;" />
<div style="font-size: 14px; font-family: Verdana; color: #000">
<a
class="xm_write_card" id="in_alias" style=" white-space: normal; display: inline-block; text-decoration: none !important; font-family: -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft YaHei;"
target="_blank"
>
@akkuman
akkuman / strip.py
Created Jul 6, 2021
[去除不可见字符] python中去除不可见字符 #python
View strip.py
# ref: https://stackoverflow.com/a/54451873
import sys
# build a table mapping all non-printable characters to None
NOPRINT_TRANS_TABLE = {
i: None for i in range(0, sys.maxunicode + 1) if not chr(i).isprintable()
}
def make_printable(s):