Skip to content

Instantly share code, notes, and snippets.

View noname007's full-sized avatar
🐢
I may be slow to respond.

soul11201 noname007

🐢
I may be slow to respond.
View GitHub Profile
stop:
sudo /usr/local/nginx/sbin/nginx -s stop
start:
sudo /usr/local/nginx/sbin/nginx
restart: stop start
log:
xterm -e 'tail -f /usr/local/nginx/logs/*' &
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
@noname007
noname007 / grawb.js
Last active September 21, 2016 10:03
js 抓取页面 a标签,文本长度大于6
var as = document.getElementsByTagName('a');
var i = 0,j = as.length;
for(i=0;i<j;++i){
if(as[i].innerText !="" && as[i].innerText.length > 5)
console.log(i,as[i].href,as[i].innerText)
}
@noname007
noname007 / systemtap-on-rust
Created March 3, 2017 09:42 — forked from cuviper/systemtap-on-rust
SystemTap on Rust. This shows stap tracing function calls and returns for a simple hello.rs. Inspired by @bcantrill's DTrace example (https://gist.github.com/bcantrill/b7d031db6e35cfd79201). For annotated probe points, try https://github.com/cuviper/rust-libprobe.
$ uname -a
Linux laptop 3.10.0-123.13.2.el7.x86_64 #1 SMP Fri Dec 12 19:51:03 EST 2014 x86_64 x86_64 x86_64 GNU/Linux
$ rustc -Vv
rustc 1.0.0-alpha (44a287e6e 2015-01-08 17:03:40 -0800)
binary: rustc
commit-hash: 44a287e6eb22ec3c2a687fc156813577464017f7
commit-date: 2015-01-08 17:03:40 -0800
host: x86_64-unknown-linux-gnu
release: 1.0.0-alpha
$ cat hello.rs
<?php
function log_error_msg($msg)
{
print_r($msg);
$_log_message[] = $msg;
$info = debug_backtrace();
$space = str_repeat(' ',4);
foreach ($info as $i){
$file = isset($i['file']) ? $i['file'] : '';
@noname007
noname007 / ref.sh
Last active May 17, 2017 11:46
构建https证书
1030 cat /etc/pki/tls/openssl.cnf
# For the CA policy
[ policy_match ]
countryName = match
stateOrProvinceName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
@noname007
noname007 / _reader-macros.md
Created March 11, 2018 15:28 — forked from chaitanyagupta/_reader-macros.md
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

@noname007
noname007 / _reader-macros.md
Created March 11, 2018 15:28 — forked from chaitanyagupta/_reader-macros.md
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

#include
int main() {
double a = 0.58, *aptr = &a;
float af = 0.58, *afptr = &af;
printf(“%lu,%lx\n”,sizeof(a), *(long int *)aptr);
printf(“%lu,%x\n”,sizeof(af), *(int *)afptr);