Skip to content

Instantly share code, notes, and snippets.

View lujb's full-sized avatar
🎯
Focusing

Kingbo lujb

🎯
Focusing
View GitHub Profile
@lujb
lujb / multiple_ssh_setting.md
Created January 2, 2018 02:35 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# recent-access-stat
# 通过解析 Nginx 访问日志,统计最近几日业务访问量
#
# 原理:将待处理的总日志量按 Buffer_Size 分割成多个小块,然
# 后平均分给多个进程并行解析处理,最后合并统计数据。
#
# lujingbo@360.cn
var _ = require('underscore');
var special_words = ["Fizz", "Buzz", "Whizz"];
var candidates = seq(9); // 1..9
// select 3 random numbers from candidates.
var special = _(3).times(function(i) {
var selected = candidates[_.random(candidates.length-1)];
candidates = _.without(candidates, selected);
return selected;
#curl -H "Accept/X-Requested-With/Cookie/Referer" http://www.simsimi.com/func/req?msg=hello&lc=ch
curl -H "Accept: application/json, text/javascript, */*; q=0.01" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36" -H "Cookie: sagree=true; selected_nc=ch; JSESSIONID=C2BD358F72447923A47338265045B62D; AWSELB=15E16D030EBAAAB8ACF4BD9BB7E0CA8FB501388662640BCEC6E9C54E70B150AA8514D30E844A0F6781F3C00BEC43069730243F418119D4A1660F073D105DD873991975B881; __utma=119922954.1581747215.1382876735.1382876756.1382964833.3; __utmb=119922954.2.10.1382964833; __utmc=119922954; __utmz=119922954.1382876735.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)" -H "Referer: http://www.simsimi.com/talk.htm" http://www.simsimi.com/func/req?msg=hello&lc=ch
@lujb
lujb / conf.erl
Created September 6, 2013 06:18
Consult Erlang Conf String.
%%
%% Consult erlang conf string, same as file:consult/1.
%%
-module(conf).
-export([consult/1]).
consult(Str) when is_list(Str) ->
scan(Str).
@lujb
lujb / conf_prettypr.erl
Last active December 22, 2015 06:59
Erlang Conf Pretty Print..
-module(conf_prettypr).
%-export([format_from_file/1]).
-export([format/1, format/2]).
-define(FORMAT_ADVICE, "%% @remove. ").
%% read from file.
% format_from_file(F) ->