Ubuntu, Ruby, RVM, Rails, and You

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
http://www.iloopai.com/blogs/11
http://ivanbernat.com/guides/install-rails-3-with-sqlite3-mysql-ubuntu-10/

25 Dec 2010

This beginner’s guide will set up with Ruby 1.9.2, RVM
and Rails 3.0.7 and is specifically written for a
development environment on Ubuntu 10.10, but will probably
work on many other operating systems, including older versions of
Ubuntu and Debian. YMMV.

If you’re looking for a way to set this up on a
production server then I would recommend the use of the railsready script
which installs all the necessary packages for Ruby 1.9.2p136 and
then that version of Ruby itself, Bundler and Rails. Then it leaves
it up to you to install Apache or nginx to get your application
online.

If you’re not using Ubuntu then try
Wayne E. Seguin’s rails_bootstrap_script
which probably gets a
version of Rails working for you, albeit with 1.8.7 rather than
1.9.2.

Under no circumstance should you install Ruby, Rubygems or any
Ruby-related packages from apt-get. This system is out-dated and
leads to major headaches. Avoid it for Ruby-related packages. We do
Ruby, we know what’s best. Trust us.

Still not convinced? Read this.

This guide will go through installing the RVM (Ruby Version Manager),
then a version of Ruby (1.9.2), then Rails and finally Bundler.

By the end of this guide, you will have these things installed
and have some very, very easy ways to manage gem dependencies for
your different applications / libraries, as well as having multiple
Ruby versions installed and usable all at once.

We assume you have sudo access to your machine, and
that you have an understanding of the basic concepts of Ruby, such
as “What is Rubygems?” and more importantly “How do I turn this
computer-thing on?”. This knowledge can be garnered by reading the
first chapter of any Ruby
book
.

Housekeeping

First of all, we’re going to run sudo apt-get
update
so that we have the latest sources on our box so that
we don’t run into any package-related issues, such as not being
able to install some packages.

Next, we’re going to install Git
(a version control system)
and curl which are both
required to install and use RVM, and build-essential
which is required to compile Ruby versions, amongst other
compilable things. To install these three packages we use this
command:

sudo apt-get install build-essential git-core curl

RVM

RVM is a Ruby Version
Manager
created by Wayne E. Seguin and is extremely helpful for
installing and managing many different versions of Ruby all at
once. Sometimes you could be working on a project that requires an
older (1.8.7) version of Ruby but also need a new version (1.9.2)
for one of your newer projects. This is a problem that RVM solves
beautifully.

Another situation could be that you want to have different sets
of gems on the same version of Ruby but don’t want to have to do
deal with Gem Conflict Hell. RVM has gemsets for
this. This is a feature you wouldn’t have if you used the
packaged Ruby
.

We’re going to use it to install only one version of Ruby, but
we can consult the
documentation
if we want to install a different version of
Ruby.

With git-core and curl installed we’ll
be able to install RVM with this command:

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

The beautiful part of this is that it installs Ruby to our home
directory, providing a sandboxed environment just for us.

Once that’s done, we’re going to need to add a line to
~/.bashrc file (the file responsible for setting up
our bash session) which will load RVM:

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc 

Then we’ll need to reload the ~/.bashrc file which
we can do with this small command:

. ~/.bashrc

The next command we run will tell us what other packages we need
to install for Ruby to work:

rvm notes
...
# For Ruby (MRI & ree)  you should install the following OS dependencies:
ruby: aptitude install build-essential bison openssl libreadline6 libreadline6-dev
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0
libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf

A couple of these packages we’ve already installed, such as
git-core and curl. They won’t be
re-installed again.

These packages will lessen the pain when we’re working with
Ruby. For example, the libssl-dev package will make
OpenSSL support in Ruby work, libsqlite3-0 and
libsqlite3-dev are required for the
sqlite3-ruby gem and the libxml2-dev and
libxslt-dev packages are required for the
nokogiri gem. Let’s install all these packages now
using this command:

