讄Git代理
$git config --global http.proxy http://192.128.1.3:80
$ git config -l
http.proxy=http://192.128.1.3:80
讄Gem代理
$ export http_proxy=http://192.128.1.3:80
gem install rails --http-proxy $http_proxy
让Bundler使用HTTP代理环境讄
sudo -E bundle ...
如果你是非root用户Q比如用Git用户讄http代理后,使用gem-fast会报如下错误Q?/p>
curl: (7) couldn't connect to host
ERROR: While executing gem ... (GemFast::Util::ExecutionError) Failure while executing: curl -f#LA rubygem-gemfast http://ruby.taobao.org/quick/Marshal.4.8/bundler-1.3.5.gemspec.rz --insecure -o /home/git/local/lib/ruby/gems/1.9.1/cache/bundler-1.3.5.gemspec.rz
目前的还没找到根本的解决办法Q原因是授权的问题,因ؓroot用户执行׃报错Q所以只能卸?strong>gem-fastQ这样就不报错了Q但是就不能使用gem-fast的快速下载功能了。那位牛解决q个问题请告之小弟,谢谢Q?/p>
主要参考文? https://github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/installation.md
yum install libicu-devel mysql-devel pcre-devel
安装python,官方要求版本必须?.5以上Q而且不支?.0,Fedora一般的版本都在2.7以上Q因此直接安装源自带的即?/p>
yum install python
安装完查看下版本
python --version
q要保python2命o有效
python2 --version
如果提示 默然安装ruby2.0, GitLab推荐?.9.3 q要安装Bundler 创徏一?nbsp; 让git用户无密码登?/p>
L用户的叹?/p>
加入sudol?/p>
切换到git用户 克隆GitLab Shell 切换到最新的分支 生配置文g 更改配置信息Q一般就改下你部|的域名地址gitlab_url 安装 gitlab支持mysql和postgresqlQ这里以mysqlZQpostgresql会比较麻烦! 切换回root用户 安装mysql及开发包 启动数据?/p>
初始化GitLab数据?/p>
试gitlab用户q接mysql l于到GitLab的安装了Q进入git用户 克隆GitLab 切换?.0E_分支 首先~辑/home/git/gitlab/config/database.yml 执行rake 重新执行rake 如果你看到如下信? 恭喜你!你已l成功安装GitLab了!别忘了记录输出的理用户名和密码Q?/strong> Ok,你现在可以访问GitLab了,默认端口?@3000@Q?讉K http://你的域名或IP:3000 哈哈Q看到登陆页面了吧! 输入理用户名和密码Q开始n受GitLab吧!bash: python2: 未找到命?/code> ,那你需要link一?/p>
sudo ln -s /usr/bin/python /usr/bin/python2
安装Ruby
mkdir /tmp/ruby && cd /tmp/ruby
curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz
cd ruby-1.9.3-p392
./configure
make
sudo make install
curl -#L https://get.rvm.io | bash -s stable --ruby
rvm install ruby-1.9.3-p392
sudo gem install bundler
dpȝGit用户
git
用户供GitLab使用adduser --comment 'GitLab' git
sudo chmod 644 /etc/shadow vim /etc/shadow
git:!!:15814:0:99999:7::: 修改?git::15814:0:99999:7:::
chmod u+w /etc/sudoers
vim /etc/sudoers
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
git ALL=(ALL) ALL #加入q行安装GitLab Shell
su - git cd ~/
git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
cp config.yml.example config.yml
vim config.yml
# Url to gitlab instance. Used for api calls. Should be ends with slash.
gitlab_url: "http://localhost/" #Ҏ(gu)你的域名或者IP./bin/install
安装数据?/h4>
su - root
yum install -y mysql-server mysql mysql-devel
service mysqld start
mysql -u root -p
Enter password:
Welcome to the MySQL monitor.
Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.30 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'gitlab';
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> \q
Bye
sudo -u git -H mysql -u gitlab -p -D gitlabhq_production
安装GitLab
su - git
cd ~/
sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab
cd gitlabsudo -u git -H git checkout 5-0-stable
配置
cd /home/git/gitlab
# 用样例配|生成gitlab配置
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
# 更改域名
sudo -u git -H vim config/gitlab.yml
# 保gitlab?log/ ?tmp/ 目录有写权限
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX log/
sudo chmod -R u+rwX tmp/
# 创徏附属目录
sudo -u git -H mkdir /home/git/gitlab-satellites
# 创徏pids目录q确保对gitlab可写
sudo -u git -H mkdir tmp/pids/
sudo chmod -R u+rwX tmp/pids/
# 生成Unicorn配置
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
配置GitLab DB讄
# Mysql sudo -u git cp config/database.yml.mysql config/database.yml
安装Gems
cd /home/git/gitlab
sudo gem install charlock_holmes --version '0.6.9'
# For MySQL (note, the option says "without")
bundle install --deployment --without development test postgres
初始化数据ƈȀz高U特?/h4>
#
# PRODUCTION
#
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: gitlabhq_production
pool: 5
username: root
password: "secure password" #更改Zmysql的root用户密码
# host: localhost
# socket: /tmp/mysql.sock
#
bundle exec rake gitlab:setup RAILS_ENV=production
解决办法Q?br />
切到root,安装Redis
bc(command). yum install redis*
service redis start #启动redisbundle exec rake gitlab:setup RAILS_ENV=production
/home/git/repositories/root
目录找不刎ͼ手工Z卛_Q?/div>
...
Administrator account created:
login.........admin@local.host
password......5iveL!fe
启动GitLab
bundle exec rails s -e production
=> Booting WEBrick
=> Rails 3.2.13 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-04-19 15:04:41] INFO WEBrick 1.3.1
[2013-04-19 15:04:41] INFO ruby 1.9.3 (2013-02-22)
[x86_64-linux] [2013-04-19 15:04:41] INFO WEBrick::HTTPServer#start: pid=11488 port=3000
W一讉K会比较慢Q因~译很多js和css.
首先安装一些依赖库Q否则安装Awestruct会报如下的错误:
Building native extensions. This could take a while...
.........
ERROR: Error installing 开始安装依赖库Q用 root 用户或?nbsp;su 执行如下命oQ?/p>yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
我是Fedora的粉丝,对不住用其它发行版的童鞋了,误行根据我列出的安装包扑ֈ对应的系l安装方法?/div>安装Ruby和RubyGems,?nbsp;root 用户或?nbsp;su 执行如下命oQ?/p>
yum install ruby ruby-devel ruby-irb rubygems
Fedora18 Yum源的Ruby非常斎ͼ都是目前(2012-12-14)的最新版本,看看安装的Ruby版本Q?/p>
正在安装 : libyaml-0.1.4-3.fc18.x86_64 1/10
正在安装 : ruby-libs-1.9.3.327-22.fc18.x86_64 2/10
正在安装 : ruby-irb-1.9.3.327-22.fc18.noarch 3/10
正在安装 : rubygem-json-1.6.5-2.fc18.x86_64 4/10
正在安装 : rubygem-io-console-0.3-22.fc18.x86_64 5/10
正在安装 : rubygem-bigdecimal-1.1.0-22.fc18.x86_64 6/10
正在安装 : rubygem-rdoc-3.12-5.fc18.noarch 7/10
正在安装 : rubygems-1.8.24-3.fc18.noarch 8/10
正在安装 : ruby-1.9.3.327-22.fc18.x86_64 9/10
正在安装 : ruby-devel-1.9.3.327-22.fc18.x86_64
安装Awestruct
Awestruct使用RubyGems理安装Q用 root 用户或?nbsp;su 执行如下命oQ?/p>
gem install l果报如下错?Fetching: nokogiri-1.5.5.gem (100%)
ERROR: Error installing q个问题让我郁闷了N久时_Google了大半天Q还Ҏ(gu)搞了FANQIANGQ结果死z装不上nokogiri。最后通过Yum来解?我只能说RubyGems安装很无耻!q是YUM好!Q命令如下:yum install -y rubygem-nokogiri
再次安装AwestructQ?/p>
yum install -y rubygem-nokogiri
盼望已久的时L_如果哪位童鞋看到如下的输出,CongratulationsQ?/p>
Successfully installed 不过别高兴太早,先适用下是否OKQ用BootStrap模板生一个新的静态网站,命o如下Q?/p>ȝ了,q是报错Q?/p>[root@localhost kuuyee]# 思义Q提C没有JavaScript Runtime。lGoogleQ最后一位高人指点说装个JavaScript引擎O(jin)KQ我选择NodeJS。只可惜NodeJSF没有YUM源,只能源码~译安装Q无所谓,l箋:wget -c 'http://nodejs.org/dist/v0.8.16/node-v0.8.16.tar.gz'
tar zxvf node-v0.8.16.tar.gz
cd node-v0.8.16
./configure
make && make install
又是一阉|O长的{待Q搞不明白一个JS框架怎么要编译这么久Q无语!最后编译完成测试一下:
[root@localhost node-v0.8.16]# node -v v0.8.16
OK,l箋Awestruct试Q?/p>
[root@localhost kuuyee]# 竟然qTMD报错Q不q这回不用急,只是提示没装GitQ好办!那就装呗Q?/p>yum install git
再lAwestructQ?/p>
[root@localhost kuuyee.org]# 下一代静态网站生成工?/a>!
To generate your site continuous during development, simply run:
Congratulations! q回真的恭喜你了Q赶紧部|一下:
[root@localhost kuuyee]#
打开 http://localhost:4242/ 看看吧!

l心的童鞋一定会注意到部|输出有警告Q我是属于不想看CQ何警告的人,所以还得l,清楚警告Q?/p>
gem install --version '~> 0.8.8' rb-inotify
再次部v讉K׃会有警告了!
大功告成Q祝愿各位童鞋安装成功!

]]>用Weblogic WLST脚本 q程部vWeb应用 http://www.aygfsteel.com/kuuyee/archive/2011/10/13/361213.htmlkuuyee kuuyee Thu, 13 Oct 2011 15:46:00 GMT http://www.aygfsteel.com/kuuyee/archive/2011/10/13/361213.html http://www.aygfsteel.com/kuuyee/comments/361213.html http://www.aygfsteel.com/kuuyee/archive/2011/10/13/361213.html#Feedback 1 http://www.aygfsteel.com/kuuyee/comments/commentRss/361213.html http://www.aygfsteel.com/kuuyee/services/trackbacks/361213.html 1 import re
2
3 warPath = 'helloWebApp'
4 serverUrl = 't3://192.168.1.100:7001'
5 username = 'weblogic'
6 password = 'weblogic'
7 targetServer="examplesServer"
8 deployAppName='DeployExample2'
9
10
11 connect(username, password, serverUrl)
12
13 appList = re.findall(deployAppName, ls('/AppDeployments'))
14 print "========================="
15 print len(appList)
16 if len(appList) > 0:
17 #oldestArchiveVersion = min(map(int, appList))
18 print 'come in!!!'
19 undeploy(deployAppName)
20
21 #deploy(appName='DeployExample', path = 'helloWebApp', targets = 'examplesServer',timeout=600000, block = 'true')
22
23 deploy(deployAppName, warPath, targets=targetServer, securityModel = "Advanced",timeout=600000, block = "true")
24 exit()Ok
]]> CentOS5.4安装Trac记录 http://www.aygfsteel.com/kuuyee/archive/2011/10/08/360212.htmlkuuyee kuuyee Sat, 08 Oct 2011 09:52:00 GMT http://www.aygfsteel.com/kuuyee/archive/2011/10/08/360212.html http://www.aygfsteel.com/kuuyee/comments/360212.html http://www.aygfsteel.com/kuuyee/archive/2011/10/08/360212.html#Feedback 0 http://www.aygfsteel.com/kuuyee/comments/commentRss/360212.html http://www.aygfsteel.com/kuuyee/services/trackbacks/360212.html
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-4.noarch.rpm
yum install libffi -y
yum install python26 -y
rm -f /usr/bin/python
ln -s /usr/bin/python26 /usr/bin/python
vim /usr/bin/yum
python -V
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
easy_install Babel==0.9.5
easy_install Trac
trac-admin easyci_project initenv
tracd --port 8000 /easyci/trac/easyci_project
trac-admin /easyci/trac/easyci_project permission add admin TRAC_ADMIN

]]>(转蝲)CentOS中简单用yum升 Python ?.6 http://www.aygfsteel.com/kuuyee/archive/2011/10/08/360206.htmlkuuyee kuuyee Sat, 08 Oct 2011 09:26:00 GMT http://www.aygfsteel.com/kuuyee/archive/2011/10/08/360206.html http://www.aygfsteel.com/kuuyee/comments/360206.html http://www.aygfsteel.com/kuuyee/archive/2011/10/08/360206.html#Feedback 1 http://www.aygfsteel.com/kuuyee/comments/commentRss/360206.html http://www.aygfsteel.com/kuuyee/services/trackbacks/360206.html http://vpshello.com/upgrade-python-to-26-with-yum/
写了不少VPS评测Q今天发个简单的技术帖?/p>
CentOS 在当前最新的 5.6 版中Q其 python 的版本依然比较落后,q是古老的 2.4?/p>
但是有些E序需?2.6 才跑得v来,~译安装的话Q又太麻烦,而且不适合菜鸟使用?/p>
下面qZ?yum 升 python ?2.6 的简单方案?/p>
1: rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/i386/epel-release-5-4.noarch.rpm
2: yum install libffi -y
3: yum install python26 -y
4: rm -f /usr/bin/python
5: ln -s /usr/bin/python26 /usr/bin/python
如果?64 位的 CentOSQ则上q第一句代码中?i386 改ؓ x86_64 卛_?/p>
q行完毕后,此时pȝ默认?python 已经?2.6 版了?/p>
然而,yum 是基?python2.4 的,因此会出现故障。解x法也很简单:
1: nano /usr/bin/yum
第一行末?python 后加?2.4Q即第一行改为:
#!/usr/bin/python2.4
q样Qyum 依然使用 python 2.4 环境q行Q一切恢复正常?/p>
此时我们输入 python -V 卛_看到当前?python 版本Q?/p>
1: # python -V
2: Python 2.6.5

]]>