Skip to content

Instantly share code, notes, and snippets.

# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816533
# start at server side(ssh)
xpra start --no-daemon --xvfb="/usr/bin/Xvfb +extension Composite -screen 0 3840x2560x24+32 -nolisten tcp -noreset" --start=/usr/bin/code
@DavidPu
DavidPu / sed_cheatsheet.md
Last active September 26, 2017 16:41
sed cheatsheet
#!/bin/bash
set -euo pipefail
# readonly SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
function process() {
python - << END_OF_PY_CODE
import os
@DavidPu
DavidPu / hotkeys.md
Last active December 28, 2017 18:52

Windows

move window between monitors

WIN+SHIFT+ARROW

Chrome

address bar

F6

switch tab

CTRL+TAB

@DavidPu
DavidPu / pyenv_mgr.sh
Last active March 16, 2018 01:34
manage python environment
#!/bin/bash
# download differnet python versions..
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
export PATH=~/.pyenv/bin:$PATH
pyenv install 3.6.4
pyenv install 2.7.14
# create Python 3 environment:
export PYTHONHOME=~/.pyenv/versions/3.6.4
~/.pyenv/versions/3.6.4/bin/python -m venv <my_py_env_folder>
XTerm*faceName: Bitstream Vera Serif Mono
xterm*faceSize: 11
xterm*vt100*geometry: 80x60
xterm*saveLines: 16384
xterm*loginShell: true
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*termName: xterm-color
xterm*eightBitInput: false
!BLK Cursor
self.session = requests.Session()
self.session.verify = True
# get the cert:
# openssl s_client -connect www.google.com:443 -showcerts > google.ca
# apend the last cert into $(dirname $(which python))/../lib/python*/site-packages/certifi/cacert.pem
diff --git a/Modules/Setup.dist b/Modules/Setup
index e469d5e..3fea7df 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -387,3 +387,12 @@ _symtable symtablemodule.c
# Another example -- the 'xxsubtype' module shows C-level subtyping in action
xxsubtype xxsubtype.c
+
+SSL=$(srcdir)/openssl
@DavidPu
DavidPu / build_clang-tidy.sh
Last active May 5, 2019 18:40
build_clang-tidy.sh
set -xeuo pipefail
readonly SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
SRC_ROOT=${SCRIPT_DIR}/src
mkdir -p ${SRC_ROOT}
cd ${SRC_ROOT}
git clone https://git.llvm.org/git/llvm.git
cd llvm/tools
git clone https://git.llvm.org/git/clang.git
cd clang/tools