sudo aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g
zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf

This command *must* be written on a single line, otherwise
some of the packages will not install.

Now our Ruby lives will be as painless as possible.

Ruby

With RVM and these packages we can install Ruby 1.9.2:

rvm install 1.9.2

This command will take a couple of minutes, so grab your
$DRINKOFCHOICE and go outside or something. Once it’s done, we’ll
have Ruby 1.9.2 installed. To begin using it we can use this lovely
command:

rvm use 1.9.2

Are we using 1.9.2? You betcha:

ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]

Or, even better, would be to make this the default for
our user! Oooh, yes!

rvm --default use 1.9.2

Now whenever we open a new bash session for this user we’ll have
Ruby available for us to use! Yay!

Rails

Now that RVM and a version of Ruby is installed, we can install
Rails. Because RVM is installed to our home directory, we don’t
need to use that nasty sudo to install things; we’ve
got write-access! To install the Rails gem we’ll run this
command:

gem install rails

This will install the rails gem and the other 22
gems that it and its dependencies depend on, including Bundler.

MySQL

If you’re planning on using the mysql2 gem for your
application then you’ll want to install the
libmysqlclient16-dev package before you do that.
Without it, you’ll get an error when the gem tries to compile its
native extensions:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

/home/ryan/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

PostgreSQL

Similar to the mysql2 gem’s error above, you’ll
also get an error with the pg gem if you don’t have
the libpq-dev package installed you’ll get this
error:

    Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

/home/ryan/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for pg_config... no
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Fin.

And that’s it! Now you’ve got a Ruby environment you can use to
write your (first?) Rails application in with such minimal effort.
A good read after this would be the official guides for Ruby on
Rails
. Or perhaps the documentation on the RVM site which goes into using
things such as gemsets and the
exceptionally helpful per-project
.rvmrc file
. A quick way to generate an .rvmrc
file is to run a command like this inside the project

rvm use 1.9.2@rails3 --rvmrc

RVM is such a powerful tool and comes in handy for day-to-day
Ruby development. Use it, and not the packages from apt to live a
life of development luxury.

Credits

Thanks to krainboltgreene for
pointing out that the guide needed to install the packages
specified by rvm notes. He’s got a similar write up here for Ubuntu
10.04
. Some of the instructions in this guide were “inspired”
by that post.

1、先安装gcc,mysql和一些库

sudo apt-get update
sudo apt-get upgrade
sudo dpkg-reconfigure tzdata
date

sudo apt-get install gcc
sudo apt-get install build-essential
sudo apt-get install git-core
sudo apt-get install libcurl4-openssl-dev libssl-dev zlib1g-dev libreadline5-dev

sudo apt-get install mysql-server mysql-client
 

2、编译ruby1.9.2 :

先下载源代码:http://www.ruby-lang.org/en/downloads/

tar vfxz ruby-1.9.2-p180.tar.gz  
cd ruby-1.9.2-p180
sudo ./configure --prefix=/usr/local/ruby-1.9.2

sudo make
sudo make install  

#添加路径
sudo gedit /etc/profile
#加入如下内容并且保存,注销就可以了
if [ -d "/usr/local/ruby-1.9.2/bin" ] ; then  
    export PATH=/usr/local/ruby-1.9.2/bin:$PATH
fi 

#查看安装到ruby版本
#sudo用到环境变量没搞清楚...加个-i就行了
sudo -i ruby -v

#安装rails,这儿也用-i
sudo -i gem install rails -y

设置MQSQL的UTF-8编码方式:

$sudo gedit /etc/mysql/my.cnf  #编辑添加如下内容
[mysql]
default-character-set = utf8 
[mysqld]
default-character-set = utf8 
init_connect = 'SET NAMES utf8' 

[client]
default-character-set = utf8

sudo /etc/init.d/mysql restart  #运行
sudo netstat -tap | grep mysql  #检查

