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

编译报错

@node
node / linux tips & hacks
Last active December 28, 2016 09:56
utility
- 下载整站
> wget -r -p -np -k http://xxoo.com
注释: -r 递归, -p 下载网页关联的其他资源,-np 不搜索上层目录, -k 绝对链接转为相对链接
其他参数:
  ◆-b:后台下载,Wget默认的是把文件下载到当前目录。
  ◆-O:将文件下载到指定的目录中。
  ◆-P:保存文件之前先创建指定名称的目录。
  ◆-t:尝试连接次数,当Wget无法与服务器建立连接时,尝试连接多少次。
  ◆-c:断点续传,如果下载中断,那么连接恢复时会从上次断点开始下载。
@node
node / Chrome 模拟 手机浏览器做测试
Created December 9, 2011 08:19
Chrome 模拟 手机浏览器做测试
内容来自 http://blog.s135.com/chrome_phone/
谷歌Chrome浏览器,可以很方便地用来当3G手机模拟器。在Windows的【开始】-->【运行】中输入以下命令,启动谷歌浏览器,即可模拟相应手机的浏览器去访问3G手机网页:
  谷歌Android:
chrome.exe --user-agent="Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
  苹果iPhone:
chrome.exe --user-agent="Mozilla/5.0 (iPad; U; CPU OS 3_2_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B500 Safari/531.21.10"
"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 / 常用命令和操作
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 / 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 / 关于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