摘要:用U盘安装centos成功后 发现grub出问题了grub> root (hd0,0)grub> setup (hd0)grub> reboot
阅读全文
摘要:# debian系统vim /etc/hostname# rh系统vim /etc/sysconfig/newowork# 修改HOSTNAME# 然后记得修改 /etc/hosts127.0.0.1 <hostname> localhost
阅读全文
摘要:静态库libdemo.h1 // libdemo.h2 #ifndef _LIBDEMO_H3 #define _LIBDEMO_H4 5 void demo_call(char *msg);6 7 #endiflibdemo.c1 // libdemo.c2 #include "libdemo.h"3 #include <stdio.h>4 5 void demo_call(char *msg)6 {7 printf("%s\n",msg);8 }编译库文件# 编辑成目标文件gcc -c libdemo.c -o libdemo.o# 创建
阅读全文
摘要:ifconfig eth0 xxx.xxx.xxx.xxx netmask 255.255.255.0
阅读全文
摘要:开发一般使用svn下的 /brachces下的某个目录线上发布为 /trunk之前一直使用windows下的svn进行合并# 本地为 http://yoursvndomain/trunksvn merge -r 43:67 http://yoursvndomain/branches/current .
阅读全文
摘要:今天有问题报过来说linux平台下 fgetcsv处理的有空数据产生起初以为中php版本问题,其实和版本没有关系 在window下开发的同事都没有问题 而自己的本本和服务器上,和使用linux系统的同事 都出现空数据的问题google一下设置区域:简体中文,UTF-8编码setlocale(LC_ALL, 'zh_CN.UTF-8');
阅读全文
摘要:tag2txt 只生成单个html文档,比较合适写一些api或接口的文档,如果做大项目文档还是想使用sphinx安装(需要安装python和easy_install)easy_install sphinx生成一个项目(按向导进行)sphinx-quickstart生成的文件&目录-rw-r--r-- 1 bluefrog bluefrog 7670 2012-05-28 16:32 conf.py-rw-r--r-- 1 bluefrog bluefrog 417 2012-05-28 16:32 index.rst-rw-r--r-- 1 bluefrog bluefrog 5092
阅读全文
摘要:Javascripthtml.erb<!-- 本地目录(public) --><%= javascript_include_tag "main" %><!-- 本地多级目录(public) --><%= javascript_include_tag "photos/columns" %><!-- 远程js链接 --><%= javascript_include_tag "http://example.com/main.js" %>html<script sr
阅读全文
摘要:载入模板文件# 载入app/views/<controllername>/edit.html.erbrender :editrender :action => :editrender 'edit'render 'edit.html.erb'render :action => 'edit'render :action => 'edit.html.erb'# 载入app/views/books/edit.html.erbrender 'books/edit'render 'book
阅读全文
摘要:APT安装sudo apt-get install postgresql postgresql-client-common(注: 我的机器会卡死在 "正在设置 postgres92 (9.2.0-b1) ...")源码安装wget http://ftp.postgresql.org/pub/source/v9.2.0beta1/postgresql-9.2beta1.tar.bz2tar -xvf postgresql-9.2beta1.tar.bz2cd postgresql-9.2beta1./configuresudo make && make ins
阅读全文
摘要:mount -o loop CentOS-5.5-i386-bin-DVD.iso /var/www/centos127.0.0.1/centos 查看
阅读全文
摘要:程序很多情况会需要写临时文件大多数会使用如果方式:tempnam("/tmp","filename");但是/tmp不一定能写....,可以改成tempnam(sys_get_temp_dir(),"filename");
阅读全文
摘要:创建git库mkdir projectnamecd projectnamegit init添加文件git add <filename>删除文件git rm <filename>向版本库提交变化git commit -m"<commit content>"将本地分支内容提交到远程分支git push uername@domain:projectname.git查看git库状态git status查看分支git branch <branchname>切换分支git checkout <branchename>删除分支g
阅读全文
摘要:1 -module(socket_example). 2 -compile(export_all). 3 4 nano_get_url() -> 5 nano_get_url("www.google.com"). 6 7 nano_get_url(URL) -> 8 {ok,Socket} = gen_tcp:connect(URL,80,[binary,{packet,0}]), 9 ok = gen_tcp:send(Socket,"GET / HTTP/1.0\r\n\r\n"), 10 receive_data(Socket,[]..
阅读全文
摘要:sudo gem install wxruby测试是否安装成功:bluefrog@bluefrog-laptop:~/code/ruby$ irbirb(main):001:0> require "wx"LoadError: no such file to load -- wx from (irb):1:in `require' from (irb):1 from :0irb(main):002:0> 如果出现以上问题请先require "rubygems"irb(main):002:0> require "rubyg
阅读全文
摘要:FROM:http://www.erlang.se/euc/07/papers/1700Carlsson.pdfalpha.erl 1 -module(alpha,[X,Y]). 2 -export([a/0,b/1,c/2]). 3 4 a() -> 5 {?MODULE,a,[X,Y],[]}. 6 7 b(S) -> 8 {?MODULE,b,[X,Y],[S]}. 9 10 c(S,T) ->11 {?MODULE,c,[X,Y],[S,T]}.运行结果:Eshell V5.8.4 (abort with ^G)1> c(alpha).{ok,alpha}...
阅读全文
摘要:1 -module(test_mnesia). 2 -compile(export_all). 3 4 -include_lib("stdlib/include/qlc.hrl"). 5 6 %% 定义记录结构 7 -record(shop,{item,quantity,cost}). 8 -record(cost,{name,price}). 9 -record(design,{id,plan}). 10 11 start() -> 12 mnesia:start(), 13 %% 等待表的加载 14 mnesia:wait_for_tabl...
阅读全文
摘要:erlang提供的k-v存储 ets保存在内存里 dets保存在磁盘上ETS表与正常的进程存储空间是分离的,其存储区域与普通进程无关,ETS表隶属于创建它的进程,当这个进程死掉或者调用了ets:delete,ETS表就被删掉了测试&示例代码 1 -module(test_ets). 2 -compile(export_all). 3 4 start() -> 5 %% 4种不同表的类型 6 lists:foreach(fun test/1,[set,ordered_set,bag,duplicate_bag]). 7 8 test(Mode) -> 9 %% 表类型...
阅读全文
摘要:SELECT * FROM tablename INTO OUTFILE "/tmp/tablename.log"
阅读全文
摘要:一直想知道python里有没有类似php中的 $classname->$method() 或call_user_func今天有时间查了一下,示例代码如下:classname.py1 #!/usr/bin/python2 3 class classname:4 def mod1(self):5 pass6 7 def echo(self):8 print "test"test.py 1 #!/usr/bin/python 2 3 def test(): 4 clsname = "classname" 5 method = "ech...
阅读全文
摘要:需要几台机器做集群测试,目前只有一台机器所以用xen来虚拟化几台机器出来系统: centos5.6安装xenyum install kernel-xen xen修改grub/boot/grub/grub.conf将default=1改为default=0default=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.18-308.4.1.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-308.4.1.el5 mo...
阅读全文