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 / 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 / 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]:
@messense
messense / Dockerfile
Created February 23, 2020 16:25
Build a Rust & Valgrind Docker image for testing FFI bindings
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y curl valgrind build-essential clang
# Install Rust
ENV RUST_VERSION=stable
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=$RUST_VERSION
# Install cargo-valgrind
RUN /bin/bash -c "source /root/.cargo/env && cargo install cargo-valgrind"
@messense
messense / gfwlist.conf
Created July 9, 2017 15:21
dnsmasq.d/gfwlist.conf
server=/.google.com.tw/208.67.222.222#443
ipset=/.google.com.tw/gfwlist
server=/.google.com.sg/208.67.222.222#443
ipset=/.google.com.sg/gfwlist
server=/.google.co.jp/208.67.222.222#443
ipset=/.google.co.jp/gfwlist
server=/.blogspot.com/208.67.222.222#443
ipset=/.blogspot.com/gfwlist
server=/.blogspot.sg/208.67.222.222#443
ipset=/.blogspot.sg/gfwlist