- Connect to network host over TCP connection
This file contains 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
# get processes with related threads | |
ps -eLf |grep "process name" | |
# list all opened file descriptors in a process PID and under which thread | |
lsof -aKp PID | |
# trace syscalls in a process's main thread or other thread PID | |
strace -p PID |
This file contains 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
#include "Python.h" | |
PyTypeObject * create_type(const char * name){ | |
PyObject * args, * dict, * value; | |
PyTypeObject * type; | |
args = PyTuple_New(3); | |
PyTuple_SetItem(args, 0, PyUnicode_FromString(name)); |
This file contains 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
var tables = document.getElementsByTagName('table'); | |
for(var i=0; i < tables.length; i ++) { | |
for(var j=0; j < tables[i].childNodes[0].childNodes.length; j++){ | |
if(j == 0) { | |
console.log('====' + tables[i].childNodes[0].childNodes[j].innerText + '====='); | |
} | |
else { | |
console.log(tables[i].childNodes[0].childNodes[j].childNodes[0].innerText, tables[i].childNodes[0].childNodes[j].childNodes[1].innerText); | |
} |
This file contains 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
load data infile 'src.csv' into table dest_table FIELDS TERMINATED BY ',' ENCLOSED BY '"'; |
- File Record lock
As well as being removed by an explicit F_UNLCK, record locks are automatically released when the process terminates or if it closes any file descriptor referring to a file on which locks are held. This is bad: it means that a process can lose the locks on a file like /etc/passwd or /etc/mtab when for some reason a library function decides to open, read and close it.
Record locks are not inherited by a child created via fork(2), but are preserved across an execve(2).
Because of the buffering performed by the stdio(3) library, the use of record locking with routines in that package should be avoided; use read(2) and write(2) instead.
This file contains 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
(defun load-protobuf () | |
"Load protobuf." | |
(add-to-list 'load-path "~/.emacs.d/el-get/protobuf-mode") | |
(require 'protobuf-mode) | |
(add-to-list 'auto-mode-alist '("\\.proto\\'" . protobuf-mode)) | |
(add-hook 'protobuf-mode-hook (lambda () (auto-complete-mode))) | |
) |
This file contains 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
drop table if exists s_user_table; | |
create table s_user_table ( | |
id int, | |
user_id int | |
); | |
drop table if exists s_user_cnt_table; | |
create table s_user_cnt_table ( |
NewerOlder