tag:blogger.com,1999:blog-77117231243613742752024-03-13T19:09:22.620+08:00AtuAll My stuffAtuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.comBlogger204125tag:blogger.com,1999:blog-7711723124361374275.post-20901218665840873882019-06-02T10:52:00.000+08:002019-06-02T10:52:01.581+08:00Setagaya park We visited <a href="https://www.tripadvisor.com/Attraction_Review-g1066455-d1230090-Reviews-Setagaya_Park-Setagaya_Tokyo_Tokyo_Prefecture_Kanto.html">Setagaya Park </a>(世田谷区) 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.<br />
people who have kids together, play all different kinds of sports. you really can't image whether you are in Europe or Japan.<br />
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 <span class="st">Sardine, without any emotion. but on the bus, you can see the traffic, the shop, everything on the road.</span><br />
<span class="st"> When we on our way to the park, we stop by a good chocolate shop named "<a href="https://www.google.co.jp/maps/place/CRAFT+CHOCOLATE+WORKS/@35.6458262,139.6785938,19z/data=!4m8!1m2!2m1!1ssetagaya+park!3m4!1s0x6018f4a5d6ad73df:0x85ee75ed99e997!8m2!3d35.6461269!4d139.6786979">craft chocolate works</a>", 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 (ザ グローブアン</span><span style="font-weight: normal;">ティ</span><span class="st">ークス)</span>.<br />
also, we checked <a href="https://www.google.co.jp/maps/place/Blue+Bottle+Coffee+Sangenjaya+Cafe/@35.6422545,139.6693874,17z/data=!3m1!4b1!4m5!3m4!1s0x6018f4a26d1330c5:0x5253d950cdcfa746!8m2!3d35.6422545!4d139.6715761">the Blue Bottle Coffee Sangenjaya Cafe</a>, a really good place for Instagram. <br />
<span class="st"></span><br />
Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-74137390875103180252019-06-02T10:08:00.002+08:002019-06-02T10:08:44.524+08:00Back 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.<br />
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.<br />
These blog may or will contains various languages, Chinese, English or Few Japanese.<br />
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.Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-41894923028859846482013-04-11T10:13:00.002+08:002013-04-11T10:13:42.256+08:00difference betewn subprocess.call and subprocess.PopenYou typically use subprocess.call when you do not care about the ouptut of<br />the shell command and you just want it to run. If you need to capture the output of a<br />command, then you will want to use subprocess.Popen. There is another sizable difference<br />between subprocess.call and subprocess.Popen. Subprocess.call will block<br />waiting for a response, while subprocess.Popen will not.Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-4020457475164706842012-12-26T10:49:00.000+08:002012-12-26T10:49:50.199+08:00project myselfstart to initial this project and track all the changes and happens.<br />
<br />
sub projects had been divided.<br />
<br />
project apartment<br />
project money<br />
project module<br />
project reading<br />
project learning<br />
project photos<br />
<br />Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-11558796843943416912012-10-23T09:49:00.001+08:002012-10-23T09:49:42.790+08:00NFS 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.<br />
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.Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-54781084214893620272012-08-21T14:37:00.002+08:002012-08-21T14:37:13.329+08:00Attitude<br />
Attitude matters too<br />
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.<br />
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.<br />
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 you into solving it a second time rather than re-using. And never work harder than you have to; work smarter instead, and save the extra effort for when you need it. Lean on your tools and automate everything you can.<br />
Software design and implementation should be a joyous art, a kind of high-level play. If this attitude seems preposterous or vaguely embarrassing to you, stop and think; ask yourself what you've forgotten. Why do you design software instead of doing something else to make money or pass the time? You must have thought software was worthy of your passion once....<br />
To do the Unix philosophy right, you need to have (or recover) that attitude. You need to care. You need to play. You need to be willing to explore.<br />
We hope you'll bring this attitude to the rest of this book. Or, at least, that this book will help you rediscover it.<br />
Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-22161204699593524002012-04-12T09:37:00.003+08:002012-04-12T09:37:32.419+08:00nexus configuration<br />
nexus是个很好的maven仓库管理器,官方网站为http://nexus.sonatype.org/<br />安装nexus到tomcat:<br />1) 下载nexus-webapp-1.6.0.war<br />2) 解压nexus-webapp-1.6.0.war到tomcat安装目录下的webapps子目录下,并更名为"nexus"<br />3) 修改nexus的工作目录:编辑文件“webapps/nexus/WEB-INF/plexus.properties”,修改nexus-work的值为希望的工作目录,默认为nexus-work=${user.home}/sonatype-work/nexus,其中${user.home}为你当前用户的工作目录。<br />4) 配置maven使用nexus:编辑文件“ ${user.home}/.m2/settings.xml”,修改为如下配置:<br /><settings><br /> <mirrors><br /> <mirror><br /> <!--This sends everything else to /public --><br /> <id>nexus</id><br /> <mirrorof>*</mirrorof><br /> <url>http://localhost:8081/nexus/content/groups/public</url><br /> </mirror><br /> </mirrors><br /> <profiles><br /> <profile><br /> <id>nexus</id><br /> <!--Enable snapshots for the built in central repo to direct --><br /> <!--all requests to nexus via the mirror --><br /> <repositories><br /> <repository><br /> <id>central</id><br /> <url>http://central</url><br /> <releases><enabled>true</enabled></releases><br /> <snapshots><enabled>true</enabled></snapshots><br /> </repository><br /> </repositories><br /> <pluginrepositories><br /> <pluginrepository><br /> <id>central</id><br /> <url>http://central</url><br /> <releases><enabled>true</enabled></releases><br /> <snapshots><enabled>true</enabled></snapshots><br /> </pluginrepository><br /> </pluginrepositories><br /> </profile><br /> </profiles><br /> <activeprofiles><br /> <!--make the profile active all the time --><br /> <activeprofile>nexus</activeprofile><br /> </activeprofiles></settings><br />其中“http://localhost:8081/nexus”的访问路径,视你的实际部署情况可能端口并不一样,注意修改。<br />5) 启动tomcat,通过http://localhost:8081/nexus即可访问nexus的界面,默认的管理员帐号为admin,密码为admin123。<br /><br />如何将自己项目的jar发布到nexus仓库:<br />1) 编辑文件“ ${user.home}/.m2/settings.xml”,增加如下配置:<br /><settings><br />......<br /> <server> <br /> <id>nexus-releases</id> <br /> <username>admin</username> <br /> <password>****</password> <br /> </server> <br /> <server> <br /> <id>nexus-snapshots</id> <br /> <username>admin</username> <br /> <password>****</password> <br /> </server> <br />......</settings><br />其中username为nexus的管理员帐号,password为对应的访问密码。<br />2) 配置项目的POM.xml文件,增加如下配置:<br /><project ......=""><br />......<br /> <!-- 发布到仓库中 --><br /> <distributionmanagement><br /> <repository> <br /> <id>nexus-releases</id> <br /> <name>public</name> <br /> <url>http://localhost:8081/nexus/content/repositories/releases</url> <br /> </repository> <br /> <snapshotrepository> <br /> <id>nexus-snapshots</id> <br /> <name>Snapshots</name> <br /> <url>http://localhost:8081/nexus/content/repositories/snapshots</url><br /> </snapshotrepository> <br /> </distributionmanagement><br />......</project><br />其中“http://localhost:8081/nexus”视实际的部署情况修改,id的值要与${user.home}/.m2/settings.xml的配置一致。<br />3) 进入项目目录执行mvn deploy就可将构件发布到nexus服务器中。<br />
<br />
<br />
转载自<a href="http://rongjih.blog.163.com/blog/static/33574461201042102046529/">http://rongjih.blog.163.com/blog/static/33574461201042102046529/</a>Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-13274754545712415402012-01-31T10:43:00.000+08:002012-01-31T10:43:19.706+08:00solaris publisher#mkdir /pkg<br />
#mkdir /repo<br />
#cat sol-11-1111-repo-full.iso-a sol-11-1111-repo-full.iso-b > sol-11-1111-repo-full.iso<br />
#vi /etc/rc3.d/S99mountpkg<br />
#!/bin/sh<br />
mount -F hsfs /pkg/sol-11-1111-repo-full.iso /repo<br />
#pkg unset-publisher solaris (if you set solaris as mirror directly, that will caused problem, they need connection directly to the original one)<br />
#pkg set-publisher -g file:///repo/repo -P solaris<br />
#pkg publisher<br />
PUBLISHER TYPE STATUS URI<br />
solaris origin online file:///repo/repo/<br />
#pkg update<br />
<iframe allowfullscreen="" frameborder="0" height="344" src="http://www.youtube.com/embed/__gzsolUq_E?fs=1" width="459"></iframe>Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-76620024647956138842011-12-28T10:43:00.001+08:002011-12-28T10:43:20.891+08:00solaris container with dedicated cpusolaris with pooladm, poolcfg.<br />
It will generate our cpu usage less, once your have the dedicated cpu the whole cpu number will reduce, that will caused your server has problem with shared, the load average will raise immediately.<br />
<br />Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-88344145074077535772011-12-28T10:40:00.000+08:002011-12-28T10:40:18.415+08:00blogspot merge with google +blogspot 被merge 到了google+, 在google +上还没看到效果Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-34431738347164430352011-12-12T16:39:00.001+08:002011-12-12T16:39:34.040+08:00ssh issueThe GSS-API protected key exchange has failed without indication<br />from the server, possibly due to misconfiguration of the server.<br />Use the GssKeyEx option to disable GSS-API key exchange and try agai<br /><br /><br />change the sshd_config<br /><br /># GSSAPI options<br />GSSAPIAuthentication no<br />#GSSAPICleanupCredentials yes<br />#GSSAPIStrictAcceptorCheck no<br />GSSAPIKeyExchange no<br /><br /><br />the authen and key line to noAtuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-13873286048725301462011-12-12T13:19:00.001+08:002011-12-12T13:20:39.825+08:00nfs isseafter my reconfigure /etc/fstab, it was not working after reboot, the thing is the nfs client is not boot.<br />
To solve this issue.<br />
chkconfig nfs on <br />
<br />Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-85543216444523991022011-12-06T14:28:00.001+08:002011-12-06T14:28:45.283+08:00Jenkins<blockquote class="tr_bq">
#!/bin/bash<br /># Author: Alex Tu, 2011<br />#<br /><br /><br />### BEGIN INIT INFO<br /># Provides: gbv-hudson-integration<br /># Required-Start: $local_fs $network<br /># Required-Stop:<br /># Default-Start: 3 5<br /># Default-Stop: 0 1 2 6<br /># Short-Description: Starts the hudson server for CI <br /># Description: Starts Continuous Integration System for VZG SOA<br />### END INIT INFO<br /><br /># to avoid conflict with functions local $1<br />ARG=$1<br /><br />APP="jenkins"<br /><br />HUDSON_USER=jenkins<br />HUDSON_GROUP=jenkins<br />JAVA=/usr/bin/java<br />export HOME=/opt/${HUDSON_USER}<br />export HUDSON_WAR=/opt/${HUDSON_USER}/jenkins.war<br /><br /># include rc.status functions <br />test -s /etc/rc.status && . /etc/rc.status && rc_reset<br /><br /># use test_for_app <appl|file> (x|f)<br />test_for_app ()<br />{<br /> app_found=0<br /> if [ "f" = "$2" ] && [ -f $1 ]; then<br /> app_found=1<br /> elif [ "x" = "$2" ] && [ -x $1 ]; then<br /> app_found=1<br /> fi<br /> if [ 0 = $app_found ]; then<br /> echo -n "Warning: Couldn't find $1"<br /> if [ "$ARG" = "stop" ] ; then<br /> rc_failed 0<br /> else<br /> rc_failed 5<br /> fi<br /> rc_status -v<br /> rc_exit<br /> fi<br />}<br /><br /><br />HUDSON_CMD="${JAVA} -jar ${HUDSON_WAR}"<br /><br />HUDSON_PIDFILE=/var/run/jenkins.pid<br />HUDSON_LOG=/var/log/jenkins<br /><br />usage ()<br />{<br /> echo ""<br /> echo "Usage: $0 <command></command> "<br /> echo ""<br /> echo "where <command></command> is one of the following:"<br /> echo " start - start $APP if not running"<br /> echo " stop - stop $APP if running"<br /> echo " status - report whether $APP is running"<br /> echo " restart - stop and restart $APP"<br /> echo " usage, help - print this message"<br />}<br /><br />get_pid_for_cmd ()<br />{<br /> for pid in `ls /proc`; do<br /> if [ -d /proc/$pid ] && [ -f /proc/$pid/cmdline ]; then<br /> if [ "$1" = "$( # return with current pid <br /> return<br /> fi<br /> fi<br /> done<br /> pid=0<br />}<br /><br /># checkport <port><br /># returns port_used<br />check_port()<br />{<br /> port=$1<br /> if netstat -nlept 2>/dev/null | grep --regexp=":$port " &>/dev/null ; then<br /> port_used=1<br /> else<br /> port_used=0<br /> fi<br />}<br /><br /># checks hudson, sets/returns status - <br /># 0 if pidfile same as pid, running<br /># 3 no pidfile, not running (what with running?)<br /># 2 pidfile, but no process (remove file ...), not running<br /># 1 pidfile != pid, but running<br /># 4 no pidfile, but running<br /># <br /># @todo: check port usage<br />check_hudson() <br />{<br /> get_pid_for_cmd `eval echo ${HUDSON_CMD} | sed -e 's/ //g'`<br /><br /> if [ -f $HUDSON_PIDFILE ]; then<br /> chown jenkins:jenkins ${HUDSON_PIDFILE}<br /> pidfile_pid=`cat $HUDSON_PIDFILE`<br /> if [ 0 = $pid ]; then<br /> status=2<br /> elif [ "$pid" = "$pidfile_pid" ]; then<br /> status=0;<br /> else <br /> status=1;<br /> fi <br /> else <br /> if [ 0 = $pid ]; then<br /> status=3;<br /> else <br /> status=4;<br /> fi<br /> fi<br /><br />}<br /><br /><br />test_for_app ${JAVA} x<br />test_for_app ${HUDSON_WAR} f<br /><br />case "$1" in<br /> start)<br /> check_hudson<br /> case "$status" in<br /> 0)<br /> echo "${APP} already running"<br /> rc_failed 0<br /> rc_status -v1<br /> rc_exit<br /> ;;<br /> 1|4)<br /> echo "${APP} seems running but pidfile is not up to date or doesn't exist, please check!"<br /> rc_failed<br /> rc_status -v1<br /> rc_exit<br /> ;;<br /> 2)<br /> echo "Found stale pidfile for ${APP} - unclean shutdown?"<br /> rm ${HUDSON_PIDFILE}<br /> ;;<br /> 3)<br /> # not running - ok<br /> check_port $CI_HTTP_PORT<br /> if [ $port_used = 1 ]; then<br /> echo "Port $CI_HTTP_PORT already in use, pleas check!"<br /> rc_failed<br /> rc_status -v1<br /> rc_exit<br /> fi <br /> ;;<br /> *)<br /> echo "Check for ${APP} failed"<br /> rc_failed<br /> rc_status -v1<br /> rc_exit<br /> esac<br /><br /> echo -n "Starting ${APP}"<br /> startproc -f -u $HUDSON_USER -g $HUDSON_GROUP -p ${HUDSON_PIDFILE} ${HUDSON_CMD} >> ${HUDSON_LOG} 2>&1<br /> if ! [ 0 = $? ]; then<br /> echo -n "(Error - "<br /> case $? in<br /> 2)<br /> echo -n "invalid arguments"<br /> ;;<br /> 4)<br /> echo -n "insufficient permission"<br /> ;;<br /> 5)<br /> echo -n "no such program"<br /> ;;<br /> 7)<br /> echo -n "launch failure"<br /> ;;<br /> *)<br /> echo -n "unspecified error"<br /> ;;<br /> esac<br /> echo -n ")"<br /> rc_failed<br /> rc_status -v1<br /> rc_exit<br /> fi<br /> # removing spaces from commandline to be able to compare with /proc/<pid>/cmdline<br /> get_pid_for_cmd `eval echo ${HUDSON_CMD} | sed -e 's/ //g'`<br /> if [ 0 = $pid ]; then<br /> echo "Warning - Couldn't obtain PID for ${APP} "<br /> else<br /> echo $pid > ${HUDSON_PIDFILE}<br /> fi<br /> rc_status -v<br /> ;;<br /> stop)<br /> if [ $1 = "stop" ]; then<br /> check_hudson<br /> if ! [ $status = 0 ]; then<br /> echo "Warning - not running!"<br /> fi<br /> killproc -p ${HUDSON_PIDFILE} -t 10 ${JAVA}<br /> rc_status -v<br /> fi<br /> ;;<br /> status)<br /> check_hudson<br /> case "$status" in<br /> 0)<br /> echo -n "(running)"<br /> rc_failed 0<br /> ;;<br /> 1|4) <br /> echo -n "(running)"<br /> echo -n "Warning - PID corrupted"<br /> rc_failed 0<br /> ;;<br /> 2)<br /> echo "(not running)"<br /> echo -n "Warning - PID file found"<br /> rc_failed 3<br /> ;;<br /> 3)<br /> echo -n "(not running)"<br /> rc_failed 1<br /> ;;<br /> *)<br /> echo "(unknown)"<br /> echo "Warning - Couldn't get status"<br /> rc_failed 1<br /> rc_status -v1<br /> rc_exit<br /> esac<br /> rc_status -v<br /> ;;<br /> restart)<br /> $0 stop &>/dev/null<br /> $0 start &>/dev/null<br /> rc_status -v<br /> ;;<br /> usage|help)<br /> usage<br /> rc_exit<br /> ;;<br /> *)<br /> usage<br /> rc_failed 1<br /> rc_status -v<br /> rc_exit<br />esac</pid></port></appl|file></blockquote>
<br />Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-78914262244911553032011-11-22T11:46:00.001+08:002011-11-22T11:49:28.927+08:004 steps to delete account in Gerrit DB<br />
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-family: "Calibri","sans-serif"; font-size: 11pt;">4 steps to delete account
in DB.</span></div>
<div class="MsoNormal">
<br /></div>
<blockquote class="tr_bq">
<div class="MsoNormal">
<span style="color: #1f497d; font-family: "Calibri","sans-serif"; font-size: 11pt;">Delete from accounts
where preferred_email=’’;</span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-family: "Calibri","sans-serif"; font-size: 11pt;">delete from
account_ssh_keys where account_id='';</span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-family: "Calibri","sans-serif"; font-size: 11pt;">delete from
account_external_ids where external_id='gerrit:*’;</span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-family: "Calibri","sans-serif"; font-size: 11pt;">delete from
account_external_ids where external_id='username:*’;</span></div>
</blockquote>
<div style="font-family: Times,"Times New Roman",serif;">
whatever it was in H2 database and postgres db .</div>
<div style="font-family: Times,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Times,"Times New Roman",serif;">
H2:</div>
<div style="font-family: Times,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Times,"Times New Roman",serif;">
ssh -p 24198 localhost gerrit gsql<br />
<br />
Postgres:<br />
psql</div>
<br />
<br />Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com1tag:blogger.com,1999:blog-7711723124361374275.post-76651270827900537352011-11-19T12:01:00.001+08:002011-11-19T12:27:10.474+08:00tar with /When I try to tar -jcvf /, that will caused error<br />
tar: Removing leading `/' from member names<br />
<br />
The fix coomand<br />
<blockquote class="tr_bq">
tar -jcvPf /opt.tar /opt</blockquote>
If you put the P after f, it will create P file... <br />
<br />
untar tar -jxvPf /opt.tar if no P option, it will have the error as the same.<br />
<br />
#!/bin/bash<br />DATE=`date "+%F-%H-%M"`<br />/u01/postgres/9.0/bin/pg_dump reviewdb > /var/backup/reviewdb_$DATE.sql<br />/usr/bin/bzip2 /var/backup/reviewdb_$DATE.sql<br />find . -name "*.sql.bz2" -mtime +90 -exec rm -rf {} \;Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-13990923043895979982011-11-18T15:28:00.001+08:002011-11-18T15:32:52.030+08:00Gerrit send mail without to and error with reviewersWe have problem since users said they can't receive mail from the gerrit server. For IT perspective, we do nothing, because of Gerrit (2.2.X) is different with the others, especially for access control.<br />
The fix thing, disable the group options and unchecked two options.<br />
<br />
<br />
<br />Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com1tag:blogger.com,1999:blog-7711723124361374275.post-87889610657558484742011-11-17T14:47:00.001+08:002011-11-17T14:49:57.673+08:00Oralce Solaris 11 releasedOracle released Solarsi 11 on 2011/11/11.<br />
http://www.oracle.com/technetwork/server-storage/solaris11/overview/index.html<br />
<br />
But apparently it was not so good at what they expect for the release, no one cheer for that.Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-40986519935802198342011-11-17T10:51:00.001+08:002011-11-17T10:52:30.091+08:00RazorSQLRazorSQL有Windows版
<br />
<div>
<br /></div>
<div>
注册码为:<span style="color: #336600; font-family: 宋体, Arial; font-size: 12px; font-weight: bold; letter-spacing: 1px; line-height: 20px;">G84BKS8JQC7HRJ8V</span></div>
<div>
<cite>www.<b>razorsql</b>.com</cite></div>
<div>
<cite> </cite></div>
<div>
<cite>不是一般的好用 </cite><span style="color: #336600; font-family: 宋体,Arial; font-size: 12px; font-weight: bold; letter-spacing: 1px; line-height: 20px;"> </span></div>Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-30483092049106241602011-03-15T18:03:00.001+08:002011-03-15T18:03:15.625+08:00redmine installation guide 1. Prepare all the applications.<div><br></div><div> 1) ruby. highly recommend use 1.8.6-1.8.7 <a href="http://www.ruby-lang.org/en/downloads/">http://www.ruby-lang.org/en/downloads/</a></div><div> ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]</div> <div> mysql 5.1.45</div><div><br></div><div><br></div><div> 2) install all required gem/ gem install *.gem</div><div> rubygem </div><div> actionmailer (2.3.11)</div><div> actionpack (2.3.11)</div> <div> activerecord (2.3.11)</div><div> activeresource (2.3.11)</div><div> activesupport (2.3.11)</div><div> i18n (0.4.2)</div><div> mysql (2.8.1)</div><div> rack (1.1.0, 1.0.1)</div><div> rails (2.3.11)</div> <div> rake (0.8.7)</div><div> rubygems-update (1.4.2)</div><div> </div><ul style="color: rgb(72, 72, 72); font-family: Verdana, sans-serif; font-size: 12px; "><li><strong>Ruby 1.9 is not supported yet.</strong> You <em>have</em> to use Ruby 1.8.x as stated above.</li> <li>RubyGems 1.3.1 or higher is required (<strong>Rails 2.3.5 will fail with RubyGems 1.5.0 and later</strong>, stick to previous versions of RubyGems)</li><li>Rake 0.8.3 or higher is required</li><li>Rack 1.0.1 is required. If you don't have this exact version, database migration would fail.</li> <li>I18n 0.4.2 is required for Redmine >= 1.0.5</li></ul><div><br></div><div> 3) download redmine <a href="http://www.redmine.org/projects/redmine/wiki/Download">http://www.redmine.org/projects/redmine/wiki/Download</a> and unpack it.</div> <div> 4) <span class="Apple-style-span" style="color: rgb(72, 72, 72); font-family: Verdana, sans-serif; font-size: 12px; ">Create an empty database and accompanying user named <code>redmine</code> for example.</span></div> <span class="Apple-style-span" style="color: rgb(72, 72, 72); font-family: Verdana, sans-serif; font-size: 12px; "><p>For MySQL:</p><pre style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1.6em; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 0px; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); width: auto; overflow-x: auto; overflow-y: hidden; "> create database redmine character set utf8; create user 'redmine'@'localhost' identified by 'my_password'; grant all privileges on redmine.* to 'redmine'@'localhost'; </pre><p>For versions of MySQL prior to 5.0.2 - skip the 'create user' step and instead:<br></p><pre style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1.6em; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 0px; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); width: auto; overflow-x: auto; overflow-y: hidden; "> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password'; </pre><p></p><p>For PostgreSQL:</p><pre style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1.6em; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 0px; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); width: auto; overflow-x: auto; overflow-y: hidden; "> CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'my_password' NOINHERIT VALID UNTIL 'infinity'; CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine; </pre><p>3. Copy <code>config/database.yml.example</code> to <code>config/database.yml</code> and edit this file in order to configure your database settings for "production" environment.</p><p>Example for a MySQL database:</p> <pre style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1.6em; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 0px; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); width: auto; overflow-x: auto; overflow-y: hidden; "> production: adapter: mysql database: redmine host: localhost username: redmine password: my_password </pre><p>If your server is not running on the standard port (3306), use this configuration instead:</p><pre style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1.6em; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 0px; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); width: auto; overflow-x: auto; overflow-y: hidden; "> production: adapter: mysql database: redmine host: localhost port: 3307 username: redmine password: my_password </pre><p>Example for a PostgreSQL database (default port):</p><pre style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1.6em; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 0px; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); width: auto; overflow-x: auto; overflow-y: hidden; "> production: adapter: postgresql database: <your_database_name> host: <postgres_host> username: <postgres_user> password: <postgres_user_password> encoding: utf8 schema_search_path: <database_schema> (default - public)</pre></span><div> 5) run " <span class="Apple-style-span" style="white-space: pre; "><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif">rake generate_session_store"</font></span></div> <div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"> 6) under redmine path;</span></font></div><div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"> vi ./config/boot.rb</span></font></div> <div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"> add "require 'thread'" in the first line</span></font></div> <div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"> 7) run "</span></font><span class="Apple-style-span" style="color: rgb(72, 72, 72); font-family: monospace; font-size: 12px; white-space: pre; ">RAILS_ENV=production rake db:migrate"</span></div> <div><font class="Apple-style-span" color="#484848"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "><font class="Apple-style-span" face="monospace"> </font><font class="Apple-style-span" face="arial, helvetica, sans-serif">but it will have problems, although they said the issue been fixed in gem2.3.11.</font></span></font></div> <div><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> The workaround : </span></font></div><div><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> vi vendor/rails/railties/lib/rails/gem_dependency.rb</span></font></div> <div><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> add </span></font></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; "> <font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> if Gem::VERSION >= "1.3.6"<br></span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> module Rails<br> </span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> class GemDependency<br></span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> def requirement<br> </span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> r = super<br></span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> (r == Gem::Requirement.default) ? nil : r<br> </span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> end<br></span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> end<br> </span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> end<br></span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; ">end<br> </span></font><font class="Apple-style-span" color="#484848" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; white-space: pre; "> </span></font></blockquote><div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"> in the last line. and export LD_LIBRARY_PATH=/opt/ruby/lib:/lib/ </span></font></div> <div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;">then the command is running successfully.</span></font></div> <div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;">8) the tricky thing is, my mysql didn't use the local one, but redmine will search for default I don't how to modify this, just add the soft link with my own mysql's socket. then continue.</span></font></div> <div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;">9) then run <span class="Apple-style-span" style="color: rgb(72, 72, 72); font-family: monospace; font-size: 12px; ">RAILS_ENV=production rake redmine:load_default_data</span></span></font></div> <div><font class="Apple-style-span" color="#333333" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space: pre;"><span class="Apple-style-span" style="color: rgb(72, 72, 72); font-size: 12px; ">10)</span></span></font><span class="Apple-style-span" style="color: rgb(72, 72, 72); font-family: Verdana, sans-serif; font-size: 12px; ">Setting up permissions</span></div> <span class="Apple-style-span" style="color: rgb(72, 72, 72); font-family: Verdana, sans-serif; font-size: 12px; "><p>Assuming you run Redmine with a <code>redmine</code> user:</p><pre style="margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1.6em; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 0px; background-color: rgb(250, 250, 250); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); width: auto; overflow-x: auto; overflow-y: hidden; "> mkdir tmp public/plugin_assets sudo chown -R redmine:redmine files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets</pre></span><div><span class="Apple-style-span" style="white-space: pre; "><font class="Apple-style-span" color="#484848"><span class="Apple-style-span" style="font-size: 12px; "><font class="Apple-style-span" face="arial, helvetica, sans-serif">11) use admin/admin to login</font><font class="Apple-style-span" face="monospace"><br> </font></span></font></span>-- <br>Alex Tu<br>-----------------------------------------------------------<br>ShangHai,China<br> </div> Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-7434916960390305572010-06-09T09:43:00.005+08:002010-06-09T09:43:52.726+08:00Python学习笔记20100128<div>methodList = [method for method in dir(object) if callable(getattr(object, method))]</div> <div>###插一句, ifconfig pcn0 unplumb 去禁solaris的网卡plumb起网卡</div> <div> </div> <div>and, or 已经and-or一起用。</div> <div>and 两者为真,print第二个数,一个为假一个为真返回假,三者为真返回最后一个真。</div> <div>or 两个为真,返回第一个, 一个为假一个为真返回真,三者为假返回最后一个假</div> <div> </div> <div>lambda可快速定义最小值函数</div> <div> </div> <div>g = lambda x:x*2</div> <div>g(3)</div> <div>6</div> <div>(lambda x:x*2)(3)</div> <div> </div> <div>doc string</div> <div>print getattr(object,mothod).__doc__</div> <div> </div> <div>ljust</div> <div>ljust 用空格填充字符串以符合指定的长度。info 函数使用它生成了两列输出并将所有在第二列的 doc string 纵向对齐。 如果小于的话不会从中截断</div> <div> </div> <div>-----面向对象</div> <div>首先导入,你可以选择import module or from module import module</div> <div>如果你要经常访问模块的属性和方法,且不想一遍又一遍地敲入模块名,使用 from module import。 <br>如果你想要有选择地导入某些属性和方法,而不想要其它的,使用 from module import。 <br>如果模块包含的属性和方法与你的某个模块同名,你必须使用 import module 来避免名字冲突</div> <div> </div> <div>-----类的定义</div> <div>class Lofs</div> <div> pass</div> <div> 这个类的名字是 Loaf,它没有从其它类继承。 类名通常是第一个字母大写,如:EachWordLikeThis,但这只是一个习惯,不是一个必要条件。 <br> 这个类没有定义任何方法或属性,但是从语法上,需要在定义中有些东西,所以你使用 pass。这是一个 Python 保留字,仅仅表示 “向前走,不要往这看”。它是一条什么都不做的语句,当你删空函数或类时,它是一个很好的占位符。 <br> 你可能猜到了,在类中的所有东西都要缩近,就象位于函数、if 语句,for 循环,诸如此类的代码。第一条不缩近的东西不属于这个类。 <br> -----</div> <div>class FileInfo(UserDict):<br> "store file metadata"<br> def __init__(self, filename=None):<br> UserDict.__init__(self) <br> self["name"] = filename </div> <div> </div> <div>了解何时去使用 self 和 __init__<br>当定义你自已的类方法时,你必须明确将 self 作为每个方法的第一个参数列出,包括 __init__。当从你的类中调用一个父类的一个方法时,你必须包括 self 参数。但当你从类的外部调用你的类方法时,你不必对 self 参数指定任何值;你完全将其忽略,而 Python 会自动地替你增加实例的引用。</div> <div> </div> <div> </div> <div> </div> <div>-- <br>Alex Tu<br>-----------------------------------------------------------<br>ShangHai,China<br></div> Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-41039458106325303322010-06-09T09:43:00.003+08:002010-06-09T09:43:47.254+08:00pgsql<code style="display: block; margin: 0pt 1em 1em; padding: 0.5em; border: 1px solid rgb(204, 204, 204);">mysql psql<br> <br> SHOW DATABASES; \l<br> USE db-name; \c db-name<br> SHOW TABLES; \d<br> SHOW USERS; \du<br> SHOW COLUMNS; \d table-name<br> SHOW PROCESSLIST; SELECT * FROM pg_stat_activity;<br> SELECT now()\G \x 可以打开和关闭类似\G功能<br> SOURCE /path.sql \i /path.sql<br> LOAD DATA INFILE ... \copy ...<br> \h \?</code><br clear="all"><br>-- <br>Alex Tu<br>-----------------------------------------------------------<br>ShangHai,China<br> Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-14373921091224590792010-06-09T09:43:00.001+08:002010-06-09T09:43:42.986+08:00虚拟技术使用<div>Vmware ESXI 开始实用command line ,其实还是有其他登录方式的只不过用client管理比较好看而已。</div> <div>Host装完以后, 可以alt-f1 然后输入unsupported再打回车符。 就可以进到里面 <a href="http://www.virtualizationadmin.com/articles-tutorials/vmware-esx-articles/general/how-to-access-the-vmware-esxi-hidden-console.html" target="_blank">文章</a>可以参考。 开启本机ssh和改变host.</div> <div>vi /etc/inet.conf uncomment ssh. 然后在/etc/init一下, 不会影响已经启动的虚拟机。 然后直接可以从外网链接到command模式下.</div> <div> </div> <div>由于自己已经能顺利实现在solaris上,讲zone占到nfs上。 具体步骤如下:</div> <p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3"> </font></p> <ol style="margin-top: 0cm;" type="1"> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">make sure NFS is having enough space to install.</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">make sure you have root permission.</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">cd Path</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">mkfile 6G zone ( the solaris standard installation will cost 6G and the filename is better the same as zone name)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">lofiadm ( run this command for confirming the link between path and the virtual devices)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">lofiadm –a /Path/zone /dev/lofi/* ( please count the * one by one)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">newfs /dev/lofi/*</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">mkdir /localpath/zone (localpath as the old local zone path, zone name as NFS’ zone)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">mount /dev/lofi/* /localpath/zone</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">chmod 700 /localpath/zone</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">vi /zone.cfg (please modify the ip address, zonepath as required , do not modify the others)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">zonecfg –z zone –f /zone.cfg</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">zoneadm list –ivc (confirm the zone had been listed, correct)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">zoneadm –z zone install</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">zoneadm –z zone boot</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">zlogin –C zone (set the normal way, use root000 as root password)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">vi /etc/sshd_config (commont root login)</font></li> <li class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">svcadm restart sshd</font></li></ol> <div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">现在想试着将用vmware exsi使用nfs模式,将虚拟机装到nfs上,用windows的client端很容易实现挂在,无论是用nis share出来的盘,或者用netapp share出来的盘, 这样可以便于备份和便于换空间。 注意在写的使用用netapp的要写好/vol 之前因为没写,导致mount会有问题。</font></div> <div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><font face="Times New Roman" size="3">加载以后,数据饼图显示的话那块。</font></div> <div> </div> <div> </div> <div>ESXI 相对于ESX 被阉割了很多功能,但是对于一般小型企业而言,已经够用。lun的storage需求基本没有。</div> <div>在command命令下加在nas/NFS的share空间,esxcfg-nase -a /name -o hostname -s /vol 即可<br clear="all"><br><br>upgrade 3.5 to 4.0 u1 use ESXi-4.0.0-1.9.208167-upgrade-release.zip<br>upgrede 4.0 to 4.0 u1 use ESXi-4.0.0-update01.zip<br> -- <br>Alex Tu<br>-----------------------------------------------------------<br>ShangHai,China<br></div> Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-40017368203481263692010-02-03T14:13:00.001+08:002010-02-03T14:13:29.373+08:00vmware esxi 安装<div>需求来自于save cost. 开始有用户需求部署vmware esxi为架构的虚拟机, 由于目前没有server来测试,用户自己找的pavilion的家用机系列也跑不了。只得从onsite那里借来一台xw4400. </div> <div>这机器吧,挺好,xw4400开跑的64位虚拟支持的话,先得在Blos上设置下, 因为没有这方面经验,以为机器都能直接判断,但是从安装实录上里讲,需要在blos里这是,对于xw4400的设置是,security-os security- enable virtualization. 然后重启。顺便丢入光盘。</div> <div> </div> <div>iso其实很小大概只有200多M,是一个linux kernel的东西。里面从个人观点来看,带有web接口。和管理接口。</div> <div>安装程序会自动检测你机器的配置是否符合安装要求,家用额pavilion就没检测过,看网上资料,初步认定是网卡没有不办法兼容。 一路按照提示点F2和enter就成。由于是基于网络的,请注意ip的分配。</div> <div>安装完成之后请拿出光盘,因为我之前就是这样犯了个错误,导致重复安装一次:(</div> <div> </div> <div>重启之后,会有一个界面告诉你这个管理的<a href="http://ip/">http://ip</a>是啥, 然后你可以通过windows client段去下载客户端管理工具,ci.</div> <div>里面按f2是管理配置界面,可以配置root密码,ip地址等等,详细可以参考<a href="http://wiki.osslab.org.tw/%E5%AF%A6%E9%A9%97%E5%B0%88%E6%A1%88/Virtualization/VMware_Infrastructure_3/Estimate/%E5%AE%89%E8%A3%9D_VMware_ESXi">文章</a>.</div> <div> </div> <div>点击后的下载ci客户端,点击,输入控制端ip/用户名/密码。</div> <div>然后就是如vmware的配置一般。</div> <div>有一点奇怪的是,他竟然没有办法认出host上的光驱。好在有网络以后,他可以mount本机和网络上的盘,当然我指的是client上的物理光驱以及网络上的虚拟iso.</div> <div>选择client的话,然后用物理光驱要选emulate cd.</div> <div>安装非常的方便。</div> <div>然后装完两个32bit and 64bit的suse.</div> <div>用户开始test<br clear="all"><br>-- <br>Alex Tu<br>-----------------------------------------------------------<br>ShangHai,China<br></div> Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-65950391972055203632010-01-27T17:23:00.000+08:002010-01-27T17:24:01.976+08:00Python学习笔记20100117<div>映射list</div> <div> </div> <div>Dictionary 是用{}. list 是一那个[]. turple是用()</div> <div>当你定义过dictionary后,你可以使用d.keys(), d.values(),d.items()将定义后的时候分别显示出来</div> <div>当然可以将list里的值加减乘除,也可以如一般的定义直接重新复制这个list.</div> <div>链接与分割字符串的</div> <div>li=";", join(li) 则显示的就是 分隔符为;的数 如果使用li=li.split(";")则将刚刚;的分隔符删除,而split里也可定义域,如li.split(";",1)</div> <div> </div> <div>自省 <---这是啥</div> <div>之前在使用的时候发觉有些书本上的模块不能调用,很多是py脚本定义过的函数。</div> <div>下载该脚本s,然后上传至指定位置。</div> <div>>>>import sys</div> <div>>>>sys.path</div> <div>>>>sys.path.append("绝对位置")然后就能调用这些脚本和参数了。</div> <div>删除</div> <div>>>>sys.path.pop()</div> <div>定义一个参数是 def info(test, test1=10.test2=12):</div> <div>info是函数名,test是必备参数,因为没有定义值,test1和test2是可选参数,定义了初始值</div> <div> </div> <div>以上是外部函数的调用,下面转到内部函数</div> <div>内部函数有type,str,dir及其他</div> <div> </div> <div>---type</div> <div>返回任意字符的类型,模块也可以。types模块</div> <div>>>> type(1)<br><type 'int'><br>>>> li=[]<br>>>> type(li)<br><type 'list'><br>>>> import odbchelper<br>>>> type(odbchelper)<br><type 'module'></div> <div>>>> type(sys)<br><type 'module'><br>>>> import types<br>>>> type(odbchelper) == types.ModuleType<br>True</div> <div> </div> <div> </div> <div>---str</div> <div>str将强制转换字符串</div> <div>>>> str(horsemen)<br>"['war', 'pestilence', 'famine', 'testing']" <---这个是一个字符串""</div> <div>>>> str(odbchelper)</div> <div>"<module 'odbchelper' from '/home/xtuulei/py/odbchelper.py'>"</div> <div>str 还允许作用于模块。注意模块的字符串形式表示包含了模块在磁盘上的路径名,所以你的显示结果将会有所不同。</div> <div>>>> str(None) ---书上说这个很重要,对空值的使用<br>'None' </div> <div> </div> <div>---dir</div> <div>相比较而言,不是很熟这个,但是貌似可以列出来所有li,d,funcation所包含的key</div> <div>--callable</div> <div> </div> <div>type、str、dir 和其它的 Python 内置函数都归组到了 __builtin__ </div> <div>你可以在其中使用</div> <div>>>>form apihelper import info</div> <div>>>>import __builtin__</div> <div>>>>info(__buitin__)</div> <div> </div> <div>---getattr</div> <div>>>getattr(li,"pop")</div> <div>该语句也是返回 pop 方法的引用,但是此时,方法名称是作为一个字符串参数传递给 getattr 函数的。getattr 是一个有用到令人无法致信的内置函数,可以返回任何对象的任何属性。</div> <div>>>>getattr(li,"append")("Moe")</div> <div>>>>li</div> <div>getattr 的返回值 是 方法,然后你就可以调用它就像直接使用 li.append("Moe") 一样。但是实际上你没有直接调用函数;只是以字符串形式指定了函数名称。</div> <div>getattr 也可以作用于字典</div> <div>getattr 不仅仅适用于内置数据类型,也可作用于模块</div> <div> </div> <div>getattr也可以做为一个分发者</div> <div>getattr作为一个分发者的实例</div> <div>statsout是附带的脚本,里面已经定义了output_html,output_xml,output_text</div> <div> </div> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <div>import statsout</div> <div>def output(data, format="text"):<br> output_function = getattr(statsout, "output_%s" % format, statsout.output_text)<br> return output_function(data)</div></blockquote> <div>output_function第三个参数是被定义为缺省参数,在调用 getattr 时添加了第三个参数。第三个参数是一个缺省返回值,如果第二个参数指定的属性或者方法没能找到,则将返回这个缺省返回值</div> <div> </div> <div><br>-- <br>Alex Tu<br>-----------------------------------------------------------<br>ShangHai,China<br></div> Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0tag:blogger.com,1999:blog-7711723124361374275.post-58001956874150567462010-01-26T15:59:00.001+08:002010-01-26T15:59:37.877+08:00Python学习笔记2010026<div>开始学习python.</div> <div>RH5已经开始内置python,而solaris还是没有嵌入但是机器上有,所以开始使用。</div> <div>学习的教程是dive into python.网上有CHM和PDF, 个人现在看,由于篇幅大,但是相对来说基础知识涵盖的比较丰富。</div> <div>安装就不提了,主要是在unix/linux上,所以直接跑。</div> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><a href="mailto:xtuulei@cnshx021:%:python">xtuulei@cnshx021:%:python</a><br>Python 2.4.4 (#3, Dec 3 2007, 12:14:12) <br> [GCC 3.3.2] on sunos5<br>Type "help", "copyright", "credits" or "license" for more information.</blockquote> <div> </div> <div>根据教程,</div> <div>def 定义函数,和抒写规则一样,建议按照标准的书写规则,空行已经。 """ """" 类似于dic string表示好注释一样。</div> <div>if else一样都需要规范书写。</div> <div>模块中定义import sys的时候, 键入sys.__name__可以表现出当前模块。</div> <div> </div> <div>----------------dictionary定义</div> <div>dictionary: 定义参数一一对应</div> <div>d = {"test":"test1",42:"test2","test3":33,44:56} 无先后顺序。</div> <div>定义修覆盖,可添加</div> <div>d["test4"] = 22</div> <div>d["Test"]= 22</div> <div> </div> <div>del ["test4"] 可删除。</div> <div><span class="userinput">d.clear()</span> 清空d</div> <div> </div> <div>键入d显示结果。</div> <div>键入d["test"]显示test值,但是键入d["test1"]不能显示test这个key</div> <div> </div> <div> </div> <div>----------------- list定义</div> <div>类似于数组</div> <div>li = ["a","b","mpilgrim","z","example"]</div> <div>键入li查看结果</div> <div>从0开始计数</div> <div>li[0] 结果等于a</div> <div>但是同时可以反计数,从-1开始</div> <div>li[-5] 结果等于a</div> <div> </div> <div>>>> <span class="userinput">li[1:3]</span> <br><span class="computeroutput">['b', 'mpilgrim']</span></div> <div><span class="computeroutput">您可以通过指定 2 个索引得到 list 的子集, 叫做一个 “<span class="quote">slice</span>” 。返回值是一个新的 list, 它包含了 list 中按顺序从第一个 slice 索引 (这里为 <tt class="literal">li[1]</tt>) 开始, 直到但是不包括第二个 slice 索引 (这里为 <tt class="literal">li[3]</tt>) 的所有元素。</span><br> <tt class="prompt">>>> </tt><span class="userinput">li[1:-1]</span> <br><span class="computeroutput">['b', 'mpilgrim', 'z']</span></div> <div><span class="computeroutput">如果一个或两个 slice 索引是负数, slice 也可以工作。如果对您有帮助, 您可以这样理解:从左向右阅读 list, 第一个 slice 索引指定了您想要的第一个元素, 第二个 slice 索引指定了第一个您不想要的元素。返回的值为在其间的每个元素</span><br><tt class="prompt">>>> </tt><span class="userinput">li[0:3]</span> <br> <span class="computeroutput">['a', 'b', 'mpilgrim'</span></div> <div> List 从 0 开始, 所以 <tt class="literal">li[0:3]</tt> 返回 list 的前 3 个元素, 从 <tt class="literal">li[0]</tt> 开始, 直到但不包括 <tt class="literal">li[3]</tt>。</div> <div> </div> <div>li可以简写,可以将0去除,默认为0</div> <div>li同样和dictionary一样可以增加参数</div> <div>li.append("test") 在最后插入, 先前有个练习,在import sys后,键入sys.path可以看到sys module的具体路径,当打sys.append("path")就是意味在最后插入一段新的库包含的位置。</div> <div><span class="userinput">li.insert(2, <span class="pystring">"new") 如此可以指定li[2]是new,而如果用append加入的那个test换成new,两个不冲突。</span></span></div> <div><span class="userinput"><span class="pystring">li.extend(["test1","test2"])可以增加多个参数</span></span></div> <div><span class="userinput"><span class="pystring"></span></span> </div> <div><span class="userinput"><span class="pystring">extend和append的参数,extend将多个插入对象当作各个分布体,append讲多个插入对象当作一个整体. </span></span></div> <div><span class="userinput"><span class="pystring">PS. len(li)可读li的个数</span></span></div> <div><span class="userinput"><span class="pystring"></span></span> </div> <div><span class="userinput"><span class="pystring">在li[]中查找数目</span></span></div> <div><span class="userinput"><span class="pystring">li.index("test") index用于查询第一个出现的,而且也只显示第一个出现的index</span></span></div> <div><span class="userinput"><span class="pystring">要测试一个值是否在 list 内, 使用 <tt class="function">in</tt>, 如果值存在, 它返回 <tt class="constant">True</tt>, 否则返为 <tt class="constant">False</tt> </span></span></div> <div><span class="userinput"><span class="pystring">"test" in li</span></span></div> <div><span class="userinput"><span class="pystring">True</span></span></div> <div><span class="userinput"><span class="pystring"></span></span> </div> <div><span class="userinput"><span class="pystring">删除li中的数值</span></span></div> <div><span class="userinput"><span class="pystring">li.remove 表示删除首次并只删除一个</span></span></div> <div><span class="userinput"><span class="pystring">li.pop() 表示删除最后一个,并返回该值</span></span></div> <div><span class="userinput"><span class="pystring">list做运算。</span></span></div> <div><span class="userinput"><span class="pystring">>>> <span class="userinput">li = [<span class="pystring">'a'</span>, <span class="pystring">'b'</span>, <span class="pystring">'mpilgrim'</span>]</span><br> <tt class="prompt">>>> </tt><span class="userinput">li = li + [<span class="pystring">'example'</span>, <span class="pystring">'new'</span>]</span> <br><tt class="prompt">>>> </tt><span class="userinput">li</span><br> <span class="computeroutput">['a', 'b', 'mpilgrim', 'example', 'new']</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">Lists 也可以用 <tt class="literal">+</tt> 运算符连接起来。 <tt class="literal"><i class="replaceable">list</i> = <i class="replaceable">list</i> + <i class="replaceable">otherlist</i></tt> 相当于 <tt class="literal"><i class="replaceable">list</i>.extend(<i class="replaceable">otherlist</i>)</tt>。 但 <tt class="literal">+</tt> 运算符把一个新 (连接后) 的 list 作为值返回, 而 <tt class="function">extend</tt> 只修改存在的 list。 也就是说, 对于大型 list 来说, <tt class="function">extend</tt> 的执行速度要快一些。</span><br> <tt class="prompt">>>> </tt><span class="userinput">li += [<span class="pystring">'two'</span>]</span> <br><tt class="prompt">>>> </tt><span class="userinput">li</span><br><span class="computeroutput">['a', 'b', 'mpilgrim', 'example', 'new', 'two']</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="application">Python</span> 支持 <tt class="literal">+=</tt> 运算符。 <tt class="literal">li += ['two']</tt> 等同于 <tt class="literal">li.extend(['two'])</tt>。 </span><br> <tt class="prompt">>>> </tt><span class="userinput">li = [1, 2] * 3</span> <br><tt class="prompt">>>> </tt><span class="userinput">li</span><br><span class="computeroutput">[1, 2, 1, 2, 1, 2]</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><font face="Courier New">*</font> 运算符可以作为一个重复器作用于 list。 <tt class="literal">li = [1, 2] * 3</tt> 等同于 <tt class="literal">li = [1, 2] + [1, 2] + [1, 2]</tt>, 即将三个 list 连接成一个</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span> </div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">------tuple</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">tuple创建和list一样,但是不能修改。 类似于list已经被写保护了。</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span> </div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">-------变量</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span> </div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">如上,变量可以被定义。</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span> </div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>> x =1</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>x</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">1</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span> </div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">一个变量赋多值</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>> <span class="userinput">v = (<span class="pystring">'a'</span>, <span class="pystring">'b'</span>, <span class="pystring">'e'</span>)</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>>('x','y','z') = v</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>>a</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"> x</span></span></span></div> <p><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span> </p> <div><span class="userinput"><span class="pystring"><span class="computeroutput">-------格式化字符串</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>> k = "uid"</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>> v = "sa"</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>> "%s=%s" % (k, v)</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">'uid=sa'</span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span> </div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">>>> <span class="userinput">uid = <span class="pystring">"sa"</span></span><br><tt class="prompt">>>> </tt><span class="userinput">pwd = <span class="pystring">"secret"</span></span><br> <tt class="prompt">>>> </tt><span class="userinput"><span class="pykeyword">print</span> pwd + <span class="pystring">" is not a good password for "</span> + uid</span> <br><span class="computeroutput">secret is not a good password for sa</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="computeroutput"><font face="Courier New">+</font> 是字符串连接操作符。</span><br><tt class="prompt">>>> </tt><span class="userinput"><span class="pykeyword">print</span> <span class="pystring">"%s is not a good password for %s"</span> % (pwd, uid)</span> <br> <span class="computeroutput">secret is not a good password for sa</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput">+和%s是一样的<br><tt class="prompt">>>> </tt><span class="userinput">userCount = 6</span><br><tt class="prompt">>>> </tt><span class="userinput"><span class="pykeyword">print</span> <span class="pystring">"Users connected: %d"</span> % (userCount, )</span> <br> <span class="computeroutput">Users connected: 6</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="computeroutput">字符串格式化通过将 <tt class="literal">%s</tt> 替换成 <tt class="literal">%d</tt> 即可处理整数 后面之所以写成这样就让他定义成一个tuple,让这个东西不可修改。</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="computeroutput">但其实如果</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="computeroutput"></span><font face="Courier New">>>> </font><span class="userinput">userCount = 6</span><br><tt class="prompt">>>> </tt><span class="userinput"><span class="pykeyword">print</span> <span class="pystring">"Users connected: %d"</span> % userCount</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput"></span><span class="computeroutput">Users connected: 6</span></span></span></span></div> <p><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="computeroutput">也是可以实现的</span></span></span></span></p> <div><br><tt class="prompt">>>> </tt><span class="userinput"><span class="pykeyword">print</span> <span class="pystring">"Users connected: "</span> + userCount</span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput">错误</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput"></span></span></span></span> </div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput">>>> print "aha %f" % 13</span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput"><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput">>>> print "aha %2f" % 13</span></span></span></span></span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput"><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput">>>> print "aha %+.2f" % 1.5</span></span></span></span></span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput"><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput">>>> pring "aha %+2f" % 1.5</span></span></span></span></span></span></span></span></div> <div><span class="userinput"><span class="pystring"><span class="computeroutput"><span class="userinput"><font face="Courier New">%f</font> 格式符选项被认为是一个十进制浮点数, 不指定精度时打印 6 位小数。使用包含 ".2" 精度修正符的 <tt class="literal">%f</tt> 格式符选项将只打印 2 位小数。您甚至可以混合使用各种修正符。 添加 <tt class="literal">+</tt> 修正符用于在数值之前显示一个正号或负号。 注意 ".2" 精度修正符仍旧在他原来的位置, 用于只打印 2 位小数。</span></span></span></span><span class="userinput"><span class="pystring"><span class="computeroutput"></span></span></span></div> <div><br></div> <div><br>-- <br>Alex Tu<br>-----------------------------------------------------------<br>ShangHai,China<br></div> Atuhttp://www.blogger.com/profile/14965190183210195675noreply@blogger.com0