Skip to content

Instantly share code, notes, and snippets.

View messense's full-sized avatar
🐢
I may be slow to respond on workdays.

messense messense

🐢
I may be slow to respond on workdays.
View GitHub Profile
@messense
messense / shadowsocks-on-openwrt.md
Last active June 8, 2023 07:49
shadowsocks on openwrt

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

@messense
messense / nox.diff
Last active January 12, 2023 03:04
pyo3 set minimal versions
commit 928e9be0cd2cddb52042c0ec9d88329779b0edf7
Author: messense <messense@icloud.com>
Date: Thu Jan 12 10:14:23 2023 +0800
Set minimal package versions by parsing Cargo.lock
diff --git a/noxfile.py b/noxfile.py
index d04824c26..1b39047bf 100644
--- a/noxfile.py
+++ b/noxfile.py
(.venv) root@ubuntu:~/code/self-limiters# gdb -c core.0.1736127.1665587962 python3
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
(.venv) root@ubuntu:~/code/self-limiters# gdb -c core.0.1716127.1665563188 python3
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@messense
messense / pytest.gdb
Last active July 9, 2022 06:10
pydantic-core pypy lldb
(lldb) target create "/Users/messense/.pyenv/versions/test-pypy/bin/python"
Current executable set to '/Users/messense/.pyenv/versions/test-pypy/bin/python' (x86_64).
(lldb) settings set -- target.run-args "-m" "pytest"
(lldb) r
Process 98393 launched: '/Users/messense/.pyenv/versions/test-pypy/bin/python' (x86_64)
Test session starts (platform: darwin, Python 3.9.12, pytest 7.1.2, pytest-sugar 0.9.4)
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=True warmup_iterations=100000)
rootdir: /Users/messense/Projects/pydantic-core, configfile: pyproject.toml, testpaths: tests
plugins: benchmark-3.4.1, hypothesis-6.48.1, timeout-2.1.0, mock-3.8.1, sugar-0.9.4
timeout: 30.0s
{
"packages": [
{
"name": "ahash",
"version": "0.7.6",
"id": "ahash 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"license": "MIT OR Apache-2.0",
"license_file": null,
"description": "A non-cryptographic hash function using AES-NI for high performance",
"source": "registry+https://github.com/rust-lang/crates.io-index",
@messense
messense / README.md
Last active June 22, 2021 15:59
Homebrew RocketMQ formulae

Homebrew RocketMQ formulae

brew install https://gist.github.com/messense/dc6132214cdea0a1a9c22a4da7d6349a/raw/b1f7e9c6bbeb533f98e09e685f72d228fba5bab3/rocketmq.rb
SIGQUIT: quit
PC=0x46f4c1 m=0 sigcode=0
goroutine 0 [idle]:
runtime.futex(0x3603aa8, 0x80, 0x0, 0x0, 0x7ffc00000000, 0x46f09c, 0xa10b06, 0x38b3487c, 0x7ffc5c0636e8, 0x40c01f, ...)
/usr/local/go/src/runtime/sys_linux_amd64.s:587 +0x21
runtime.futexsleep(0x3603aa8, 0x0, 0xffffffffffffffff)
/usr/local/go/src/runtime/os_linux.go:45 +0x46
runtime.notesleep(0x3603aa8)
/usr/local/go/src/runtime/lock_futex.go:159 +0x9f
@messense
messense / objectdict.py
Created April 12, 2014 03:37
Python ObjectDict
class ObjectDict(dict):
def __getattr__(self, key):
if key in self:
return self[key]
return None
def __setattr__(self, key, value):
self[key] = value
@messense
messense / absl-libcpp.diff
Created May 10, 2020 08:31
absl.pxd v.s. unordered_map.pxd
1c1
< from .utility cimport pair
---
> from libcpp.utility cimport pair
3,4c3,4
< cdef extern from "<unordered_map>" namespace "std" nogil:
< cdef cppclass unordered_map[T, U]:
---
> cdef extern from "absl/container/flat_hash_map.h" namespace "absl" nogil:
> cdef cppclass flat_hash_map[T, U]: