I find your lack of tests disturbing. [ Image file downloaded from flickr ]
不能curl localhost?
前几天遇到的诡异问题,今天有空记录一下。 $ curl http://localhost/ curl: (7) couldn't connect to host
第一反应server没开,马上检查一下,明显开着呀,browser也能访问,curl就是不能连接,够郁闷的…… curl - -version这才发现了问题,原来macports默认安装的curl是不带ssl, gss等功能的,编译的时候都disable掉了…… 解决的办法就是重新install一个curl的variant,由于git-core depend到curl,所以为了uninstall curl,我们需要先uninstall git-core。 uninstall both $ sudo port -v uninstall git-core curl
好久不更新portfile tree了,update一下 $ sudo port -v selfupdate
install curl variant with ssl, ipv6, gss, openldap and sftp_scp support $ sudo port -v install curl +ssl +ipv6 +gss +openldap +sftp_scp
顺便把我的git从1.6.3升级到了1.6.4 $ sudo port -v install git-core
这时再去curl -v http://localhost/ 就不会很诡异的说无法连接localhost了。
123456789
just get a sms, share here in case some one else haven’t received it: “Do you know, At 12hr 34 minutes, 56 seconds on 7th August this year, the time and date will be 12:34:56 07/08/09 (123456789). This will never happen in your life again! Amaze your friends, be the first to tell them!”
Update-18
1. 有些时候事情并不都会岁遂你所愿,也许你定好了计划,做好了准备,但是某天起来你还是会突然发现 everything changes⋯⋯ 是的,我们还需要为变化做好准备,没有谁的奶酪不能动,the only thing not change is change itself. 2. 我们无法改变别人对自己的看法,你能做的最多只是影响,那是人家的主观,你动不了。靠主观来决断是危险的,对的时候是英明果断,错的时候便是冲动冒失。即便如此,现实世界还是有太多的主观臆断,公平还是不公平也不是比谁喉咙喊的响的⋯⋯ 3. 鉴于有人很 curious 我前些天非常火大的原因,这样说吧,当你发现你平时认为可以值得信任的人睁着眼睛对你说瞎话,而你却不能揭穿,只能强忍着假装真的被骗了的时候,你会不会也很窝火。 我个人的忠告:任何时候都不要首先考虑欺骗,无任你是出于什么狗屁的善意还是恶意(一般没人会说自己出于恶意,so⋯⋯) 4. 最近牙龈老毛病又犯了(本人四颗磨牙3颗不幸遇过难,从小饱受牙医器具和消毒药水的摧残),虽然现在都已经很适应了,但也请看着我每天只能吃面包的悲惨境遇下快点好转吧⋯⋯ 5. 强烈推荐nulltao的slackware系列,共同围观nulltao大哥不鸣则已,一鸣那啥的壮举~
Cool Sentences-2
The former one: Cool Sentences-1 Interest is the best teacher. 兴趣(热爱)是最好的老师。 —— Albert Einstein Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius— and a lot of courage— to move in the opposite direction. 任何一个有智力的笨蛋都可以把事情搞得更大,更复杂,也更激烈。往相反的方向前进则需要天份,以及很大的勇气。 —— Albert Einstein Anyone who has never made a mistake has never tried anything new. 一个人从未犯错的原因是因为他不曾尝试新鲜事物。 —— Albert Einstein As our circle of knowledge expands, so does the circumference of darkness surrounding it. 当我们的知识之圆扩大之时,我们所面临的未知的圆周也一样。 —— Albert Einstein Education is what remains after one has forgotten everything he learned in school. 教育就是当一个人把在学校所学全部忘光之后剩下的东西。 —— Albert Einstein If A is a success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut. 如果A代表一个人的成功,那麼A等于x加y加z。勤奋工作是x;y是玩耍,而z是把嘴闭上。 —— Albert Einstein The difference between genius and stupidity is that genius has its limits. 天才和愚蠢之间的区别就是天才有它的限制。 —— Albert Einstein Life is like riding a bicycle. To keep your balance you must keep moving. 人生就像骑单车。想保持平衡就得往前走。 —— Albert Einstein Try not to become a man of success, but rather try to become a man of value. 不要试图去做一个成功的人,要努力成为一个有价值的人。 —— Albert Einstein
Update-17
1. 新一批 campus new hire 又开始 training 了,使我突然意识到时间过的飞快,看到那一张张稚气未脱的年轻的脸庞里那充满希望和活力的眼神,总能让人精神为之振奋,但同时又陷入回忆和沉思 —— 确实,当我们还在唏嘘一年光阴弹指一挥间的时候,又一批纯洁的心灵正慢慢进入混浊,虔诚的祷告着,勇敢地准备着面对办公室政治和世俗的亵渎的开始 …… 2. 如果现在有人整天歌颂世界和平,祖国美好,我们都会觉得这不是软文就是作者脑子有毛病,但是很奇怪的是当同样的rule作用于自己,似乎都会柳暗花明,现在看来这并不奇怪,人们都喜欢以双重标准对待自己和别人…… 上段文字来源于感叹某一大赛已经渐渐演变为软文大赛的事实,如果有人很乐忠,我们不会奇怪;但如果有人不乐忠也不喜欢,也请不要奇怪,这和有人喜欢看凤凰卫视,不喜欢看ccav、新闻联播是同样的道理…… 3. 周末晚上实在无聊的看了几集 how i met your mother 的结果是我现在学到了一个人生哲理,并且正在和大家分享,以下文字摘自S04E06里Ted的最后旁白:
In that moment, I wasn’t angry anymore. Kids, you may think your only choices are to swallow your anger or throw it in someone’s face. There’s a third option: you can just let it go, and only when you do that is it really gone, and you can move forward.
4. 周六走了一天,从早到晚,终于把租房的事情搞定了一半,累到晚上做梦都在走迷宫,第二天起来人都打晃,迷宫走多了估计…… 下次谁要到五角场附近租房尽管找我,我那一带现在熟悉的要死…… 5. 热烈欢迎Sunng同学前来上海莅临指导,上海欢迎你,有梦想就会有那啥~
Into The Fire
media downloaded from google.cn music Thirteen Senses - Into The Fire come on, come on put your hands into the fire explain, explain as I turn and meet the power this time, this time turning white and senses dire pull up, pull up from one extreme to another from the summer to the spring from the mountain to the air from Samaritan to sin and it’s waiting on the end come on, come on put your hands into the fire explain, explain as I turn and meet the power this time, this time turning white and sense dire pull up, pull up from one extreme to another from the summer to the spring from the mountain to the air from Samaritan to sin and it’s waiting on the end and now I’m alone I’m looking out, I’m looking in way down, the lights are dimmer now I’m alone I’m looking out , I’m looking in way down, the lights are dimmer ooooh come on, come on put your hands into the fire come on, come on
Update-16
1. 昨晚看了Marshall介绍的纪录片—— “北漂一族.~北京·彷徨的年轻人”,颇有感慨,晚上一度睡不着觉,但后来在我的一再坚持下,终于还是睡着了…… 简介可参见上面的链接,据说已经被和谐了,更说明了其是值得一看的,广电总局以及一系列**局的和谐分界线在这方面是绝对权威的,我十分的信任。 2. 介绍了一部纪录片后再介绍一部小说,我还没怎么仔细看,并没有发言权,这里拿出来说事完全是由于口碑效应,因为有两个以上的我觉得蛮靠谱的人都曾经向我推荐过。小说名字叫“明朝那些事儿(全集)”,加上全集俩字的原因是作者一共整出了7本,颇为壮观,毛泽东全集也就5卷而以。 这里有个电子版的地址,可供大家简单浏览,美中不足的是,该网站用js做了双击鼠标的事件处理,我一不留神双击下鼠标(我看文章的时候总喜欢用鼠标圈圈画画),网页就会很“人性化”的自动往下移,由于翻页亦是用js实现,所以全局禁掉js看来是行不通了,如果大家有什么别的好的方法或是找到别的电子版的请通告一声,谢了~ 3. 老罗有句精彩的演说词,“人一出生注定必将改变世界,你变的恶心了一点点,整个世界也会因此变的恶心一点点;你变的美好了一点点,整个世界也会因此变的美好一点点”,献给所有注定改变世界的人们…… 4. 大伙要乐观,有事没事都可以找我喝茶,白开水也可以:-) over,今天严肃了点,大伙见谅……
Redmine on Archlinux
[Overview] This entry will describe a basic installation and configuration of redmine, a flexible and cross-platform project management web application, on an archlinux system. For the official installation guide, please refer this wiki page. [Preparation] 1. Download the latest stable release of redmine (0.8.4) from rubyforge: $ wget http://rubyforge.org/frs/download.php/56909/redmine-0.8.4.tar.gz
2. Install ruby and ruby on rails (Notes: rails is optional since the redmine official release we download above already include the appropriate rails version (2.1.2) in its vendor directory) 3. Make sure rubygems and rake meet the version requirement of redmine: gem -v >= 1.3.1
rake --version >= 0.8.3
[Database] mysql is the recommended database of redmine, so here we will use mysql: $ sudo pacman -S mysql
start mysql: $ sudo /etc/rc.d/mysqld start
refer this wiki page for more information about mysql installation. [Basic installation] step 1: create redmine db with user “redmine” $ mysql -u root -p mysql> create database redmine character set utf8; mysql> create user 'redmine'@'localhost' identified by 'password'; mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
step 2: configure redmine database settings for “production” environment $ cd redmine-0.8.4 $ cp config/database.yml.example config/database.yml
edit config/database.yml, make the production section looks like:
production: adapter: mysql database: redmine host: localhost username: redmine password: password encoding: utf8
step 3: create database structure and an administrator account $ rake db:migrate RAILS_ENV="production"
the default administrator account is:
username: admin password: admin
step 4: insert default configuration data in database $ rake redmine:load_default_data RAILS_ENV="production"
according to the official wiki, this step is optional but highly recommended. It will load default roles, trackers, statuses, workflows and enumerations for our convenience. step 5: test installation start mongrel: $ script/server -e production
point your browser to navigate http://server-domain-or-ip:3000/ to see the redmine welcome page, use the default admin account above to login. redmine home: redmine administration setting: [Deploy using phusion passenger (aka mod_rails)] step 1: install passenger and its apache 2 module install passenger: $ sudo gem install passenger
install apache 2 module, please make sure g++, ruby, openssl and apache are installed before issue the command below: $ sudo passenger-install-apache2-module
follow the screen instructions and pay attention to the console output, some of them will be used later. step 2: deploy and set up permissions $ sudo mkdir -p /srv/http/rails $ sudo cp -r redmine-0.8.4 /srv/http/rails/ $ sudo chown -R http:http /srv/http/rails/redmine-0.8.4
step 3: configure apache to use passenger add one include at the end of httpd.conf: $ sudo echo "Include conf/extra/httpd-rails.conf" >> /etc/httpd/conf/httpd.conf
create the httpd-rails.conf: $ cd /etc/httpd/conf/extra $ sudo touch httpd-rails.conf
edit httpd-rails.conf, follow the former console output and add the passenger configuration there, below is my configuration, yours may be differ:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4 PassengerRuby /usr/bin/ruby NameVirtualHost :80 <VirtualHost :80> ServerName SERVER-DOMAIN-OR-IP DocumentRoot /srv/http/rails/redmine-0.8.4/public RailsEnv production ErrorLog /var/log/httpd/rails_error_log CustomLog /var/log/httpd/rails_access_log common
step 4: restart apache and test installation $ sudo /etc/rc.d/httpd restart
navigate http://SERVER-DOMAIN-OR-IP/ to see if anything is broken. [Optional components] we use subversion for repository browsing: $ sudo pacman -S subversion
and enable Gantt export to png image: $ sudo pacman -S imagemagick $ sudo gem install rmagick
[Themes] I like the Basecamp theme: $ cd /srv/http/rails/redmine-0.8.4/public/themes $ sudo wget http://www.redmine.org/attachments/1274/basecamp.zip $ sudo unzip basecamp.zip $ sudo chown -R http:http basecamp $ sudo rm basecamp.zip
then the basecamp theme option is available in the drop-down list of “Theme” in the “General” tab under “Administration -> Settings”. [SMTP] to be continued… [Plugins] to be continued…