#检查MYSQL查看编码,用MYSQL命令: 
show variables like'character%';  
#或者:mysql -u root -p
Enter password: ******
> \s # 查看是否配置成功
Client characterset:    utf8
Server characterset:    utf8
>quit

#Install nginx+passenger

sudo -i gem install passenger
sudo -i passenger-install-nginx-module

用rails new 新建 app

rails new blog -d mysql

现在3.0.7版本的mysql2不能用最新版,需要添加个限制

cd blog
gedit Gemfile

把gem ‘mysql2’改成: gem ‘mysql2′,'<0.3’
然后运行:bundle,如果提示下面到错误就是少了些运行库了:Could not create Makefile due to
some reason, probably lack of necessary libraries and/or
headers.
安装库:

sudo apt-get install libmysql-ruby libmysqlclient-dev 

在运行bundle就能正确安装mysql2了
执行:rake db:create还是出错…这个是rake
0.9版本到问题,这个有人给出了方法:打开刚才新建的app根目录下的Rake文件,在里面添加:

#注意把Blog改成你自己到模块名
module ::Blog
  class Application
    include Rake::DSL
  end
end

module ::RakeFileUtils
  extend Rake::FileUtilsExt
end
#这个是原来rake文件到最后一行,不是添加的,注意这个“Blog”就是你的模块名字
Blog::Application.load_tasks

第二种方法就是卸载0.9版本的rake了:

sudo -i gem uninstall rake -v 0.9
sudo -i gem uninstall rake -v 0.8.7
sudo -i gem install rake -v 0.8.7
 

我的系统里有rake 0.9和rake 0.8.7,把rake
0.9卸载了就找不到rake也许要加个链接到ruby/bin目录,我偷懒直接把2个都卸掉然后再安装0.8.7

这个就是安装mysql2过程中出现的问题:http://blog.csdn.net/linhx/archive/2011/03/29/6286899.aspx

配置ngnix:/opt/nginx/conf/nginx.conf

server {
        listen       80;
        server_name  localhost;
        root /home/xxx/rails_app/blog/public;  #xxx这个就是你刚才新建的app的public目录到完整路径
        passenger_enabled on;  
        rails_env development;     #设置为开发环境,默认是生产环境
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        #location / {
        #    root   /home/leslin123/rorails/helloMySQL/public;
        #    index  index.html index.htm;
        #} 

配置Nginx为启动项:

sudo apt-get install curl#在终端里输入curl,如果提示未安装就用这个命令安装,如果已经存在就跳过
curl -L http://bit.ly/nginx-ubuntu-init-file > nginx
sudo mv nginx /etc/init.d/
sudo chmod +x /etc/init.d/nginx 
sudo /usr/sbin/update-rc.d -f nginx defaults
sudo /etc/init.d/nginx start 

在浏览器里输入:127.0.0.1,看到Welcome to nginx!就是安装成功了,如果已经设置了rails
app的目录应该是rails程序到欢迎界面了
每次修改了nginx配置后需要重启生效:

sudo /etc/init.d/nginx restart 

注:如果提示:Access denied for user ‘root’@’localhost’ (using
password: NO)重启下nginx试试

用到的链接:rvm安装方式,只采用了前面:http://www.yangzhiping.com/tech/ubuntu-ree-nginx-passenger-rails3.blog.html

编译ruby1.9.2以及配置:
http://hi.baidu.com/rikioy/blog/item/57fdfe38b87ce3ccd462256a.html

解决mysql2版本不相容的问题:http://stackoverflow.com/questions/5840742/version-
of-mysql2-0-3-2-doesnt-ship-with-the-activerecord-adapter-bundled-anym

执行rake出错解决方法:http://stackoverflow.com/questions/5287121/undefined-method-task-using-rake-0-9-0-beta-4

安装mysql2不成功:http://blog.csdn.net/linhx/archive/2011/03/29/6286899.aspx

activescaffold+rails2.3.4+本地化 记录

这两天把原有一个项目从rails 2.2.2升级到了rails
2.3.4,在activescaffold插件上耗费了许多时间,但总算都解决了。
1.升级activescaffold
  首先要说明的是AS的官网很是诡异。里面的文档几乎不更新,反而github
wiki上才是最新的。所以大家不要找错地方了。
   按照文档,升级AS到2.3版本需要以下两步:
   1). ruby script/plugin install
