Skip to content

Instantly share code, notes, and snippets.

View node's full-sized avatar
🎨
Focus on open source & platform !

Chris (Gentle) Y杨 node

🎨
Focus on open source & platform !
View GitHub Profile
@node
node / rustc-issue.md
Created January 25, 2022 03:54
手动执行 rustc 和 程序调用 rustc 的区别是什么?

手动编译

一切正常 rustc xx.rs ,编译后可执行文件也运行正常。

在某系统中通过程序调用 rustc

编译报错

"catalina-exec-35" daemon prio=10 tid=0x00007fdb08020800 nid=0x887a waiting on condition [0x00007fdabedeb000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007f0ca71c8> (a org.elasticsearch.common.util.concurrent.BaseFuture$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:276)
at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:116)
@node
node / client2.c
Last active August 27, 2015 02:24 — forked from yongboy/client2.c
gcc -o client2 client2.c -levent; run:./client2 -h 192.168.190.180 -p 8000 -o 192.168.190.150,192.168.190.143,192.168.190.144,192.168.190.145,192.168.190.146,192.168.190.147,192.168.190.148,192.168.190.149,192.168.190.151,192.168.190.152
#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
#include <stdlib.h>
#include <err.h>
#include <event.h>
#include <evhttp.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
@node
node / Similarity Measure
Last active December 15, 2015 19:20
Data
#!/usr/bin/env python
# ref. https://github.com/saimadhu-polamuri/DataAspirant_codes/blob/master/Similarity_measures/similaritymeasures.py
# ref. http://hi.baidu.com/uu_master/item/0b89469b42adef9bcd80e5e8
from math import*
from decimal import Decimal
class Similarity():
@node
node / 常用命令和操作
Last active January 4, 2016 18:29
DATABASE SQL NOSQL KEY-VALUE
全复制数据库
mysqldump -hlocalhost -uroot -ppasswpord database1_source --opt | mysql -hlocalhost -uroot -ppassword database2_desctination
@node
node / circos
Last active January 1, 2016 07:09
Data visualization
circos in D3.js
https://github.com/soundsuggest/example-d3js/tree/master/circos
circos.js
https://code.google.com/p/chaos-somanayr/source/browse/trunk/Circos/JavaScript/circos.js?r=22
@node
node / learn git in 15 minutes
Created December 24, 2013 01:55
SCM & Tools
参考 http://blog.jobbole.com/53573/
目录:
创建一个远程的空代码库(在BitBucket上或Github上)
在本地代码库添加一个项目
在分支上开发新功能
a) 保留新功能 或者 b) 丢弃它们
也许,回到某个早先的时间点
将本地代码库推送到远程代码库
server {
listen 80;
server_name ww.centos.bz;
rewrite ^(.*) https://$server_name$1 permanent;
}
@node
node / python-oauth2-client-by-rauth.py
Created September 21, 2012 02:04
Python Oauth2 Client Demo
from rauth.service import OAuth2Service
import urllib2
#config
app_key='tonr'
app_secret='secret'
authorize_url='http://127.0.0.1:8080/TestSSOauth/oauth/authorize'
access_token_url='http://127.0.0.1:8080/TestSSOauth/oauth/token'
@node
node / 关于STUN-TURN-ICE 等协议及其参考实现
Last active November 19, 2015 09:37
About NAT,STUN,TURN,ICE,SIP,XMPP,RTP,TCP,UDP
STUN ======
协议 RFC5389 http://www.ietf.org/rfc/rfc5389.txt
【旧版本】RFC3489 http://www.ietf.org/rfc/rfc3489.txt
实现
Stun4j http://code.google.com/p/babbly/source/browse/trunk/lib/Stun4J.jar, a library