Gmail 支持 Themes 了。瞧我选的这个,还挺漂亮吧?

默认的是一款蓝色 Theme,要选择其他的,直接进入 Settings - Themes 设置即可。
博客聚合每天都定时收集来自其中的每个博客的当然信息,并整合发布,同时提供整合的RSS Feed,是结交朋友、切磋技术、了解Rails在国内应用和发展动态的好工具。如果您有使用博客阅读器(比如Google Reader,Blogline),可以在浏览器中直接订阅整合后的RSS Feed.
Gmail 支持 Themes 了。瞧我选的这个,还挺漂亮吧?

默认的是一款蓝色 Theme,要选择其他的,直接进入 Settings - Themes 设置即可。
http://digitalmediaminute.com/howto/fc4rails/
Installing Ruby on Rails with Lighttpd and MySQL on Fedora Core 4
DataMapper, the ruby object relational mapper
website: http://www.datamapper.org
git: git://github.com/sam/dm-core.git
mail: http://groups.google.com/group/datamapper
now: http://www.twitter.com/datamapper
Setting up a Connection
DataMapper.setup(:default, “adapter://user:password@hostname/dbname”)
supported adapters: mysql, sqlite3, postgres, sqlite3::memory:
additional adapters are in dm-more, (couchdb, rest, imap, file, saleforce…)Creating a Model (with properties)
class Zoo
include DataMapper::Resource
property :id, Serial
endProperties
property :id, Serial # auto-incrementing PK
property :name, String, :key => true # natural key
# you must specify >= 1 key, CPK support 100%# available data-types
property :description, Text # (lazy by default)
property :created_at, DateTime
property :open, Boolean
property :admission, BigDecimal# require dm-types for Csv, Enum, EpochTime, FilePath, Flag,
# IPAddress, URI, YamlProperty Options (pass as hash)
:default, :nullable, :field (column name), :size, :length, :format,
:index, :unique_index, :ordinal, :auto_validate, :precision,
:scale, :accessor, :reader, :writer, :lazyFinders
Zoo.get(PK_HERE)
Zoo.first({see_below})
Zoo.all({see_below})Finder Options (pass as hash)
:conditions => ["property = ? and property = ?", 'value', 'value']
:conditions => {:property => ‘value’, …}
:property => ‘ZooNameHere’
# any non-standard key => value pair is assumed a condition if not
# otherwise recognized
:property.lte => 12.00 # =
.gte # >=
.gt # >
.lt #
.not # NOT =
.like # LIKE
.in # IN ()
'class.property' => ‘value’
Class.relationship.property => ‘value’ # will automatically issue JOINSFinder Gotcha
:order => [:created_at.desc, ...] # descending sort
.asc # ascendingAssociations
has 1 # has_one
has n # has_many
belongs_to :things
has n, :things, :through => :more_things
has n, :things, :through => Resource # has_and_belongs_to_manyAssociation Options
(any Finder Options)
:class_name => ‘ClassNameHere’
:order => [:property.desc]
:child_key => [:property, ...]
:through => :other_associationValidations (require ‘dm-validations’)
validates_present :title
validates_is_number :rating
validates_format :email, :as => :email_address
validates_length :summary, :in => (1..100)
validates_is_unique :slug
validates_with_method (do…end, :method_name)Callbacks AKA “Hooks”
Object-level
before :method_name, (do…end, :another_method_name)
after :method_name, (do…end, :another_method_name)
Class-level
before_class_method :method_name, (do…end, :another_method_name)
after_class_method :method_name, (do…end, :another_method_name)Callbacks Gotcha
Hooks act on ’self’ and aren’t passed an arguement
’self’ for object-level hooks are the instance
’self’ for class-level hooks are the class itselfMisc. Stuff & Gotchas
Single Table Inheritance
property :type, Discriminator # then inherit from this modelParanoia
property :deleted_at, ParanoidDateTime
property :deleted, ParanoidBooleanMultiple DB Connections
DataMapper.setup(:external, “adapter://username:password@hostname/dbname”)
repository(:external) do…end
Association: has n, :things, :repository => repository(:external)
Finder: Thing.all(:repository => repository(:external))
#context-back,
#context-forward,
#context-reload,
#context-stop,
#context-sep-stop,
#context-bookmarkpage,
#context-savepage,
#context-sendpage,
#context-sep-viewbgimage,
#context-openlink,
#context-sep-open,
#context-bookmarklink,
#context-sendlink,
#context-sep-copyimage,
#context-sendimage,
#context-setWallpaper,
#context-printpage,
#context-smartsearch
{ display: none !important; }
David Heinemeier Hansson 最近开始写系列文章The Rails Myths,主要是对一些关于 Rails 的不实传言进行批驳。第一篇 Myth #1: Rails is hard to deploy,讲的是所有 Rails 开发者都非常关心的部署问题。
Rails 应用很难部署吗?我个人两年多的经验得出的结论是,可能会有些麻烦,但一点都不难。当然,我参与的一些项目都不大,日 PV 也没有几十万那种规模(不过那好象应该是扩展和伸缩的话题),但两年多的部署变化历程,现在看来其实非常简单:
起初,使用 Nginx + Mongrel Cluster,算是很经典的组合。这种方式结合 Capistrano 还是挺方便的。唯一稍嫌麻烦的是,如果服务器意外重启了,mongrel 实例遗留的 pid 文件会造成新实例无法启动。很糟糕,但可以忍受。
今年 Passenger (mod_rails) 横空出世。Passenger 吸引我的有三个地方:
DHH 说:This could become very popular, very fast!
作者 Hongli Lai 的华人面孔和姓名
发布 Rails 应用可以用简单的 FTP 上传 + tmp/restart.txt 文件来实现
可惜的是,Passenger 必须跟 Apache 一起用(Hongli Lai 他们自己用 Nginx 作前端来均衡到不同的 Apache,不过那是另外一回事)。考虑到它的方便性,用 Apache 就用吧。
目前,手上的服务器和项目,都已经迁移到 Apache + Passenger 方案。效果相当不错,Capistrano 部署脚本也简单了不少。
我依然记得在蔚蓝时我们部署 asp.net 2 应用的方式:我们用自己编写的 MSBuild 脚本自动编译要发布的新版,然后上传生成的新版本至服务器 (Win2K3),手工覆盖原来的版本。如果应用 Capistrano 的一些办法进去,这个过程可以更自动化更方便一些,但整个蔚蓝网站编译就需要好几分钟(其实这速度已经不赖了)这个事实就让整个发布显得很慢。
部署 Rails 一点都不难,当然前提是你掌握了基本的知识和技能。
深夜,开始升级,突然办公室断网,然后发现WEB服务器SSH不进去,Ping可以ping通,这个机器装了全站的nginx,导致全站都无法访问,非常紧急。
打电话让机房重启,打了几十遍都没人接,幸好是在深夜,要不还不被投诉死,无奈,打车去中关村那边的机房,Y的看到三个值班的都在睡觉,FT。
找到机柜,找到机器,没找到重启按钮,无奈,扯下电源线,再连接上,OK,重启,,重启后SSH进去,恢复。
想那机房也算有口碑的,客服dianhu
http://www.brightbox.co.uk/
Brightbox provides Virtual Dedicated Servers optimised for Ruby on Rails hosting.Senior Software Engineer 高级软件(网站)开发工程师
工作年限:1-3年 招聘人数:若干
学历:大专
要求:
1 了解HTML, javascript, XML
2 有LAMP(Linux+Apache+MySQL+PHP)平台或者J2EE平台开发经验, 精通面向对象编程,了解设计模式;
3 熟悉Mysql(或者SQL Server、oracle);熟悉数据库建模,有一定的数据结构基础;
4 熟悉div+CSS, XML/XSLT. 有Ruby On Rails, AJAX,LISP开发经验者优先。
5 1年以上网站开发经验。
DSC create, host and manage high quality web services. Using the best web development tools available we build high performance, scaleable, robust applications for a wide range of corporate clients from start-ups to multinationals. We undertake fixed-price development projects as well as providing consultants to work with our clients.
Using Ruby on Rails and our own custom-built Java framework we have built applications for a collection of prestigious clients. Not only that, we also offer high performance hosting in our top tier data centre. We specialise in complex hosting requirements such as clustering, multi-layer applications and disaster recovery provision.
We also provide infrastructure design services and integration with legacy systems, particularly for e-mail, messaging and other infrastructure-intense applications. Our hosting offerings are built around fully redundant networks, with 24/7 monitoring and engineer response.
DSC are based in London and have worked with clients across Europe and also in New York, USA. Contact us today to discuss your requirements.
Ruby on Rails软件工程师
工作年限:3-5年 招聘人数:5人
学历:不限
Requirements:[基本要求]
1.至少有一个Ruby on Rails项目开发经历
2.3年以上软件开发工作经验
3.熟悉SQL,
4.熟悉web应用开发
5.熟悉HTML, CSS, JavaScript
Desired:[要求]
1.有计费系统项目开发经验
2.熟悉Linux系统
Personal Skills:[个人技能]
1.必须具有良好的团队意识,积极进取
2..必须具有较高的工作效率
Starting at just $3.59 / month. High-quality Ruby hosting plans optimized for the rapid and reliable deployment of Ruby on Rails web applications. Mongrel, mongrel_cluster, FastCGI, LightTPD, PostgreSQL, and more…

地点:正德学院1104阶梯教室
时间:2008-11-7 14:00-16:00
主办单位:南京赛威信息
承办单位:正德职业技术学院
讲师介绍:
王庭兵老师拥有6年的LINUX,Php,java等培训,多年的开发,三年的ROR使用经验。曾培养过上万名的LINUX人才。担当开发过大型B2B网站和欧美日本的大型BS服务。
内容说明:
Ruby语言和Rails框架的介绍
Ruby on Rails 的优势和情景
Ruby on Rails的就业情况等






ror视频
其实一直觉得国际化的工具都没必要用的, 把所有要国际化的文字全部定义成变量放在一个文件中,每种语言对应一个文件,然后再结合JS来调用, 我觉得这样的方法就可以很方便的解决国际化的问题了, yahoo有很多应用也是这样做的, 不过,从项目开发的角度说使用国际化工具显得更专业点,其他我还倒真的没看出有什么优势,
说归说,现在项目要用了, 还得用, 现在主要的国际化工具就是gettext, 当然也有对应的ruby的了, 也可以用在rails中
1. 首先安装
#gem install gettext
2. 然后在config/environment.rb中加入
require 'gettext'
require 'gettext/rails'
3. 在项目的跟目录的Rakefile中加入
desc "Update pot/po files."
task :updatepo do
require 'gettext/utils'
GetText.update_pofiles("cal_point", Dir.glob("{app,lib,bin}/**/*.{rb,erb,rjs,rhtml}"), "cal_point_0.9")
end
desc "Create mo-files"
task :makemo do
require 'gettext/utils'
GetText.create_mofiles(true, "po", "locale")
end
4. 在application.rb中加入
class ApplicationController < ActionController::Base
init_gettext 'cal_point'
end
cal_point是你项目的名字, 生成的po, mo文件也将以此命名
5. 建立目录po/zh, zh是语言目录, 可以根据自己的需要建立, 尊不遵循语言命名的标准都行
6. 在需要国际化的地方用"_()"方法来调用就行了, 比如: _("hello world");
7. 执行rake updatepo, 将会在po下生成文件cal_point.pot, 复制cal_point.pot到zh目录下为cal_point.po(我就在这里浪费了好多时间, 官方的文档中没有提到这一点), 然后编辑cal_point.po文件就行了, 注意文件编码一定要是UTF-8
8. 执行rake makemo, 将会自动生成/locale/zh/LC_MESSAGES/cal_point.mo, 这个文件是二进制文件不用管, gettext将自动调用,
9. gettext判断显示语言的方法有:
A. cookies中的lang设置
B. request中的lang变量
C. 也可以强制本地设置:
<% set_locale "en" %>
<%=_("Hello world") %>
关于使用一种方法是:在application.rb中:
before_init_gettext :default_locale
def default_locale
if params[:lang].nil? or params[:lang].empty?
set_locale "zh"
else
set_locale params[:lang]
end
end
就不多说了,资料比较多
参考资料:
早期的Merb在Windows上安装是件很恶心的事,缺这少那的,很是不爽,Merb 1.0也正式发布了,今天正好系统重做了一下,在干净的环境下试了一把,Merb 1.0可以正常安全与运行,相比之前版本的安装好些了,但也不省事,必要安装的Gem包还是一大堆,啥时候能和Rails一样安装Rails会自动把相关包一并安装啊,或许这就是Merb可定制化这样的特点对于我这个懒人的不适应吧!
安装必要的Gem
extlib
erubis
json_pure
rspec
rack
mime-types
thor
ruby2ruby(ZenTest RubyInline sexp_processor ParseTree)
templater(diff-lcs)
haml
mailfactory
dm-core(addressable data_objects)
dm-migrations
dm-timestamps
dm-aggregates
dm-validations
dm-sweatshop
dm-types
do_sqlite3
注意:括号里的gem是被附加安装的,可以不用手动安装
安装Merb
gem install merb -s http://edge.merbivore.com
生成Merb应用
merb-gen app merbtest
启动应用
cd merbtest_directory
merb
http://localhost:4000/
oh~yea! 可以看到绿色的Logo了
需要时不时的看看memcached的状态,其自身只提供了get、set等方法啊我们需要使用其提供的方法遍历一下其缓存的内容,其原理请参考《如何对memcache的数据(key-value)进行遍历操作 》和《贴一段遍历memcached缓存对象的小脚本》。
memcache的stats命令包括:
1. stats
2. stats reset
3. stats malloc
4. stats maps
5. stats sizes
6. stats slabs
7. stats items
8. stats cachedump slab_id limit_num
9. stats detail [on|off|dump]
说说其实现遍历的原理:
1. telnet到192.168.15.225(局域网测试机器)的memcache服务器;
2. 执行stats items命令,可以看到出现 很多的items行。
3. 执行stats cachedump 3 0命令。这里的3表示上面图中items后面的数字,0标示显示全部的数据,如果是1就标示只显示1条。
下图为执行后的结果,item后面的字符串为key
4. 通过上面列出的key我们就可以遍历所有的数据了,下面我们取出某一条数据,key为Uc!uLh的数据。
来两个遍历的代码:
1、PHP版
1. <?php
2. $host='192.168.15.225';
3. $port=11211;
4. $mem=new Memcache();
5. $mem->connect($host,$port);
6. $items=$mem->getExtendedStats (‘items’);
7. $items=$items["$host:$port"]['items'];
8. for($i=0,$len=count($items);$i<$len;$i++){
9. $number=$items[$i]['number'];
10. $str=$mem->getExtendedStats ("cachedump",$number,0);
11. $line=$str["$host:$port"];
12. if( is_array($line) && count($line)>0){
13. foreach($line as $key=>$value){
14. echo $key.'=>';
15. print_r($mem->get($key));
16. echo "\r\n";
17. }
18. }
19. }
20. ?>
2、RUby版
1. #!/usr/bin/env ruby
2. require 'socket'
3.
4. # stats
5. # stats reset
6. # stats malloc
7. # stats maps
8. # stats sizes
9. # stats slabs
10. # stats items
11. # stats cachedump slab_id limit_num
12. # stats detail [on|off|dump]
13.
14. class Memcache
15. class << self
16. def open(host, port)
17. s = TCPSocket.open(host, port)
18. yield s if block_given?
19. ensure
20. s.close if s
21. end
22.
23. def command(command_string, s)
24. s.send(command_string + "\r\n", 0)
25. buff = []
26. until ["END", "OK", "DELETE", "ERROR"].include?(line = s.gets.strip) do
27. buff << line
28. end
29. buff
30. end
31.
32. def exec(command_string, host = "javaeye", port = 11211)
33. open(host, port) { |socket| command(command_string, socket).each {|line| puts line } }
34. end
35.
36. def cache_stats(host = "javaeye", port = 11211)
37. cache_objects = {}
38. open(host, port) do |socket|
39. slabs = []
40. command("stats items", socket).each do |line|
41. slab_id = line.split[1].split(":")[1].to_i
42. slabs << slab_id unless slabs.include?(slab_id)
43. end
44. slabs.each do |slab_id|
45. puts "browse slab #{slab_id}..."
46. command("stats cachedump #{slab_id} 0", socket).each do |item|
47. key = item.split[1].split("/")[0].to_s
48. cache_objects.include?(key) ? cache_objects[key] += 1 : cache_objects[key] = 1
49. end
50. end
51. end
52. cache_objects.each_pair {|key, value| puts "#{key} : #{value}"}
53. end
54. end
55. end
56.
57. if ARGV.size == 0
58. Memcache.cache_stats
59. else
60. Memcache.exec(ARGV.join(" "))
61. end
ubuntu8.10发布好几天了,最近一直很忙,没时间升级,今天得闲升级,却遇到一些问题,开始是找速度不错的源,后来是遇到/boot下空间不足的问题,但是我的 /boot是 100M,按常理,应该足够了,其哦已经清理掉每次升级版本留下来的grup,现在只保留了最新一个版本的image,查看/boot下的文件,发现没啥是大文件,却占了70多M的空间,奇怪,如下:
iceskysl@IceskYsl:~$ cd /boot/
iceskysl@IceskYsl:/boot$ du sk *
du: 无法访问“sk”: 没有该文件或目录
416 abi-2.6.24-21-generic
80 config-2.6.24-21-generic
179 grub
7488 initrd.img-2.6.24-21-generic
du: 无法创建目录“lost+found”: Permission denied
12 lost+found
102 memtest86+.bin
890 System.map-2.6.24-21-generic
1885 vmlinuz-2.6.24-21-generic
iceskysl@IceskYsl:/boot$ df
文件系统 1K-块 已用 可用 已用% 挂载点
/dev/sda8 10309796 7409400 2376680 76% /
varrun 772952 228 772724 1% /var/run
varlock 772952 0 772952 0% /var/lock
udev 772952 72 772880 1% /dev
devshm 772952 0 772952 0% /dev/shm
lrm 772952 39780 733172 6% /lib/modules/2.6.24-21-generic/volatile
/dev/sda7 93307 73608 14882 84% /boot
/dev/sda9 9614116 5299748 3825996 59% /home
/dev/sda1 14195576 11835000 2360576 84% /media/sda1
/dev/sda5 15366140 13796572 1569568 90% /media/sda5
可以看到,占了77M的空间,但是du看到的却最大的也只有 8M,其他空间哪里去了?
Rails is a great framework, especially for writing AJAX applications, but the Javascript that the built-in Rails helpers output is a bone of contention for many. Unobtrusive Javascript for Rails aims to change that.
首先要在确保Merb App的$approot$/autotest/discover.rb文件中加载了”merb”, “rspec”。
discover.rb内容如下
Autotest.add_discovery { "merb" }
Autotest.add_discovery { "rspec" }
安装必要的依赖包
$: sudo apt-get install libgtk2-ruby libnotify-dev
$: wget http://rubyforge.org/frs/download.php/27134/ruby-libnotify-0.3.3.tar.bz2
$: tar jxf ruby-libnotify-0.3.3.tar.bz2
$: cd ruby-libnotify-0.3.3/
$: ruby extconf.rb
$: make && sudo make install
检查libnotify安装是否正确
irb
irb(main):001:0> require 'rnotify'
=> true
irb(main):002:0> quit
autotest会将测试结果信息发送至rontify,我们需要创建一个名为.autotest的脚本并放置在$HOME目录下。这个脚本要正常运行需要launchy Gem和一组icon,现在我们来依次完成。
$: sudo gem install launchy
$: wget http://thelucid.com/files/autotest_images.zip
$: unzip autotest_images.zip
$: mv autotest_images ~/.autotest_images
如果需要对Rspec的测试结果以HTML格式输出就需要对App的spec/spec.opts文件进行编辑,添加如下内容
--format p
--format html:doc/spec/report.html
上面的设置使报告的结果以Html形式保存在了doc/spec目录中,需要手动创建这个目录。
mkdir -p doc/spec
最后就是~/.autotest脚本的内容:
require 'rnotify'
require 'gtk2'
require 'launchy'
module Autotest::RNotify
class Notification
attr_accessor :verbose, :image_root, :tray_icon, :notification,
:image_pass, :image_pending, :image_fail,
:image_file_pass, :image_file_pending, :image_file_fail,
:status_image_pass, :status_image_pending, :status_image_fail
def initialize(timeout = 5000,
image_root = "#{ENV['HOME']}/.autotest_images” ,
report_url = “doc/spec/report.html”,
verbose = false)
self.verbose = verbose
self.image_root = image_root
self.image_file_pass = “#{image_root}/pass.png”
self.image_file_pending = “#{image_root}/pending.png”
self.image_file_fail = “#{image_root}/fail.png”
raise(”#{image_file_pass} not found”) unless File.exists?(image_file_pass)
raise(”#{image_file_pending} not found”) unless File.exists?(image_file_pending)
raise(”#{image_file_fail} not found”) unless File.exists?(image_file_fail)
puts ‘Autotest Hook: loading Notify’ if verbose
Notify.init(’Autotest’) || raise(’Failed to initialize Notify’)
puts ‘Autotest Hook: initializing tray icon’ if verbose
self.tray_icon = Gtk::StatusIcon.new
tray_icon.pixbuf = Gdk::Pixbuf.new(image_file_pending,22,22)
tray_icon.tooltip = ‘RSpec Autotest’
puts ‘Autotest Hook: Creating Notifier’ if verbose
self.notification = Notify::Notification.new(’X', nil, nil, tray_icon)
notification.timeout = timeout
puts ‘Autotest Hook: Connecting mouse click event’ if verbose
tray_icon.signal_connect(”activate”) do
Launchy::Browser.new.visit(report_url)
end
Thread.new { Gtk.main }
sleep 1
tray_icon.embedded? || raise(’Failed to set up tray icon’)
end
def notify(icon, tray, title, message)
notification.update(title, message, nil)
notification.pixbuf_icon = icon
tray_icon.tooltip = “Last Result: #{message}”
tray_icon.pixbuf = tray
notification.show
end
def passed(title, message)
self.image_pass ||= Gdk::Pixbuf.new(image_file_pass, 48, 48)
self.status_image_pass ||= Gdk::Pixbuf.new(image_file_pass, 22, 22)
notify(image_pass, status_image_pass, title, message)
end
def pending(title, message)
self.image_pending ||= Gdk::Pixbuf.new(image_file_pending, 48, 48)
self.status_image_pending ||= Gdk::Pixbuf.new(image_file_pending, 22, 22)
notify(image_pending, status_image_pending, title, message)
end
def failed(title, message)
self.image_fail ||= Gdk::Pixbuf.new(image_file_fail, 48, 48)
self.status_image_fail ||= Gdk::Pixbuf.new(image_file_fail, 22, 22)
notify(image_fail, status_image_fail, title, message)
end
def quit
puts ‘Autotest Hook: Shutting Down…’ if verbose
#Notify.uninit
Gtk.main_quit
end
end
Autotest.add_hook :initialize do |at|
@notify = Notification.new
end
Autotest.add_hook :ran_command do |at|
results = at.results.last
unless results.nil?
output = results[/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+pending)?/]
if output
failures = $~[2].to_i
pending = $~[4].to_i
end
if failures > 0
@notify.failed(”Tests Failed”, output)
elsif pending > 0
@notify.pending(”Tests Pending”, output)
else
unless at.tainted
@notify.passed(”All Tests Passed”, output)
else
@notify.passed(”Tests Passed”, output)
end
end
end
end
Autotest.add_hook :quit do |at|
@notify.quit
end
end
原本安装的是Flash9但总会频繁的把Firefox给搞崩溃,无奈升成Flash10,结果今天Flash播放器又没声音了,搜索了一下发现运行如下命令后就恢复正常了,真是不错
asoundconf set-pulseaudio
停止Alsa-util
$ sudo /etc/init.d/alsa-utils stop
编辑配置文件
$ sudo gedit /var/lib/alsa/asound.state
将如下内容添加至文件顶部
# This text should be added to the beginning of
# /var/lib/alsa/asound.state. You only need to add
# it once -- it is saved across reboots.
pcm.asymed {
type asym
playback.pcm dmix
capture.pcm dsnoop
}
pcm.default {
type plug
slave.pcm asymed
}
pcm.dmix {
type dmix
ipc_key 5678293
ipc_key_add_uid yes
slave {
pcm 'hw:0,0'
period_time 0
period_size 128
buffer_size 2048
format S16_LE
rate 48000
}
}
pcm.dsnoop {
type dsnoop
ipc_key 5778293
ipc_key_add_uid yes
slave {
pcm 'hw:0,0'
period_time 0
period_size 128
buffer_size 2048
format S16_LE
rate 48000
}
}
重新启动声音服务
$ sudo /etc/init.d/alsa-utils start
点击Preferences->Sound菜单,将标签Device里的所有音效全部设置为ALSA,重启电脑。
更改Pidgin音效为ESD方式,这下边听歌边IM都没问题了。
raecoo@laptop:~$ mysql -uroot -p
mysql> show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | latin1 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
mysql default characters is latin1,so we need update it to utf8 by my.cnf.
go to directory /etc/mysql/ and open the my.cnf config file,modify like this:
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
init_connect=’SET NAMES utf8′
then restart mysql server ,to see the results of the revised.
raecoo@laptop:~$ mysql -uroot -p
mysql> show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
Merb - a much heralded, highly flexible Ruby-based Web application framework - has reached version 1.0 after two years of development. Congratulations to Merb’s creator, Ezra Zygmuntowicz, and to the large group of associated developers (such as Yehuda Katz and Matt Aimonetti) who’ve kept adding features and pushed Merb forward to be a significant alternative to Rails.
Ruby Inside has been some surveys for the past couple of months, and they still show that only 25% of Ruby Inside’s visitors have ever developed a Merb application. With the stability that the 1.0 release offers (older versions of Merb had a reputation - fair or not - for a constantly shifting API), it’s now a great time to give Merb a try. It’s also a great time to get into writing tutorials and documentation!
Install Merb from Rubyforge: gem install merb
If you’d rather go from Merb’s “edge” repository: gem install merb –source http://edge.merbivore.com
NOTE: Make sure that you are running RubyGems 1.3.0 or higher (run
gem -vto check). If not, you need to upgrade (I found this page very useful for doing that.
Then follow a tutorial such as Life On The Edge with Merb, DataMapper & RSpec, Slapp: A Simple Chat Wall Merb Tutorial or Move Over Rails. Here Comes Merb.
Once you’re ready to roll, bookmark this page for safe keeping and read on for our Merb resources! We’ve divided them up into sections to make it easier. Some will also be left in the comments by other readers!

merb的1.0终于出来了,等的实在不易,1.0版的merb已经足够完善了,可以拿来做一些production的东西了,例如以前说到的代替rails做上传文件等等。
rubyinsite已经发了一篇参考资源文件,感兴趣的可以过去瞧瞧,地址如下:Merb 1.0 Released So Here’s 44 Links and Resources To Get You Going。
scp -Pport -p account@host:/files/path /local/path
-P(大写)端口参数
-p(小写)保持文件更改及相关的操作属性不变
mysqldump -h hostname -p -u username --opt databasename > databasename.sql
Cheap affordable web hosting services by professional web host, website hosting plans include PHP5 MySQL5 MySQL PHP Hosting, ruby on rails multiple domain hosting, linux shared cpanel hosting and more. Budget domain name registration service from a professional web host.
Sr.CSS/HTML Developer
工作年限:不限 招聘人数:1人
Job Description
Reporting to the Mingle Delivery Manager, the UI CSS Developer will be responsible for implementing the Mingle user interface from the high level designs created by the Designer. The role will involve working closely with the developers to create code which can easily be integrated into the product.
This is a contract position for an initial three month period, starting August.
Responsibilities
• To develop CSS, HTML and JavaScript as required
• To work with the developers on implementing the user interface designs
• To ensure consistency of the user interface across multiple platforms
• To be responsible for ensuring a consistent look and feel across the product
Required Skills
• Must be experienced in developing using CSS, HTML and JavaScript follow Web standards.
- Must know the css layout theory very well.
• Must be experienced at delivering consistent layouts using CSS and HTML across multiple platforms, e.g. IE6 & 7 on Windows, FireFox and Safari on Windows and Mac.
• Good verbal communication skills.
• Experience of using graphics packages, e.g. Photoshop, Fireworks, Illustrator and Flash
• Understanding of how to optimize media for presentation on the web, primarily images but also flash, video and audio would be helpful
• Needs to have a good attention to detail
• Familiarity with modern web frameworks such as Ruby on Rails is desirable
http://www.buildingwebapps.com/topic/show/5108-ruby-on-rails
Ruby on Rails
Ruby on Rails is a leading web application development framework, based on the Ruby programming language. It is designed to eliminate much of the drudgery of writing typical web applications by providing default settings that eliminate most configuration code (”convention over configuration”) and by providing a rich set of utility functions that make most common tasks simple. It uses a model-view-controller design pattern.
Setting up Rails on Windows XP
This guide walks you through setup instructions for preparing a Windows XP development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our LearningRails online course. continue…
Setting up Rails on Windows Vista
This guide walks you through setup instructions for preparing a Windows Vista development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our LearningRails online course. continue…
More BuildingWebApps Articles
* Setting up Rails on Leopard (Mac OS X 10.5)
* The Rebuilding and Scaling of YellowPages.com
* New Crop of Rails 2.0 Books
* Podcasts and Screencasts on Ruby on Rails
* Can Rails Scale? Absolutely!
网页制作(Builder)
工作年限:1年以上 招聘人数:若干
学历:大专
职位描述:
1、美术、设计或相关专业大专以上学历,有一年以上的网页制作经验
2、熟练使用Dreamweaver、Fireworks、Flash等网页制作工具,
3、熟悉photoShop、W3C标准,精通DIV+CSS方式页面设计,能处理通常的浏览器兼容性问题,具备手写代码能力
4、了解PHP、Ruby on Rails语言,并能把静态网页加到程序文件里,比如php文件或其他模板文件(工作内容)
1、负责切图、制作HTML页面、制作程序需要的模板文件
2、本职位侧重于制作网页、模板文件,而非设计效果图
A Ruby on Rails weblog application that helps you focus on writing above all else. SimpleLog has all the features you want in a weblogging applicaton wrapped in an efficiently designed interface that eliminates clutter. By focusing on simplicity and usability, SimpleLog allows you to spend your time writing, rather than managing a convoluted CMS.
SimpleLog is written and maintained by Garrett Murray and released under the GPL license. In short, SimpleLog is free. Free as in freedom. See the LICENSE file for more.
PHP Web Developer
工作年限:2年以上 招聘人数:1人
学历:本科
职位描述:
General Description:Prodigy Enterprises is a leading internet management company. The company specializes in the design, development and maintenance of websites for both large and small scale communities.
We are seeking a highly motivated, intelligent, and trustworthy employee who is good at getting things done, to whom we can extend excellent career satisfaction, growth opportunities, and perks. This position will work closely with the Web Producers and Technical Managers to innovate and create new web applications and enhance existing ones.
If you are a PHP Guru who is driven by seeing results, and wants to be part of an energetic and fun team then we are looking for you!
Key Responsibilities:
-Work with product management team to develop new web projects/features, as well as develop on existing features
-Develop custom data driven applications using PHP and MySQL
-Debug existing applications and make sure new applications are bug free
-Create highly dynamic, engaging, scalable applications
-Work with other people in an extremely fast paced setting and communicate with them well
-Keeping up with new Internet standards and Web technologies (Web 2.0, AJAX, Ruby on Rails, etc.)
-handle configuration and security issues of servers under Apache, Linux
-Documenting all work
-You must be able to take responsibility and deal with technical details yourself, while communicating important issues to the rest of the team
Work Experience / Education Requirements:
-Minimum 2-3 years PHP, MySQL, HTML, Javascript and CSS development experience
-Experience with a consumer-facing internet and/or digital media company
-Bachelors degree in computer science or related fields, or related experience
Qualifications:
-Expertise in working with PHP and MySQL
-Proficiency with front-end scripting including: HTML, DHTML, JavaScript, CSS, AJAX
-Hands-on experience with web application architecture and relational database design
-Knowledge of search engine optimization (SEO)
-Experienced with LAMP (Linux, Apache, MySQL, PHP)
-Knows how the web and internet work, from many different angles and levels
-Strong work ethic
-Excellent communication and presentation skills
-Must be comfortable in speaking in English (all daily communication will be in english)
-Work well under pressure and deadlines
Personality:
-Mature interpersonal skills
-Pleasant personality
-is fun and knows how to be relaxed but not a slack
-Hard-working and can stay focused
-Able to follow instruction, and also work independently without supervision
NOTE:
Please submit your English CV / Resume.
gem install fastri
fastri-server -b
the first line install the gem,second line make ruby doc indexs.
Usage: qri keyword
Captain’s Log
http://www.cslog.cn/category/ruby-on-rails
最让我激动的是没办法知道在下个星球上你能发现什么... category:Ruby on Rails
In one of my Ruby on Rails projects, I needed a full-text search engine to integrate. And after some research, I decided that Thinking Sphinx is the way to go. It seemed simple, fast and well documented. Unfortunately, I had some issues when tried to get it running on Windows.
The first step is installing Sphinx itself. While this looks simple, it took me five hours to move to the next step!
article quote from : http://www.expressionlab.com/2008/11/2/thinking-sphinx-on-windows
Web Application Developer (Middle Level)
工作年限:5-10年 招聘人数:若干
学历:本科
Position Summary:
As a Web Application Developer you will perform product design, develop, and implement software packages for web applications. You will be a member of a team that designs, creates, enhances and maintains commercial applications used by million of Internet users.Requirements:
1.Technical knowledge in software development methodologies, design and implementation. Good understanding of the development process, including specification, documentation and quality assurance.
2.Profound knowledge and high proficiency in any three of the following technologies required: HTML, JavaScript, XML, XSLT, DHTML, AJAX, Java, C# .NET or ASP .NET, Servlet, and JSP.
3.Websphere Commerce or Ruby on Rails experience a plus.
4.Good user interface design skills.
5.Strong object-oriented/based programming skills demonstrating intelligent abstractions and interface design.
6.Working knowledge of the SQL dialect and relational database theory.
7.General usable knowledge of operating systems, web server, network and computer hardware and IT infrastructures.
8.Ability and willingness to learn new computer languages and technologies quickly.
Essential Qualifications:
1.A Bachelor’s degree computer science.
2.Five or more years of web application development experience.
3.Good communications and interpersonal skills.
4.Pass CET 4 examination.
5.Ability and willingness to use English as working language.
Work Environment:
General office. Use of PC and related software applications. No special physical demands required. Mandarin for oral conversation and English for written communication.
MYSQL的引擎不是一般的多,这次说到的是MERGE,这个引擎有很多特殊的地方:
MERGE引擎类型允许你把许多结构相同的表合并为一个表。然后,你可以执行查询,从多个表返回的结果就像从一个表返回的结果一样。每一个合并的表必须有同样的表定义。
MERGE存储引擎在下面这种使用场合会最为有用,如果需要把日志纪录不停的录入MySQL数据库,并且每天、每周或者每个月都创建一个单一的表,而且要 制作来自多个表的合计查询,MERGE表这时会非常有效。然而,这项功能有局限性。你只能合并MyISAM表而且必须严格遵守相同的表定义的限制。虽然这 看起来好像是一个大问题,但是,如果你使用另外一种表类型(例如InnoDB),这种合并可能就不需要了。
其创建方法如下:
他将多个表在逻辑上当作一个表来查询。他建立后有两个文件,
.frm 表结构定义
.mrg union表的名字清单
两个基本表:
CREATE TABLE TEST_MERGE_1(
ID INT(5) NOT NULL,
VALUE VARCHAR(100) NOT NULL,
PRIMARY KEY(ID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
CREATE TABLE TEST_MERGE_2(
ID INT(5) NOT NULL,
VALUE VARCHAR(100) NOT NULL,
PRIMARY KEY(ID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
MERGE表的建立:
CREATE TABLE TEST_MERGE(
ID INT(5) NOT NULL,
VALUE VARCHAR(100) NOT NULL,
PRIMARY KEY(ID)
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 INSERT_METHOD=LAST UNION=(TEST_MERGE_1,TEST_MERGE_2) ;
1. 此表类似于SQL中的union机制。
2. 此表结构必须与基本表完全一致,包括列名、顺序。UNION表必须同属一个DATABASE。
3. 基本表类型必须是MyISAM。
4. 可以通过修改.mrg文件来修改MERGE表,每个基本表的名字占一行。注意:修改后要通过FLUSH TABLES刷新表缓存。
5. 对基本表的更改可以直接反映在此表上。
6. INSERT_METHOD的取值可以是: 0 不允许插入 FIRST 插入到UNION中的第一个表 LAST 插入到UNION中的最后一个表。(4.0之后可用)
7. 定义在它上面的约束没有任何作用,约束是由基本表控制的,例如两个基本表中存在着同样的一个Key值,那么在MERGE表中会有两个一样的Key值。
参考资料:
http://biz.chinabyte.com/220/2230720.shtml
http://info.codepub.com/2008/09/info-21832.html
桌面城市DeskCity.com(经典桌面资源站),包含几万个高清晰的经典桌面壁纸,手机壁纸和素材资源,截止至2008年11月3日,alexa排名为19894,PR6,作为一个日IP6万多的大型站点,谁都不会想到目前的桌面城市整体采用Ruby on Rails开发,并且运行在win服务器上,以此来说,不得不佩服桌面城市决策者东哥和开发者cmo的决策能力以及开发能力。
还记得2005年时,SEO大师级人物王通曾经评说过桌面城市不愧是《最值得收藏的个人网站-经典桌面资源网站》,这的确是一个非常cool的站点!整体资源直接完整展现,更好的用户体验和最为丰富的桌面资源,不愧是国内桌面资源第一网站,不论你是专业的平面设计师还是网站专兼职开发者,在此网站都会找到你所需要的资源,说不定你的电脑桌面背景就是从此流出的哦。虽然网站整体采用Ruby on Rails开发,而且是运行在WIN服务器上,但也还是承受得起大量的图片下载浏览,这主要归功于网站整体采取了静态生成,数一数国内采用Ruby on Rails开发的商业网站,能够拥有如此承载能力和活跃发展并且拥有绝佳的技术实力和商业策略的网站,已经屈指可数,甚至可以说,不论是在发展策略还是在技术实力上,桌面城市都是国内采用Ruby on Rails开发的排行第一的网站,值得所有Ruby on Rails开发者借鉴。
Senior Software Engineer - Ruby on Rails
工作年限:3-5年 招聘人数:2人
学历:本科以上
Qualification:
-Bachelor’s or Master’s degree in Computer Science or similar professional field
-Minimum 3 years web application development working experience is preferred
-1+ years experience with Ruby, Ruby on Rail is must
-Familiar with MySQL
-Familiar with common development tools, IDE: RadRails; Version control system: Subversion
-Familiar with software development process and agile methods, follow them in project
-Strong English communication skill is must, both written and spoken
-Strong communications/client management/leadership skills
-Experience of leading a team of 2~4 developers
-Team work spirit
-High intelligence/problem solving ability
●背景:
1.ruby在日本还处于起步阶段,没有形成大规模企业应用。
2.ruby可以提高web开发效率,缩短工时,从而降低开发成本。
3.ruby语法简捷,符合人类思维习惯,代码可读性好,便于维护。
4.拥有出色的ruby on rails web开发框架。
●目的:
1.推广普及动态语言– ruby,让更多的人享受编程的乐趣
2.打造华人ruby开发团队
3.开发世界一流的软件
4.为IT企业提供ruby on rails技术培训,解决方案和咨询服务
●业务:
1.本团队承接各种web网站建设项目
硬件网络环境构筑
・linux(centos ,ubuntu)
・apache/nginx web服务器(一台服务器可搭建多个网站)
・mysql/postgresql数据库
・java,php,ruby on rails运行环境
・自社服务器网络设置,域名服务器设置
・会社主页,CMS,SNS,BBS,购物网站安装调试
・web程序定制开发
租一台专用服务器的单月费用可以购买一台Dell SC440服务器(双核cpu,1G内存,80G硬盘)。
租一台共用服务器虽然便宜,但是空间,网速和权限都受到很多限制,不能随便安装软件,不能随便重新启动机器。
对于中小,特别是小企业或者自营业者来说,自社服务器是一个比较好的选择。
如果网络流量不是特别高的话,使用日本的100M的到户光纤足以满足要求。
至于性能, 本站即运行于普通的kddi マンションVタイプ + Dell SC400服务器上。
服务价格:与日本同类服务相比费用大幅减少 ,详情和报价请使用邮件联系。
Senior Server Engineer( Ruby On Rails)
工作年限:6-7年 招聘人数:若干
学历:本科
行业:IT行业(手机软件)
要求:
-学历要求:本科
-经验要求:4年
-特殊技能要求: 至少 1年以上ruby on rails经验 ,3年以上 java 基础, 熟悉Javascript, Python, Perl, AJax,有大型网站开发经验
-语言要求:英语流利
Open Source Rails - 一个收集展示开源Ruby on Rails 网站的服务。
Exceptional - 跟踪管理Rails应用程序的工具。
TuneUp -使用这个Rails 插件检查你的应用程序的可用性。
heroku .
RSpec 1.1.8 - Ruby 开发框架,包含一个 Scenario 框架和一个代码演示 框架。
Lovd By Less - 一个开源的Ruby on Rails社交网络平台。
Merb - 一个功能丰富的Ruby框架。
Camping - 一个 Ruby on Rails 微型框架。
邮件服务器需要一个帐户接收两个域的邮件, 在网上查了很多资料都不行,google了很长时间,才找到一点线索, 终于搞定了, 步骤就是:
首先你的postfix要支持regexp的查询表, 通过postconf -m, 可以看出是否支持, 就是正则表达式了(pcre),
这里举例发到xxx@abc.com.cn的邮件xxx@abc.com的域也可以收到
1. 添加虚拟域abc.com.cn
2. 建立文件/etc/postfix/reg_virtual.cf文件, 内容:
/(.*)@abc\.com\.cn/ $(1)@abc.com
3. 执行postmap /etc/postfix/reg_virtual.cf
4. 修改/etc/postfix/main.cf中的virtual_alias_maps为
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf regexp:/etc/postfix/reg_virtual.cf
(上面假设你已经有了mysql查询表, 上面没有换行, regexp前有空格)
5. 重启postfix
这样就OK了
参考文档
Using sympa_virtual with Postfix instead of regexp aliases
REGEXP_TABLE(5) REGEXP_TABLE(5)
Postfix Pipe
Postfix Filter
Defending E-mail HOWTO
We have four computers in use at home currently:
The Thinkpad X40 was almost 4 years old. I used install Ubuntu 5.04 on it together with XP three years ago, when Ubuntu wasn’t so easy to use as today. My wife is not a big fan of Linux, so she still uses XP.
I’ve been planning to setup the HTPC with Ubuntu for a while, but I’ve heard Ubuntu’s not very happy with the HDMI audio output (I have a Gigabyte GA-MA78GPM-DS2H MB). Finally I decided to give it a try when 8.10 came.
Installing Ubuntu Desktop has never be easier. I had to plug another keyboard as the wireless one couldn’t be used BEFORE the installation. Yes, by before I mean as soon as the installing process began I was able to select language and input username with the wireless mouse & keyboard.
I had a fresh new Ubuntu system less than 20 minutes later. The first thing I did was to change the DPI from 96 to 192 so I could read 3m away from the TV. The cool thing is the external wireless adapter was recognized right after the first login! Under XP I had to install some crazy drivers manually.
All things seemed right. The LG 42″ TV displayed 1920*1080. Now the most important part: audio over HDMI.
No sound! That’s expected as so many people had this issue.
aplay -l said the ATI HDMI card was there. So the system recognized it, this was also confirmed by the Volume Control, where I could select HDA ATI HDMI in the Device list. I’ve also turned on the IEC958 (I don’t know what that means), but first I needed to make it show by going to the Preferences below the Device list.
Then I went to System > Preferences > Sound, chose HDA ATI HDMI ATI HDMI (ALSA) in the Sound playback list for Sound Events, hit Test. Still silence only.
Googled, read a lot of forum & blog posts, which I’ve read already before.
Two hours passed, I was tired but not willing to give up. I had the same amount of difficulty to make the HDMI audio work under XP several months ago. This was not rocket science, and I had another half of the weekend to spare.
Then I noticed one thing. I had chosen to activate the ATI/AMD proprietary FGLRX graphics driver, but the progress bar stopped at 0% for a long time and then the window disappeared. I guessed Ubuntu was installing it in the background. Another thing I noticed was there’s a new item called ATI Catalyst Control Center under Applications > Accessories, which I believed was installed by the graphics driver. But when I clicked that, it told me there’s some error in the config.
Rebooted. Logged in. (Wow, the windows effect looked a little different. Thanks to the proprietary driver!) I Opened the Volume Controller, the IEC958 was turned off. I turned it on. Some guy suggested in his blog running the following command to make this change permanent (I don’t remember the post url though, because I couldn’t open it directly and at last I viewed the content via an online proxy):
sudo alsactl store 1
My HDMI sound card was listed as card 1 by aplay -l. I guessed the last “1″ in the command was related to this.
Went to System > Preferences > Sound and test the sound again. It’s working!
Putting in a CD, I played several songs for my coming baby. It had been very patient in its mother while I put hard disks, keyboards and other DIY stuffs all around on the floor and made noise and sigh from time to time.
Installed ssh, enabled Remote Desktop. Installed Apache2 & Passenger, MySQL …
Now the HTPC is not only an HTPC, but a media server, local git server, rails test server, download machine. Very cool!
一个好的文件存储结构不但使用、维护方便,关键是调用方便。
废话少说,直接上菜,厨子开始干活 :)
假设用户上传一个头像,系统为其生成大小不同的三种缩略图,并以用户ID做为目录名称,格式如下:
public/images/users/86799/raecoo.gif (原图)
public/images/users/86799/raecoo-big.gif
public/images/users/86799/raecoo-medium.gif
public/images/users/86799/raecoo-thumb.gif
这样的做法在系统规模较小的时候是没什么问题的,但随着用户数量的增加,这样的存储结构肯定是个隐患。下面介绍一种可容纳大规模存储的解决方案,当然这不一定是最好,也不一定适合你 :)
所谓可容纳大规模存储就是将文件存储进行分级,以便不会在单一目录下存储过多的图片。
这里的方案是按用户ID进行分级,方法很简单,对用户ID进行100的取模运算(具体的方法就不