git://github.com/activescaffold/active_scaffold.git
   2). ruby script/plugin
install git://github.com/ewildgoose/render_component.git -r
rails-2.3

  但是注意:
第二步安装的render_component插件在rails 2.3.4上并不能使用。启动时会出现
无效的方法”set_session_options”的错误
。我最后是在github上找了另一个render_component插件才好的。在这里浪费了我至少2个小时。

   2). ruby script/plugin install
git://github.com/weplay/render_component.git

2.中文化

 
原来我使用的是localization插件。并在Object类中加入了as_()方法来实现中文化。可是此插件在rails
2.3.4中也会报错。于是我就直接采用rails自带的I18n国际化方法。当然还是需要加入as_()方法.代码如下

 

Ruby代码  收藏代码记录” />
  1. class Object  
  2.   def as_(string, *args)  
  3.     if string  
  4.       I18n.t(string,*args)  
  5.       if (r =~ /^translation missing/)  
  6.         return string  
  7.       end  
  8.       return  
  9.     else  
  10.       return string  
  11.     end  
  12.   rescue  
  13.     return string  
  14.   end  
  15. end  

 

   附上翻译文件:

 

http://www.iteye.com/topic/484236

我要翻译Paul Graham了(zz)

http://www.ruanyifeng.com/blog/2009/12/i_will_translate_paul_graham.html

作者: 阮一峰

日期: 2009年12月28日

这些天,我总有点魂不守舍。

典型表现就是,非常烦躁和空虚。宁愿坐在电脑前,一遍又一遍扫雷,也不想干正经事,网志也不知道写些什么。不过有一件事,我想最好还是现在说一下,不要留到明年再宣布。

话说今年8月份,我翻译完More Joel on
Software
,已经精疲力竭,对这种通过长时间击键,将英语改写为汉语的廉价体力+脑力劳动深恶痛绝,再也不想干了。

交稿的时候,出版社编辑问我,还想不想翻译其他书。我说,不想了,除非你们有Paul
Graham
的书。此人的上一本书是五年前出版的,我觉得不太可能再引进了。

我要翻译Paul <wbr>Graham了(zz)Graham了(zz)” TITLE=”我要翻译Paul Graham了(zz)” />

但是,几星期前,图灵公司的傅志红编辑写信告诉我,他们买下了Paul Graham的文集Hackers and Painters的简体中文版权,询问我有无翻译意向。

我要翻译Paul <wbr>Graham了(zz)Graham了(zz)” TITLE=”我要翻译Paul Graham了(zz)” />

我一秒钟也没有停顿,立刻一口答应。我还能有什么其他回答呢?我是他的粉丝,翻译Hackers and
Painters
是我一直以来的心愿。

我要翻译Paul <wbr>Graham了(zz)Graham了(zz)” TITLE=”我要翻译Paul Graham了(zz)” />

下面,我就告诉你,我为什么那么想翻译Paul Graham。

他1964年出生于英国,在康奈尔大学读完本科,然后在哈佛大学获得计算机科学博士学位。1995年,他创办了Viaweb,帮助个人用户在网上开店,这是世界上第一个互联网应用程序。1998年夏天,Yahoo!公司收购了Viaweb,收购价约为5000万美元。

此后,他架起了个人网站paulgraham.com,在上面撰写了许许多多关于软件和创业的文章,以深刻的见解和清晰的表达而著称,迅速引起了轰动。2005年,他身体力行,创建了风险投资公司Y
Combinator
,将自己的理论转化为实践,目前已经资助了80多家创业公司。现在,他是公认的互联网创业权威。

