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 / jsonserializer.py
Created May 7, 2014 12:32
Patch django.core.signing.JSONSerializer to support mongodb ObjectId serialization.
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from bson import json_util as json
class JSONSerializer(object):
"""
Simple wrapper around json to be used in signing.dumps and
signing.loads.
"""
@messense
messense / rk.py
Created October 10, 2015 06:41
若快验证码
#!/usr/bin/env python
# coding:utf-8
import requests
from hashlib import md5
class RClient(object):
def __init__(self, username, password, soft_id, soft_key):
self.username = username
@messense
messense / sim_taobao.py
Created October 10, 2015 06:46
模拟登录淘宝
# -*- coding: utf-8 -*-
import os
import re
import json
import pickle
import logging
import logging.config
import requests
@messense
messense / npm-debug-2016-11-14.log
Created November 14, 2016 07:51
npm-debug-2016-11-14.log
This file has been truncated, but you can view the full file.
npm ERR! registry error parsing json
npm ERR! Linux 3.14.32-xxxx-grs-ipv6-64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--loglevel=warn"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! Unexpected token < in JSON at position 0
npm ERR! <html>
npm ERR! <head><title>400 Bad Request</title></head>
npm ERR! <body bgcolor="white">

Keybase proof

I hereby claim:

  • I am messense on github.
  • I am messense (https://keybase.io/messense) on keybase.
  • I have a public key whose fingerprint is 1961 A032 8346 7E2B 2FA2 BD15 BB41 A8A2 C716 CCA9

To claim this, I am signing this object:

@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
@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 / 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]:
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 / 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