This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define GET_TSTATE() \ | |
((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) | |
#define SET_TSTATE(value) \ | |
_Py_atomic_store_relaxed(&_PyThreadState_Current, (Py_uintptr_t)(value)) | |
PyThreadState * | |
PyThreadState_Swap(PyThreadState *newts) | |
{ | |
PyThreadState *oldts = GET_TSTATE(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mac vnc连接ubuntu | |
1 on ubuntu | |
sudo apt-get install x11vnc | |
x11vnc -storepasswd | |
x11vnc -forever -shared -rfbauth ~/.vnc/passwd | |
2 on mac | |
右键 访达-> 连接到 vnc://x.x.x.x:5900 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class rw_spin_lock | |
{ | |
public: | |
rw_spin_lock() | |
{ | |
_readers = 0; | |
} | |
public: | |
void acquire_reader() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -L https://github.com/coreos/etcd/releases/download/v3.3.1/etcd-v3.3.1-linux-amd64.tar.gz -o etcd-v3.3.1-linux-amd64.tar.gz | |
tar xzvf etcd-v3.3.1-linux-amd64.tar.gz | |
cd etcd-v3.3.1-linux-amd64 | |
sudo cp etcd /usr/local/bin/ | |
sudo cp etcdctl /usr/local/bin/ | |
etcd --version |