我要翻译Paul <wbr>Graham了(zz)Graham了(zz)” TITLE=”我要翻译Paul Graham了(zz)” />

但是,在我眼里,除了程序员和创业导师,他更像一个思想家。网络技术将如何影响这个世界的未来,没有人说得比他更深刻。说实话,我在网上看了这么多人的文章,在思想方面,他的文章对我影响最大。这也是我热爱他的原因。

让我来随便摘录几段他的话,大家看看,说得多精彩。

* 最纯粹、最抽象的设计难题之一,就是设计桥梁。你面对的问题,基本上就是如何使用最少的材料,跨越给定的距离。(Five
Questions about Language Design)

* 软件最大的好处,就是让一切变得简单。但是,做到这一点的方法,是正确设置缺省值,而不是限制用户的选择。(The Other
Road Ahead)

* 如果你只知道设计软件,而不知道如何部署它,那么你不能创业。(The Other Road Ahead)

*
在任何一段历史中,人们都会把某些荒谬的东西当作正确,并且深信不疑,以至于一旦你出言质疑,就有被排挤或者被暴力伤害的危险。我们自己的这个时代,要是不同以往,当然令人欢欣鼓舞。但是就我所知,它并没有任何不同。(Taste
for Makers)

* 根据经验法则,一个国家的名字前形容词越多,它的统治者就越腐败。”某某社会主义人民民主共和国”(Socialist
People’s Democratic Republic of X),可能是地球上你最不想生活的地方。(A Plan for
Spam)

* 看上去,这是一个残酷的世界,也是一个乏味的世界,我不太肯定哪一个更糟一些。(Why Nerds are
Unpopular)

*
当你踩水的时候,你把水踩下去,你的身体就会被托起来。同样的,在任何等级制社会中,那些地位得不到公认的人,就会通过虐待他们眼中的下等人,来突显自己
的身份。我读到过这方面的文章,讲述为什么美国的底层白人是对待黑人最残酷的群体。(Why Nerds are
Unpopular)

*
许许多多不创造任何财富的人—-比如本科生,记者和政治家—-一听到最富有的5%人口,占有全社会一半以上的财富,往往会认定这是不公平的。一个
有经验的程序员,很可能也持有同样看法。因为最顶尖的5%程序员,写出了全世界99%的优秀软件。(How to Make
Wealth)

*
我偶尔会读到一些文章,讲述如何管理程序员。说实话,其实只要两篇文章就够了。一篇是如果你本人就是程序员,应该如何去管理其他程序员;另一篇则是你本人不是程序员的情况。后一篇文章也许可以浓缩为两个字:放弃。(Great
Hackers)

*
不管什么时候,黑客真正想工作的地方,只有10到20个。如果你的公司不是其中之一,你所能得到的一流技术高手,不是数量多少的问题,而是一个也不会有。(Great
Hackers)

* 竞争者不过就是对着你的下巴打一拳,而投资者则是一把抓住你的下身。(How to Fund a Startup)

* 对于做产品的公司,等你需要咨询公司帮你出主意的时候,就是你开始走向灭亡的时候。(How to Fund a
Startup)

*
对于那些他们真正关心业绩的企业,欧洲人实际上能够容忍解雇工人。但是不幸的是,目前他们唯一真正关心的企业只有一家,叫做”社会”。(Why
Startups Condense in America)

*
我实际上很担心自己变得”流行”,那样的话,我就会小心翼翼,不再像以前那样敢于说蠢话。这种事情发生在许多人身上,我真的想避免它。(A
comment in Lemonodor)

他的更多思想,请看我以前翻译的《未来的互联网创业》(),《为什么在经济危机中创业》《学历证书的终结》

我要翻译Paul <wbr>Graham了(zz)Graham了(zz)” TITLE=”我要翻译Paul Graham了(zz)” />

