跳至主要内容

博文

Setagaya park

  We visited Setagaya Park (世田谷区) yesterday. This park reminds us when we in Europe, which has a fancy fountain in the middle, and free entrance. People just laid down on the grass, enjoy the day time they can waste. people who have kids together,  play all different kinds of sports. you really can't image whether you are in Europe or  Japan. I would prefer to use a Bus instead of the metro, the metro is fast, but you only can see the dark, light, people sit or stand as Sardine, without any emotion. but on the bus, you can see the traffic, the shop, everything on the road. When we on our way to the park, we stop by a good chocolate shop named " craft chocolate works ",  this is a very good place to have ice cream, you probably can choose half & half, you can enjoy the feeling when you smell the chocolate smell and eat with it.  or you can enjoy beer or cake in "globe antiques (ザ グローブアン ティ ークス) .   also, we checked the Blue Bottle Coffee Sangenjaya ...

Back to Blog again

     My last blog was almost 6 years again.  lots of things happening those years. like marriage, and move to another country, simply relocation, something is very big in my life.      Back to now,  I guess it is a very good time to start with the blog again. no matter daily life or the tech parts.      These blog may or will contains various languages, Chinese, English or Few Japanese. The first thing, I change the profile to Kamata life, Kamata is Japanese words. "鎌田"  as Kanji. why this change happened, due to we will move from Tamagawa "玉川" to Kamata very soon. I hope I can start to write this not daily, but I hope I can do this continuously.

difference betewn subprocess.call and subprocess.Popen

You typically use subprocess.call when you do not care about the ouptut of the shell command and you just want it to run. If you need to capture the output of a command, then you will want to use subprocess.Popen. There is another sizable difference between subprocess.call and subprocess.Popen. Subprocess.call will block waiting for a response, while subprocess.Popen will not.

project myself

start to initial this project and track all the changes and happens. sub projects had been divided. project apartment project money project module project reading project learning project photos

NFS on redhat

     When we found the server with mount protocol has problem, the nfs server side, it has rpcinfo -p, the mountd port actually we are using 808/850 with tcp/udp port.     The workaround is that we modify /etc/services with specific port number, such as mountd 3333/tcp, mountd 3333/udp. then restart the nfs and portmap service.

Attitude

Attitude matters too When you see the right thing, do it — this may look like more work in the short term, but it's the path of least effort in the long run. If you don't know what the right thing is, do the minimum necessary to get the job done, at least until you figure out what the right thing is. To do the Unix philosophy right, you have to be loyal to excellence. You have to believe that software design is a craft worth all the intelligence, creativity, and passion you can muster. Otherwise you won't look past the easy, stereotyped ways of approaching design and implementation; you'll rush into coding when you should be thinking. Otherwise you'll carelessly complicate when you should be relentlessly simplifying — and then you'll wonder why your code bloats and debugging is so hard. To do the Unix philosophy right, you have to value your own time enough never to waste it. If someone has already solved a problem once, don't let pride or politics suck ...

nexus configuration

nexus是个很好的maven仓库管理器,官方网站为http://nexus.sonatype.org/ 安装nexus到tomcat: 1) 下载nexus-webapp-1.6.0.war 2) 解压nexus-webapp-1.6.0.war到tomcat安装目录下的webapps子目录下,并更名为"nexus" 3) 修改nexus的工作目录:编辑文件“webapps/nexus/WEB-INF/plexus.properties”,修改nexus-work的值为希望的工作目录,默认为nexus-work=${user.home}/sonatype-work/nexus,其中${user.home}为你当前用户的工作目录。 4) 配置maven使用nexus:编辑文件“ ${user.home}/.m2/settings.xml”,修改为如下配置:                   nexus       *       http://localhost:8081/nexus/content/groups/public                   nexus                                     central           http://central         ...

solaris publisher

#mkdir /pkg #mkdir /repo #cat sol-11-1111-repo-full.iso-a sol-11-1111-repo-full.iso-b > sol-11-1111-repo-full.iso #vi /etc/rc3.d/S99mountpkg #!/bin/sh mount -F hsfs /pkg/sol-11-1111-repo-full.iso /repo #pkg unset-publisher solaris (if you set solaris as mirror directly, that will caused problem, they need connection directly to the original one) #pkg set-publisher -g  file:///repo/repo -P solaris #pkg publisher PUBLISHER                             TYPE     STATUS   URI solaris                               origin   online   file:///repo/repo/ #pkg update

ssh issue

The GSS-API protected key exchange has failed without indication from the server, possibly due to misconfiguration of the server. Use the GssKeyEx option to disable GSS-API key exchange and try agai change the sshd_config # GSSAPI options GSSAPIAuthentication no #GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck no GSSAPIKeyExchange no the authen and key line to no

