下载gcc最新版wgethttp://ftp.gnu.org/gnu/gcc/gcc-4.8.1/gcc-4.8.1.tar.gz然后解压到文件夹cd/home/machen/cpp/gcc-4.8.1./contrib/download_prerequisitescd..mkdirbuild_gcc_4.8.1cdbuild_gcc_4.8.1../gcc-4.8.1/configure--enable-checking=release--enable-languages=c,c+..
分类:
编程语言 时间:
2014-02-07 02:16:08
收藏:
0 评论:
0 赞:
0 阅读:
439
forfilein`ls`;dosed-e‘s/#include<ncurses\//#include</g‘$file>$file.bak;doneforfilein`ls`;domv${file}${file%%.bak*};done附录:按指定的字符串截取${varible##*string}从左向右截取最后一个string后的字符串${varible#*string}从左向右截取第一个string后的字符..
分类:
其他 时间:
2014-02-07 03:00:18
收藏:
0 评论:
0 赞:
0 阅读:
445
状态模式(二):下面的代码展示状态的自动切换//同样,定义状态接口publicinterfaceState{publicvoidactionA();publicvoidactionB();publicvoidactionC();//...}//实现多个状态publicclassStateAimplementsState{privateDemoObjectdemoObject;publicStateA(DemoObjectdemoObje..
分类:
其他 时间:
2014-02-07 03:36:08
收藏:
0 评论:
0 赞:
0 阅读:
309
find~-regex‘.*log$‘-execrm-f{}\;注意最后加一个空格和\;{}代表当前找到的文件名
分类:
其他 时间:
2014-02-07 01:26:08
收藏:
0 评论:
0 赞:
0 阅读:
427
#!/bin/bashfunctionusage(){echo"UsageExample:./install_start.sh-d/opt/modules/daemon-s2012-i192.168.0.1-p8080"echo"-dinstalldirectorypath";echo"-sdaemonbootstartport";echo"-icronhubcenterserver‘sipisusedfordownloaddaemon‘sjarandjdkandjsvcandsoon"echo"-pcron..
分类:
其他 时间:
2014-02-07 05:03:38
收藏:
0 评论:
0 赞:
0 阅读:
500
部署三台机器的replicaset,首先在三台机器都放置配置文件于/etc/mongo.conf:这个configurationfile的描述见网页:http://docs.mongodb.org/manual/reference/configuration-options/然后启动./mongod--config/etc/mongo.conf接着敲入mongo192.168.2.161进入命令行:cfg={"_id..
分类:
数据库技术 时间:
2014-02-07 01:32:48
收藏:
0 评论:
0 赞:
0 阅读:
399
1.如果在编辑一个python代码文件中,想切换出来编辑另一个文件(编辑test1.py后切换出来编辑../test2.py)不用每次:wq出来在vim另一个文件可以在当前vim中敲:e../test2.py现在打开了两个py文件(第一个切换前的在buffer缓冲区里)第二个py文件编辑完了,再切换回去,敲入:ls查..
分类:
其他 时间:
2014-02-07 04:11:08
收藏:
0 评论:
0 赞:
0 阅读:
348
db.user_profile.find({$where:"this.disk_rack.length>1"})但是这种js引擎执行的会非常慢更好的办法是CreateextrafieldNamesArrayLength,updateitwithnamesarraylengthandthenuseinqueries:db.accommodations.find({"NamesArrayLength":{$gt:1}});Itwillbebettersolution,a..
分类:
数据库技术 时间:
2014-02-07 00:40:18
收藏:
0 评论:
0 赞:
0 阅读:
1224
我想find到mongo中的synonym_titles下面的嵌套子json下的影片名字段或者real_titles下面的嵌套子json下的影片名字段:但是1,2这个info信息字段不确定所以我想这么查询:db.search_correct_synonym.find({"synonym_titles.*":"联邦调查局"})但是失败了,这种查询是告诉mongo,我..
分类:
数据库技术 时间:
2014-02-07 04:20:18
收藏:
0 评论:
0 赞:
0 阅读:
1990
由于ubuntu中在root权限下调用visudo使用的是nano这个编辑器这里的^O就表示ctrl+o,保存
分类:
其他 时间:
2014-02-07 03:41:08
收藏:
0 评论:
0 赞:
0 阅读:
794
1.获取某个属性最大的value值并自增范例因为mongo不支持类似selectmax操作,也不支持递增int的操作,所以采用目前的方案#找到符合table_name的记录,find输出时只输出type_id,按照type_id递减排序,取到第一个max_obj=stmt.find({"table_name":table_name},{"type_id":1}).sort..
分类:
数据库技术 时间:
2014-02-07 02:31:58
收藏:
0 评论:
0 赞:
0 阅读:
461
系统是centos5搜了一下,要装curl的,可是俺已经装了啊?卸载git,再装,再试,无意中发现一个提示,没有权限执行git-remote-https,啊哈?找到这个文件所在目录/usr/libexec/git-core,加入到PATH里头,搞定!
分类:
其他 时间:
2014-02-07 05:12:48
收藏:
0 评论:
0 赞:
0 阅读:
388
1.杀死进程./mongod--shutdown--dbpath/opt/data/mongokillingprocesswithpid:44302.mongo的分片启动简介比如在三台机器上依次使用下面的命令启动:./mongod--fork--shardsvr--port27018--replSetshard2--dbpath/opt/data/shard2--logpath/opt/data/shard2/shard2.log--rest--l..
分类:
数据库技术 时间:
2014-02-07 04:29:28
收藏:
0 评论:
0 赞:
0 阅读:
601
注意update_time字段是datetime类型的SELECTupdate_timeFROMv_videosWHEREupdate_timeBETWEEN‘2013-02-0610:35:36‘AND‘2013-02-2314:20:36‘
分类:
数据库技术 时间:
2014-02-07 00:23:38
收藏:
0 评论:
0 赞:
0 阅读:
544
先用ps得到进程pid号.假定为51642种方法获取到他的父进程pid1.使用/etc/proc文件夹[root@hadoop-node-15p_w_picpath]#cat/proc/5164/stat5164(python)S15118113783482211448420256011510001111200150107185126532093465604256184467440737095516154194304561764414073467277619..
分类:
其他 时间:
2014-02-07 00:55:18
收藏:
0 评论:
0 赞:
0 阅读:
539
[root@pachongyum-3.2.28]#yumsearchwwwLoadedplugins:fastestmirrorDeterminingfastestmirrorsYumRepoError:AllmirrorURLsarenotusingftp,http[s]orfile.Eg.</html>/removingmirrorlistwithnovalidmirrors:/var/cache/yum/x86_64/6/base/mirrorlist.txtError:Cannotfind..
分类:
其他 时间:
2014-02-07 01:42:48
收藏:
0 评论:
0 赞:
0 阅读:
327
需求:我的www.cronhub.com域名需要指向到我租的服务器上,该服务器的80端口已经运行一个论坛的服务了。先敲入lsof-i:80,查看pid,确定apache装在哪COMMANDPIDUSERFDTYPEDEVICESIZENODENAMEhttpd2761root3uIPv610248TCP*:http(LISTEN)httpd15599daemon3uIPv610248TCP*:http(LI..
分类:
其他 时间:
2014-02-07 02:21:58
收藏:
0 评论:
0 赞:
0 阅读:
468
用kill命令发送一个信号0去检测,别用ps-efpid|grep,会有误判的存在!先决条件.进程id要写入pid文件,python做法defwrite_pidfile(pidfile):ifos.path.isfile(pidfile):withopen(pidfile,‘r‘)asf:old_pid=f.readline()ifold_pid:old_pid=int(old_pid)try:os.kill(old_pid,0)ex..
分类:
其他 时间:
2014-02-07 03:05:18
收藏:
0 评论:
0 赞:
0 阅读:
510
2013年工作的最后一天,准备把手机支付宝的安全功能做全面的了解,把手机进行刷机,已保证安全性。
分类:
其他 时间:
2014-02-07 03:40:18
收藏:
0 评论:
0 赞:
0 阅读:
338
WindowsServer2008的无线网卡不工作,还以为是驱动没装好,在网上查资料,发现需要安装Windows无线LAN服务才能使无线网卡工作。
分类:
Windows开发 时间:
2014-02-07 00:22:48
收藏:
0 评论:
0 赞:
0 阅读:
654