如果一切顺利的话,Hackers and Painters的中译本《黑客和画家—-Paul
Graham文集》将在明年下半年问世。

对于我来说,翻译完这本书以后,在翻译方面,就再没有什么心愿了。乔伊斯的《都柏林人》、《一个青年艺术家的肖像》和塞林格的《九故事》、《木匠们,把房梁抬高些》都有很完美的中译本,不需要我来译,而卡尔维诺的小说集我倒是想译,但是我不懂意大利文,估计出版社也不会来找我。

10款难看但好用的SEO工具

http://www.36kr.com/p/45332.html

人不可貌相,SEO工具也不例外。

SEO专业网站SEOmoz总结了十个SEO工具,这些工具看上去其貌不扬,甚至有些丑陋,但功能却非常强大、实用。

下面我们就来看看这十大难看却好用的SEO工具:

1. Shared Count

给力之处:Tom
Critchlow
开发的Shared
Count
不仅可以跟踪Twitter、Facebook、LinkedIn、Google+等社交网络上的社交分享统计数据, 而且还提供一个开放API,也就是说你也可以通过它开发自己的工具。

Shared Count

难看之处:该网站几乎没有任何设计可言。

2. IETester

给力之处:在检测浏览器兼容性的时候,IE总会让你忙个不停。IETester是一个免费的、可下载的浏览器,可以让你渲染不同版本的IE浏览器,放在同一个窗口中进行对比,然后检查错误。此外还支持调试模式。

难看之处: 什么东西到了IE6下都很难看,IE6本身也不例外。

3. Blogscape

给力之处:Blogscape允许你按天监测任何关键词、品牌或链接的热门程度。你只需输入一个关短语或网址链接,然后就可以看到大量提到这些内容的列表。如果你懂高级检索操作符的话,你还可以跟踪仅含有某个特定域名的文章,是发现新链接的利器。

Blogscape SEO Tools

难看之处:
这是一个收费工具,如果你不是付费会员,登录页面更加难看。

4. URI Valet

给力之处:URI
Valet
通过10个工具完成技术检查、网址点评等工作。你可以查看任何网页的服务器header,文本、HTML比率、下载速度等信息,并且可以进行W3C验证。

URI Valet

难看之处:谁说你需要一名图形设计师才能做出一个网页工具呢?

5-6. Robots.txt 检查器

http://tool.motoricerca.info/robots-checker.phtml
http://www.frobee.com/robots-txt-check

给力之处:两者实力相当,都可以发现robots.txt文件中的问题,并且还能发现不可见的错误。他们甚至还可以对文件中的隐藏代码作出解释,这些文件可以对搜索引擎爬虫产生影响。

Robots.txt

难看之处:robots.txt文件是很枯燥,但这并不意味着你的界面也要这么粗糙。

7. Wayback Machine

给力之处:Wayback
Machine
有一个巨大的网页存档,你可以查到15年前的页面。如果你想研究消失的链接或者跟踪网站修改对网站流量的影响,Wayback
machine可以让你回到从前。

Wayback Machine

难看之处:能看看你喜欢的网站在1996年的样子是件挺酷的事,但你必要一直保留1996年的那个logo吧,而且一直在测试期,搞毛啊?

8. SEO Browser

给力之处:从网页标签开始,一眼洞穿网页的SEO结构。该网页有robots.txt文件吗?安装了分析工具了吗?SEO
Browser
可以通过一个页面让你一目了然。

SEO Browser

难看之处:该网站的标语是:用搜索引擎的眼光查看你的网站。不幸的是大部分搜索引擎看上去都很漂亮。

9. Rank Checker(排名查看器)

给力之处:Rank
Checker
由SEObook出品的一个火狐插件,可以让你随时检测网站关键词的排名。

SEOBook's Rank Checker

难看之处:并不难看,但速度太快。

10. Xenu’s Link Sleuth(链接侦探)

