2013年4月30日 星期二

Gerrit Fixing the email address


select * from ACCOUNT_EXTERNAL_IDS;
 
 
 
 
Reference : 
Git, Gerrit Review and Jenkins or Hudson CI Servers 

Gerrit 使用 http 驗証

version : gerrit-full-2.5.2.war

(gerrit)$ ./review_sites/bin/gerrit.sh stop
(gerrit)$ vi ./review_sites/etc/gerrit.config
[gerrit]
        basePath = git
[database]
        type = MYSQL
        hostname = localhost
        database = reviewdb
        username = gerrit
[auth]
        type = HTTP
[sendemail]
        smtpServer = localhost
[container]
        user = gerrit
        javaHome = /usr/lib/jvm/java-6-openjdk-amd64/jre
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = proxy-http://127.0.0.1:8081/
[cache]
        directory = cache
(gerrit)$ ./review_sites/bin/gerrit.sh start


# vi /etc/apache2/sites-enabled/000-default

    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

 
    Order deny,allow
    Allow from all
 


 
    AuthType Basic
    AuthName "Gerrit Code Review"
    Require valid-user
    AuthBasicProvider file
    AuthUserFile /home/gerrit/review_sites/etc/htpasswd_gerrit
 


    ProxyPass / http://127.0.0.1:8081/
#    ProxyPassReverse / http://127.0.0.1:8081/
# /etc/init.d/apache2 restart




Reference :
Gerrit复核服务器搭建简易教程(Ubuntu 12.10)
Chromatic Coder: 架設Gerrit和Git

2013年4月29日 星期一

Push existing git repositories to Gerrit

$ git push ssh://user@gerrit.server:22/home/gerrit/review_sites/git/my_project.git HEAD:refs/heads/master


* 不要向 Gerrit server port 推送 (port 29418) (not using the Gerrit server’s SSH port)




Reference :
One or more refs/for/ names blocks change upload

Python get CPU frequency


import re
pattern = re.compile("^cpu MHz\s*:\s*(?P.+)$", re.M)
for line in open('/proc/cpuinfo'):
    match = pattern.search(line)
    if match:
        return 'Cpu: %.1f GHz' % (float(match.group('cpu_frequency').strip()) / 1000)




Reference :

Python get CPU temperature

cat = lambda file: open(file, 'r').read().strip()
temp = cat('/sys/class/thermal/thermal_zone0/temp')
print '%1.f°C' % (float(temp) / 1000)


# http://www.mjmwired.net/kernel/Documentation/hwmon/sysfs-interface

$ cat /sys/class/hwmon/hwmon0/temp1_input




Reference :

Getting CPU temperature using Python? - Stack Overflow

qtile config

$ vi ~/.config/qtile/config.py




Reference :
Qtile Documentation — Qtile 0.5 documentation
Qtile - ArchWiki


Паста №241

2013年4月24日 星期三

Jenkins phpmd

# pear channel-discover pear.phpmd.org
# pear channel-discover pear.pdepend.org
# pear install --alldeps phpmd/PHP_PMD

phpmd . html codesize,unusedcode,naming,design --reportfile build/phpmd.html || :