Jenkins

#!/bin/bash # Author: Alex Tu, 2011 # ### BEGIN INIT INFO # Provides:          gbv-hudson-integration # Required-Start:    $local_fs $network # Required-Stop: # Default-Start:     3 5 # Default-Stop:      0 1 2 6 # Short-Description: Starts the hudson server for CI # Description:       Starts Continuous Integration System for VZG SOA ### END INIT INFO # to avoid conflict with functions local $1 ARG=$1 APP="jenkins" HUDSON_USER=jenkins HUDSON_GROUP=jenkins JAVA=/usr/bin/java export HOME=/opt/${HUDSON_USER} export HUDSON_WAR=/opt/${HUDSON_USER}/jenkins.war # include rc.status functions test -s /etc/rc.status && . /etc/rc.status && rc_reset # use test_for_app (x|f) test_for_app () {     app_found=0     if [ "f" = "$2" ] && [ -f $1 ]; then         app_found=1  ...

4 steps to delete account in Gerrit DB

4 steps to delete account in DB. Delete from accounts where preferred_email=’’; delete from account_ssh_keys where account_id=''; delete from account_external_ids where external_id='gerrit:*’; delete from account_external_ids where external_id='username:*’; whatever it was in H2 database and postgres db . H2: ssh -p 24198 localhost gerrit gsql Postgres: psql

tar with /

When I try to tar -jcvf /, that will caused error tar: Removing leading `/' from member names The fix coomand tar -jcvPf /opt.tar /opt If you put the P after f, it will create P file... untar tar -jxvPf /opt.tar if no P option, it will have the error as the same. #!/bin/bash DATE=`date "+%F-%H-%M"` /u01/postgres/9.0/bin/pg_dump reviewdb > /var/backup/reviewdb_$DATE.sql /usr/bin/bzip2 /var/backup/reviewdb_$DATE.sql find . -name "*.sql.bz2" -mtime +90 -exec rm -rf {} \;

redmine installation guide

 1.  Prepare all the applications.      1) ruby. highly recommend use 1.8.6-1.8.7  http://www.ruby-lang.org/en/downloads/            ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]          mysql 5.1.45      2) install all required gem/ gem install *.gem           rubygem        actionmailer (2.3.11)       actionpack (2.3.11)       activerecord (2.3.11)       activeresource (2.3.11)       activesupport (2.3.11)       i18n (0.4.2)       mysql (2.8.1)       rack (1.1.0, 1.0.1)       rails (2.3.11)       rake (0.8.7)       rubygems-update (1.4.2)         Ruby 1.9 is not supported yet.  You  have  to use Ruby 1.8.x as stated above. RubyGems 1.3.1 or higher is required ( Rails 2.3.5 will fail with RubyGems 1.5.0 and later , stick to previous versions of RubyGems) Rake 0.8.3 or higher is required Rack 1.0.1 is required. If you don't have this exact version, database migration would fail. I18n 0.4.2 is required for Redmine >= 1.0.5      3) download redmine  http://www.redmine....

Python学习笔记20100128

methodList = [method for method in dir(object) if callable(getattr(object, method))] ###插一句, ifconfig pcn0 unplumb 去禁solaris的网卡plumb起网卡   and, or  已经and-or一起用。 and 两者为真,print第二个数,一个为假一个为真返回假,三者为真返回最后一个真。 or 两个为真,返回第一个, 一个为假一个为真返回真,三者为假返回最后一个假   lambda可快速定义最小值函数   g = lambda x:x*2 g(3) 6 (lambda x:x*2)(3)   doc string print getattr(object,mothod).__doc__   ljust ljust 用空格填充字符串以符合指定的长度。info 函数使用它生成了两列输出并将所有在第二列的 doc string 纵向对齐。 如果小于的话不会从中截断   -----面向对象 首先导入,你可以选择import module or from module import module 如果你要经常访问模块的属性和方法,且不想一遍又一遍地敲入模块名,使用 from module import。 如果你想要有选择地导入某些属性和方法,而不想要其它的,使用 from module import。 如果模块包含的属性和方法与你的某个模块同名,你必须使用 import module 来避免名字冲突   -----类的定义 class Lofs    pass   这个类的名字是 Loaf,它没有从其它类继承。 类名通常是第一个字母大写,如:EachWordLikeThis,但这只是一个习惯,不是一个必要条件。   这个类没有定义任何方法或属性,但是从语法上,需要在定义中有些东西,所以你使用 pass。这是一个 Python 保留字,仅仅表示 “向前走,不要往这看”。它是一条什么都不做的语句,当你删空函数或类时,它是一个很好的占位符。   你可能猜...