给力之处:很多人认为Xenu’s Link
Sleuth
是一个运行在桌面电脑上的链接检查器,可以帮你发现网站中的死链,但其极简的界面和通俗易懂的报告使其成为一个网站审计的得力工具。

Xenu

难看之处:在Google上搜索Xenu,你的第一反应是后退,检查搜索结果。有可能是SEO工具中有史以来最难看的登陆页面,好像是回到了1992年。但请放心,这个网站没问题,只是有外星人而已。

除非注明,本站文章均为原创或编译,转载请注明: 文章来自36氪

如何在一年之内毁掉惠普

  假设有人给了你一年时间,让你去灭掉惠普(Hewlett-Packard)。那么下面就是你的实施办法:
  首先炒掉业绩不错的CEO赫德(Mark
Hurd),理由是他费用报销违规,并且牵涉进一桩猛料迭出、但你也认为没有根据的性侵指控。炒掉四名董事会成员,越高调越好。煽动那些知道怎样运营这家电脑巨头的关键高管大规模出走。

  从德国竞争对手、卖企业级软件不卖消费产品的SAP公司挖来一位新CEO。告诉这位名叫李艾科(Leo
Apotheker)的新CEO,说赫德离开的时候惠普状态很好。
  吸引一家重要的公司治理咨询公司的公开批评,让它说,李艾科安插了自己的死党来填补董事会的空缺席位。
  高价从事并购和股权回购活动。让成本失控。想方设法在下次全球经济衰退到来之前把数十亿美元的现金储备花光。
  扬言要在PC上安装惠普自己的操作系统,刺激微软(Microsoft)和甲骨文(Oracle)。然后决定不这么做。还记得惠普去年12亿美元收购Palm公司时购得的大有希望的webOS软件吗?让它坐冷板凳去。

  当甲骨文的埃里森(Larry Ellison)跟《纽约时报》(New York
Times)说,惠普做出了苹果董事会那些白痴炒掉乔布斯(Steve
Jobs)以来的最坏人事决定时,马上变得怒不可遏。然后在埃里森把赫德招过去时提起诉讼。
  吹嘘自己将用499美元的TouchPad向苹果iPad发起攻击。然后以99美元的跳楼价甩卖TouchPad,并宣布以后再也不卖了。

  电告全世界说,你们实在太傻,做不出智能手机来。
  两次上调财务预测,然后两次失算。
  一定要让李艾科的备忘录泄露给媒体。这份备忘录说,看好每一分钱,把所有招聘规模降到最低。
  宣布以100亿美元收购英国商业软件公司Autonomy的计划,因为这家公司跟SAP一样都是开发企业级软件的,而李艾科最了解的就是这方面。

  宣布可能出售PC业务,也有可能是把PC业务分拆为一家独立的公司。不给出一个确定的计划将会伤及价格。
  别在意惠普成为世界最大PC生产商所做的多年努力,包括与康柏(Compaq)公司的争议性合并。别在意PC业务有利于惠普更盈利的业务。将它甩卖掉
实在是荒谬,正如金融服务公司Robert W. Baird & Co.分析师诺兰德(Jayson
Noland)所说,就像是麦当劳(McDonald’s)不再做汉堡业务。
  冷眼旁观穆迪(Moody’s)下调惠普评级的威胁。
  惠普股价重挫40%以上的时候表现得大感意外。
  跑到华尔街去讲一些冗长的、让人不知所云的故事,说你是怎样在把惠普从一家低利润率企业转变为一家高利润率企业。
  从前CEO菲奥里纳(Carly Fiorina)的惨败,到前董事长邓恩(Patricia
Dunn)的非法窃密丑闻,再到赫德似乎完全与性无关的所谓性丑闻,这一切失灵就构成了”惠普之道”。
  惠普炒掉赫德已有一年时间。安乐死先驱人物凯沃尔基安(Jack
Kevorkian)也无法为一家公司的安乐死制定出一个更好的方案。但正如这位好医生曾经说的,死不是犯罪。。