代码改变世界

[ZZ] GreenPlum Admin Notes

2013-09-04 16:03 by 三犬风, 320 阅读, 0 推荐, 收藏, 编辑
摘要:Greenplum 日常维护手册 (汇总、点评、备查)1.数据库启动:gpstart常用可选参数: -a : 直接启动,不提示终端用户输入确认 -m:只启动master 实例,主要在故障处理时使用2.数据库停止:gpstop:常用可选参数:-a:直接停止,不提示终端用户输入确认 -m:只停止master 实例,与gpstart –m 对应使用 -M fast:停止数据库,中断所有数据库连接,回滚正在运 行的事务-u:不停止数据库,只加载pg_hba.conf 和postgresql.conf中运行时参数,当改动参数配置时候使用。评:-a用在shell里,最多用的还是-M fast。3.查... 阅读全文

[ZZ] The architecture of Graphite

2013-09-04 00:23 by 三犬风, 374 阅读, 0 推荐, 收藏, 编辑
摘要:refer to:http://www.aosabook.org/en/graphite.htmlGraphiteChris DavisGraphite1performs two pretty simple tasks: storing numbers that change over time and graphing them. There has been a lot of software written over the years to do these same tasks. What makes Graphite unique is that it provides this 阅读全文

[Perl] useless use of a constant in a void context

2013-09-03 10:57 by 三犬风, 1154 阅读, 0 推荐, 收藏, 编辑
摘要:Do you understand context? It freaked me out once or fifty times too. =) When perl is compiling your code, it looks at structures like these and decides on what "context" codehere() is in:codehere(); #void context $c=codehere(); #scalar context ($l)=codehere(); #list context @a=codehere(); 阅读全文

[ZZ] Shell编程中的几个内建命令

2013-08-23 10:44 by 三犬风, 280 阅读, 0 推荐, 收藏, 编辑
摘要:bash命令解释套装程序包含了一些内部命令。内部命令在目录列表时是看不见的,它们由Shell本身提供。常用的内部命令有:echo,eval,exec,export,readonly,read,shift,wait和点(.)。 1.echo 命令格式:echoarg 功能:在屏幕上显示出由arg指定的字串。 2.eval 命令格式:evalargs 命令eval的功能是將参数(args)读入 C shell 中,然后在加以执行。例如:101# set vcom = 'ls -l ; date'102# $vcom ; not found date not found在命令 101 阅读全文

Ganglia Install

2013-08-22 14:07 by 三犬风, 165 阅读, 0 推荐, 收藏, 编辑
摘要:1. Install with make installhttp://sourceforge.net/apps/trac/ganglia/wiki/Ganglia%203.1.x%20Installation%20and%20Configuration#installationYou will need to isntall other dependencies such as rrdtool2. Once-for-allCheck your redhat version with cat /etc/redhat-release(Version: 5)rpm -Uvhhttp://dl.fed 阅读全文

[ZZ]perl一揽子特殊变量

2013-07-26 15:56 by 三犬风, 186 阅读, 0 推荐, 收藏, 编辑
摘要:$- 当前页可打印的行数,属于Perl格式系统的一部分$! 根据上下文内容返回错误号或者错误串$” 列表分隔符$# 打印数字时默认的数字输出格式$$ Perl解释器的进程ID$% 当前输出通道的当前页号$& 与上个格式匹配的字符串$( 当前进程的组ID$) 当前进程的有效组ID$* 设置1表示处理多行格式.现在多以/s和/m修饰符取代之.$, 当前输出字段分隔符$. 上次阅读的文件的当前输入行号$/ 当前输入记录分隔符,默认情况是新行$: 字符设置,此后的字符串将被分开,以填充连续的字段.$; 在仿真多维数组时使用的分隔符.$? 返回上一个外部命令的状态$@ Perl解释器从eval语 阅读全文

string vector: push_back() and back()

2013-05-24 17:37 by 三犬风, 977 阅读, 0 推荐, 收藏, 编辑
摘要:在解析基于键值对的配置文件时,常常需要将key和value解析出来作为其它函数的两个参数去做进一步的操作。下面的代码演示了如何运用vector<string>作为载体存储解析出来的key和value:// 解析 key = valuestd::string input = "key = value";int tokensize = 0;typedef std::vector<std:string> string_vector_t;string_vector_t token;tokens.push_back(""); // 添加空s 阅读全文

[ZZ]linux mmap 内存映射

2013-05-21 14:55 by 三犬风, 344 阅读, 0 推荐, 收藏, 编辑
摘要:转一篇关于mmap的博文,写的比较让人明白,稍微解释下最后一个例子的工作流程:buf[0] = '0' ---> Slave: +1 ---> buf[0] = 1; Master: +1 ---> buf[0]=2, Slave: job_hello, buf[0]=3 ---> Master: +1, buf[0]=4 ---> Slave: job_smile, buf[0]=5 ---> Master: +1, buf[0] = 6 --->Slave: job_bye, buf[0]=7 ---> ....linux m 阅读全文

[ZZ]Install Firefox 20 on Fedora 18/17, CentOS/Red Hat (RHEL) 6.4

2013-05-20 09:36 by 三犬风, 444 阅读, 0 推荐, 收藏, 编辑
摘要:Install Mozilla Firefox 20/10 on Fedora 18/17/16/15/14, CentOS 6.4/6.3/6.2/6.1/6/5.9 and Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.91. Backup your current Firefox 3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19 profiles (just in case)tar -cvzf $HOME/mozilla-firefox-profiles-backup.tar.gz $HOME/.mozilla/firefox 阅读全文

Makefile新手入门:How to write Makefile

2013-05-07 14:42 by 三犬风, 462 阅读, 0 推荐, 收藏, 编辑
摘要:I've always thought this was easier to learn with a detailed example, so here's how I think of makefiles. For each section you have one line that's not indented and it shows the name of the section followed by dependencies. The dependencies can be either other sections (which will be run 阅读全文