Skip to content

Instantly share code, notes, and snippets.

View pengwk's full-sized avatar
🎯
Focusing

peng weikang pengwk

🎯
Focusing
  • Guangzhou China
View GitHub Profile
(gdb) bt
#0 0x000000000001956e in ?? ()
#1 0x00007ffff59f7d69 in SSL_load_error_strings () from /usr/local/lib/python2.7/dist-packages/mysql-vendor/libssl.so.1.0.0
#2 0x00007ffff4fc8c1d in init_ssl () at /build/python2.7-dPs3Rr/python2.7-2.7.12/Modules/_ssl.c:3971
#3 0x000000000051a911 in _PyImport_LoadDynamicModule () at ../Python/importdl.c:53
#4 0x00000000004a4ae1 in import_submodule.lto_priv () at ../Python/import.c:2722
#5 0x00000000004a42c9 in load_next (p_buflen=<synthetic pointer>, buf=0xb1f760 "_ssl", p_name=<synthetic pointer>,
altmod=<optimized out>, mod=<optimized out>) at ../Python/import.c:2537
#6 import_module_level.isra.3 (level=0, fromlist=None, globals=<optimized out>, name=<optimized out>) at ../Python/import.c:2246
#7 PyImport_ImportModuleLevel () at ../Python/import.c:2310
In [150]: d = u'\xe7\xac\x91\xe5\x8f\xa3\xe5\xb8\xb8\xe5\xbc\x80'
In [151]: d
Out[151]: u'\xe7\xac\x91\xe5\x8f\xa3\xe5\xb8\xb8\xe5\xbc\x80'
In [152]: d.decode('string_escape')
---------------------------------------------------------------------------
UnicodeEncodeError Traceback (most recent call last)
<ipython-input-152-0f9f72da24b9> in <module>()
----> 1 d.decode('string_escape')
@pengwk
pengwk / Unicode中文和特殊字符的编码范围
Created October 22, 2018 08:04 — forked from shingchi/Unicode中文和特殊字符的编码范围
Unicode中文和特殊字符的编码范围
根据Unicode5.0整理如下:
1)标准CJK文字
http://www.unicode.org/Public/UNIDATA/Unihan.html
2)全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母:FF00-FFEF
http://www.unicode.org/charts/PDF/UFF00.pdf
3)CJK部首补充:2E80-2EFF
http://www.unicode.org/charts/PDF/U2E80.pdf
@pengwk
pengwk / tmux-cheatsheet.markdown
Created January 2, 2019 10:02 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@pengwk
pengwk / tmux-panes.sh
Created February 22, 2019 13:29 — forked from dmckean/tmux-panes.sh
A combination of the tmux commands: list-sessions list-windows and list-panes
#! /usr/bin/env bash
hi_color=$(tput setaf 4) #blue
bold=$(tput bold)
underline=$(tput smul)
normal=$(tput sgr0)
read -r -d '' usage << DOC
Prints out a table of tmux sessons, windows, and panels.
@pengwk
pengwk / adventures-in-python-core-dumping.md
Created December 29, 2019 12:51 — forked from toolness/adventures-in-python-core-dumping.md
Adventures in Python Core Dumping

Adventures in Python Core Dumping

After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.