forked from supermy/mytools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
89 additions
and
24 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,20 @@ RUN apt-get update \ | |
|
||
|
||
# grab gosu for easy step-down from root | ||
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 | ||
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ | ||
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ | ||
&& gpg --verify /usr/local/bin/gosu.asc \ | ||
&& rm /usr/local/bin/gosu.asc \ | ||
&& chmod +x /usr/local/bin/gosu | ||
#RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 | ||
#RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ | ||
# && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ | ||
# && gpg --verify /usr/local/bin/gosu.asc \ | ||
# && rm /usr/local/bin/gosu.asc \ | ||
# && chmod +x /usr/local/bin/gosu | ||
|
||
|
||
# gpg: key 7F0CEB10: public key "Richard Kreuter <[email protected]>" imported | ||
RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10 | ||
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | ||
|
||
ENV MONGO_MAJOR 3.0 | ||
ENV MONGO_VERSION 3.0.1 | ||
ENV MONGO_VERSION 3.0.2 | ||
|
||
RUN echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/$MONGO_MAJOR main" > /etc/apt/sources.list.d/mongodb-org.list | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
docker build -t jamesmo/mongodb:3.0.1 . | ||
docker build -t jamesmo/mongodb:3.0.2 . |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
awk -f random_function.awk -f random_test.awk >1.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# 产生各类型数据随机函数 | ||
# chm, [email protected] | ||
# 2011/09/21 | ||
# | ||
# 产生随机整数, 其值大于等于min, 小于等于max | ||
function random_int(min, max) { | ||
return int( rand()*(max-min+1) ) + min | ||
} | ||
# 产生随机浮点数, 其整数部分位数最大为precision, 小数部分位数最大为scale | ||
function random_float(precision, scale) { | ||
scale = 10^scale; | ||
return int( rand()*(10^precision) ) + int( rand()*scale )/scale | ||
} | ||
# 产生长度为len的随机字符串 | ||
# opt为"lower"时, 产生由小写字母构成的随机字符串; opt为"upper"时, 产生由大写字母构成的随机字符串; opt为其它时, 产生大小写字母构成的随机字符串 | ||
function random_string(opt, len) { | ||
if (!is_define_T) { | ||
is_define_T = 1; | ||
T_LEN_LOWER = split("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", T_LOWER, ","); | ||
T_LEN_UPPER = split("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z", T_UPPER, ","); | ||
T_LEN_DEFAULT = split("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z", T_DEFAULT, ","); | ||
} | ||
|
||
if (opt == "lower") { | ||
return _random_string(len, T_LOWER, T_LEN_LOWER); | ||
} else if (opt == "upper") { | ||
return _random_string(len, T_UPPER, T_LEN_UPPER); | ||
} else { | ||
return _random_string(len, T_DEFAULT, T_LEN_DEFAULT); | ||
} | ||
} | ||
# 产生长度为len, 由字母表alphabet中的字母构成的随机字符串 | ||
function _random_string(len, alphabet, alphabet_len, _result, _i) { | ||
for (_i=0; _i<len; _i++) { | ||
_result = _result alphabet[ random_int(1, alphabet_len) ]; | ||
} | ||
return _result; | ||
} | ||
# 产生格式为format的随机日期时间值 | ||
# begin_time, end_time格式: YYYY MM DD HH MM SS[ DST] | ||
# format: 日期时间格式, 如"%Y-%m-%d %H:%M:%S" | ||
function random_time(begin_time, end_time, format) { | ||
begin_time = mktime(begin_time); | ||
end_time = mktime(end_time); | ||
return strftime(format, begin_time + random_int(1, end_time-begin_time+1)); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
BEGIN { | ||
# 设置AWK程序输出时各列的分隔符 | ||
OFS = "|"; | ||
srand(); | ||
#COUNT = 100000000; | ||
COUNT = 10000000; | ||
for (i=1; i<COUNT; i++) { | ||
print random_int(10, 100), random_float(3, 2), random_string("upper", 10), random_time("2009 06 01 12 30 30", "2011 07 15 23 59 59", "%Y-%m-%d %H:%M:%S"); | ||
} | ||
} |
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