跳至主要内容

博文

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 保留字,仅仅表示 “向前走,不要往这看”。它是一条什么都不做的语句,当你删空函数或类时,它是一个很好的占位符。   你可能猜...