<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3861077904786157832</id><updated>2024-10-08T19:32:57.871-07:00</updated><category term="hadoop"/><category term="mahout"/><category term="ubuntu"/><category term="virtualbox"/><category term="beautifulsoup"/><category term="latex"/><category term="lxml"/><category term="lxr"/><category term="map"/><category term="python"/><category term="reduce"/><category term="ssh"/><title type='text'>Pythonee&#39;s Notebook</title><subtitle type='html'>Enjoy Programming</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-867260620406311118</id><published>2015-11-13T19:01:00.000-08:00</published><updated>2015-11-13T19:14:21.213-08:00</updated><title type='text'>技术沙龙</title><content type='html'>学习技术，除了从书本、工作中获取理论和实践之外，还有一条重要的途径就是通过同行交流，参加技术沙龙，分享知识，开阔技术视野。&lt;br /&gt;
&lt;br /&gt;
当初读书那会，从书本上获取的知识有限，在google资料时，无意发现了一些不错的技术论坛，分享的大多数干货，学习了很多，脑洞也开了不少。反倒工作之后，参与沙龙的时间也减少了。不过另外一个事实时，现在移动开发和前端真的像是开启了屏霸模式，这些沙龙上的主题几乎都是关于移动和前端，当年的后端大牛们， 这时候也只能选择归隐练剑去了吧。&lt;br /&gt;
&lt;br /&gt;
下面列一些国内比较好玩的技术沙龙：&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
beta技术沙龙&lt;br /&gt;
&lt;br /&gt;
珠三角技术沙龙&lt;br /&gt;
&lt;br /&gt;
珠海GDG&lt;br /&gt;
&lt;br /&gt;
阿里技术沙龙&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
另外就是一个比较少关注，但是活动组织和活动内容还挺广的&lt;br /&gt;
&lt;br /&gt;
beijing-open-party</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/867260620406311118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2015/11/blog-post_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/867260620406311118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/867260620406311118'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2015/11/blog-post_13.html' title='技术沙龙'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-6814254601072400417</id><published>2015-11-08T06:55:00.000-08:00</published><updated>2015-11-08T06:55:01.568-08:00</updated><title type='text'>秋日里的北京</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3qtZ-UI8PgLuZDukrX8AEfHXbVBlEsK_GqIew5Y3uzmkvjiI0kBmvNAwGg1H3-P_XS0TJtog6GAAX1EoDEsoda7-HbqpusucIFZqNilVbmIBKQ2WDTwqHjI5zYW9O0Eek29wMyakYzro/s1600/IMG_2260.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3qtZ-UI8PgLuZDukrX8AEfHXbVBlEsK_GqIew5Y3uzmkvjiI0kBmvNAwGg1H3-P_XS0TJtog6GAAX1EoDEsoda7-HbqpusucIFZqNilVbmIBKQ2WDTwqHjI5zYW9O0Eek29wMyakYzro/s640/IMG_2260.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
北大校门，挤满了人，这里还需要检查身份证&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLQr52PLPO57CZs_U-I2wxmA0ZYaU2tJCy-RURDeQrWoLRsJVfL3k9wLRyuaPisGfIm6RvkgXrHe9sk7h3akCyl0cBvQK3X5daw5LcOv9EB2x6P6ZmPu_0YSnUGnHreKRf5EYZTS1QgAA/s1600/IMG_2262.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLQr52PLPO57CZs_U-I2wxmA0ZYaU2tJCy-RURDeQrWoLRsJVfL3k9wLRyuaPisGfIm6RvkgXrHe9sk7h3akCyl0cBvQK3X5daw5LcOv9EB2x6P6ZmPu_0YSnUGnHreKRf5EYZTS1QgAA/s640/IMG_2262.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
外面熙熙攘攘，一进校门，却是另外一番景象，宁静、书香&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRVZPEqqXs7zo66-MTlhVOSnOtpWIAFfTxYrxvq__hKqfpvl1-QTwzdCOjYHNyjL1AGvpQuZN-dIXL9fgkVO9xGUBYnZVj_k0X7PhiMJlN_y_tGJAZuku2B3dC437GNNDecikZe98jI5M/s1600/IMG_2282.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRVZPEqqXs7zo66-MTlhVOSnOtpWIAFfTxYrxvq__hKqfpvl1-QTwzdCOjYHNyjL1AGvpQuZN-dIXL9fgkVO9xGUBYnZVj_k0X7PhiMJlN_y_tGJAZuku2B3dC437GNNDecikZe98jI5M/s640/IMG_2282.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
清北清北，出了北大，去逛了清华，浓浓的理科味&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zEMRJ7S0SEWYhA1VWaXuzllGuO2J5MYlf5pUV8UQn9XQA_Wtj3dDAB5k3pbfaLNW2IGo1iUOQ2TtNaRZRLrYGny71bFSn5p7CY-TBMmQ7eDIGv92gsCQoKAT8i5hEsORjBngyQa-Mks/s1600/IMG_2285.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zEMRJ7S0SEWYhA1VWaXuzllGuO2J5MYlf5pUV8UQn9XQA_Wtj3dDAB5k3pbfaLNW2IGo1iUOQ2TtNaRZRLrYGny71bFSn5p7CY-TBMmQ7eDIGv92gsCQoKAT8i5hEsORjBngyQa-Mks/s640/IMG_2285.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
清华学堂&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjQRKmZCV-mp8lp82InBR7IHZduZxymoe5JTd7y3Wta3bZTJ-SmaRlzlkxmMNnnQmOv45yBz5lssAwCAE7J2lfS1jT77xMMNrkCoUTOWxw8DkL1DuK7GDcVpR495xcIvDNvp4X9nOzDTI/s1600/IMG_2348.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjQRKmZCV-mp8lp82InBR7IHZduZxymoe5JTd7y3Wta3bZTJ-SmaRlzlkxmMNnnQmOv45yBz5lssAwCAE7J2lfS1jT77xMMNrkCoUTOWxw8DkL1DuK7GDcVpR495xcIvDNvp4X9nOzDTI/s640/IMG_2348.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
公园里的柳树，秋风徐徐，太阳暖暖，北京难得的好天气&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkcp8xFdQRCYDjThGE8wpGMamghQJ6bs3rYnByNcgu3KnK9IJiLVV0Lzp-s0d8yCBih5253_pICwJ3mN7U6K8tXBECv01PE5CcFjuYi-bJZnuY2LEPSOW21WCPsXY6xpQioJnwm5u7NPE/s1600/IMG_2350.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkcp8xFdQRCYDjThGE8wpGMamghQJ6bs3rYnByNcgu3KnK9IJiLVV0Lzp-s0d8yCBih5253_pICwJ3mN7U6K8tXBECv01PE5CcFjuYi-bJZnuY2LEPSOW21WCPsXY6xpQioJnwm5u7NPE/s640/IMG_2350.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
公园的跑道，两边的树叶也都开始泛黄了&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJzgHP567y8TpaVUP61fqfr2lF3IMwnm0Z3cFKbtt_BGML_MVwoGJIysAcSU6MyPYMv5CwnSkwIMusThdMRTcvupsl9NDPArGtHmo-yrQ-gbIF8KrwRjktsky5xA9Z6GYt0bnJ4DsQAlY/s1600/IMG_2354.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJzgHP567y8TpaVUP61fqfr2lF3IMwnm0Z3cFKbtt_BGML_MVwoGJIysAcSU6MyPYMv5CwnSkwIMusThdMRTcvupsl9NDPArGtHmo-yrQ-gbIF8KrwRjktsky5xA9Z6GYt0bnJ4DsQAlY/s640/IMG_2354.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
路过天安门广场，各种护栏，有点进入禁地的感觉&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaEZgspQdmVHcZagkpyrtMrVCv2vKd_KIC8kh-8LUVXZVvUNZq9LJjxUxA7-nG0DwrF5abS3c4YeHA1f6j2DTfBcPeLrOcgvcU0S0_3vcU_fe9P79N2EA_hOgF0LyBF9ZV8d1DDMZYRes/s1600/IMG_2367.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaEZgspQdmVHcZagkpyrtMrVCv2vKd_KIC8kh-8LUVXZVvUNZq9LJjxUxA7-nG0DwrF5abS3c4YeHA1f6j2DTfBcPeLrOcgvcU0S0_3vcU_fe9P79N2EA_hOgF0LyBF9ZV8d1DDMZYRes/s640/IMG_2367.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
热闹的前门步行街，古色古香，各种北京特色一条龙&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/6814254601072400417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2015/11/blog-post_40.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/6814254601072400417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/6814254601072400417'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2015/11/blog-post_40.html' title='秋日里的北京'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3qtZ-UI8PgLuZDukrX8AEfHXbVBlEsK_GqIew5Y3uzmkvjiI0kBmvNAwGg1H3-P_XS0TJtog6GAAX1EoDEsoda7-HbqpusucIFZqNilVbmIBKQ2WDTwqHjI5zYW9O0Eek29wMyakYzro/s72-c/IMG_2260.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-6446511344111971368</id><published>2015-11-08T04:19:00.003-08:00</published><updated>2015-11-08T04:38:50.431-08:00</updated><title type='text'>NameError: uninitialized constant SiteSettings::DbProvider::RailsMultisite</title><content type='html'>&lt;br /&gt;
我是从vagrant的方式安装Development环境，docker安装应该不会有这个问题
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
执行这个时：&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #f8f8f8; color: #222222; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;dejavu sans mono&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;bundle exec rake db:migrate&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&amp;nbsp;报错：&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #f8f8f8; color: #222222; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;dejavu sans mono&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;rake aborted!
NameError: uninitialized constant SiteSettings::DbProvider::RailsMultisite
/vagrant/lib/site_settings/db_provider.rb:52:in `current_site&#39;
/vagrant/lib/site_setting_extension.rb:44:in `current&#39;
/vagrant/lib/site_setting_extension.rb:96:in `block in setting&#39;
/vagrant/lib/site_setting_extension.rb:93:in `synchronize&#39;
/vagrant/lib/site_setting_extension.rb:93:in `setting&#39;
/vagrant/lib/site_setting_extension.rb:151:in `client_setting&#39;
/vagrant/app/models/site_setting.rb:18:in `block in load_settings&#39;
/vagrant/lib/site_settings/yaml_loader.rb:29:in `block (2 levels) in load&#39;
/vagrant/lib/site_settings/yaml_loader.rb:20:in `each&#39;
/vagrant/lib/site_settings/yaml_loader.rb:20:in `block in load&#39;
/vagrant/lib/site_settings/yaml_loader.rb:19:in `each_key&#39;
/vagrant/lib/site_settings/yaml_loader.rb:19:in `load&#39;
/vagrant/app/models/site_setting.rb:16:in `load_settings&#39;
/vagrant/app/models/site_setting.rb:25:in `&amp;lt;class:SiteSetting&amp;gt;&#39;
/vagrant/app/models/site_setting.rb:4:in `&amp;lt;top (required)&amp;gt;&#39;
/vagrant/config/initializers/04-message_bus.rb:39:in `&amp;lt;top (required)&amp;gt;&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:652:in `block in load_config_initializer&#39;
/var/lib/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:651:in `load_config_initializer&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:616:in `block (2 levels) in &amp;lt;class:Engine&amp;gt;&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:615:in `each&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:615:in `block in &amp;lt;class:Engine&amp;gt;&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `each&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `tsort_each_child&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/railtie.rb:194:in `public_send&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/railtie.rb:194:in `method_missing&#39;
/vagrant/config/environment.rb:5:in `&amp;lt;top (required)&amp;gt;&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:328:in `require_environment!&#39;
/var/lib/gems/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:457:in `block in run_tasks_blocks&#39;
Tasks: TOP =&amp;gt; db:migrate =&amp;gt; environment
(See full trace by running task with --trace)&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
其实就是文件权限问题：&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #f8f8f8; color: #222222; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;lucida console&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;dejavu sans mono&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , monospace; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;sudo chmod -R a+r /var/lib/gems/2.2.0/gems/&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
安装完成之后：&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxdQtpMRAYnfiG_k2GWAsJml1cSU-GTYtsR2Hu9Z8xcemmpWZiqTq1w1_gzU0ewe3s3ZPH7AK0KSnYQtEQClKHBaGCJlINkkrRWPtHQw48L7P9moNCz5UMLCn2ruCG4bxE_CfBrADY8DA/s1600/Screen+Shot+2015-11-08+at+07.29.17.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;403&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxdQtpMRAYnfiG_k2GWAsJml1cSU-GTYtsR2Hu9Z8xcemmpWZiqTq1w1_gzU0ewe3s3ZPH7AK0KSnYQtEQClKHBaGCJlINkkrRWPtHQw48L7P9moNCz5UMLCn2ruCG4bxE_CfBrADY8DA/s640/Screen+Shot+2015-11-08+at+07.29.17.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
安装的简易性、定制性还是不错的，适合用于来做个性化的小众论坛&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/6446511344111971368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2015/11/nameerror-uninitialized-constant.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/6446511344111971368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/6446511344111971368'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2015/11/nameerror-uninitialized-constant.html' title='NameError: uninitialized constant SiteSettings::DbProvider::RailsMultisite'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxdQtpMRAYnfiG_k2GWAsJml1cSU-GTYtsR2Hu9Z8xcemmpWZiqTq1w1_gzU0ewe3s3ZPH7AK0KSnYQtEQClKHBaGCJlINkkrRWPtHQw48L7P9moNCz5UMLCn2ruCG4bxE_CfBrADY8DA/s72-c/Screen+Shot+2015-11-08+at+07.29.17.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-1772748945623559663</id><published>2015-11-07T22:18:00.002-08:00</published><updated>2015-11-07T22:18:12.731-08:00</updated><title type='text'>常去的技术网站</title><content type='html'>&lt;br /&gt;
以前经常喜欢搜集很多的网站，深怕自己错过了重要的信息，到头来经常去和能引起思考的并不多，在这个信息爆炸的年代，缺的永远不是信息，缺的是提取信息的智慧和耐心。所以后来就不断的筛选常去的网站，我觉得这个数量不应该超过15个为好&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;博客&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://hellojava.info/&quot;&gt;http://hellojava.info/&lt;/a&gt;&lt;br /&gt;
JAVA真是线上问题排查微信公众号&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.blogjava.net/BlueDavy/&quot;&gt;http://www.blogjava.net/BlueDavy/&lt;/a&gt;&lt;br /&gt;
很多关于架构、OSGI、java的一个博客，JAVA程序员必看&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.csdn.net/pongba/&quot;&gt;http://blog.csdn.net/pongba/&lt;/a&gt;&lt;br /&gt;
pongba的csdn博客，很多文章到现在重读还是能有其他体会，思维、技术、图灵机、数学在这里都没有了界限，文章经常旁征博引，可以不断延伸，技术博客应当如此&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://mindhacks.cn/&quot;&gt;http://mindhacks.cn/&lt;/a&gt;&lt;br /&gt;
pongba的新博客，更新频率变慢了，不过每一篇都是经历时间的揣摩，还是很多思维训练和概率统计的文章&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.ruanyifeng.com/blog/&quot;&gt;http://www.ruanyifeng.com/blog/&lt;/a&gt;&lt;br /&gt;
阮一峰老 师的博客，阮老师的文笔非常好，总是能把一些不太好理解的写的特别通俗易懂，而且阮老师本身专业是经济的，文章内容类型也很宽&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.keakon.net/&quot;&gt;http://www.keakon.net/&lt;/a&gt;&lt;br /&gt;
keakon的博客，keakon现在去知乎了，之前好像是在IBM，关注到keakon也是因为想在google app engine上写点应用，当时资料还不是很多，keakon分析datastore和gae的文章，当时都看了遍，还使用了他写的google app engine上的框架，受益匪浅。学python和爱玩游戏的可以关注&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Google Groups&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://groups.google.com/forum/#!forum/pongba&quot;&gt;TopLanguage&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
这里不但有大牛做技术交流，还有无私的分享精神、有好的交流氛围，上大学那会儿最喜欢就是在里面做题、做思考训练，非常不错得一个groups，至今没有找到比这更好的网络groups&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://groups.google.com/forum/#!forum/shlug&quot;&gt;Shanghai Linux User Group&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
linux用户组，各地应该都有一个，但是这里的话题也不仅仅linux，而且有质量的发言也很多，可以交流的经验也很多&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;程序员社区&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.v2ex.com/?tab=tech&quot;&gt;V2EX&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Livid的网站，最初是玩google app engine的时候关注的，当时人气还比较少，&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.reddit.com/r/programming/&quot;&gt;Reddit&lt;/a&gt;&amp;nbsp;和 &lt;a href=&quot;http://news.ycombinator.com/news&quot;&gt;Hacker News&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
这两个就放在一起吧，想跟上技术潮流和关注热点技术事件，这两个网站就不可能错过，这两个网站的排序算法是很多网站分析和学习的对象&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;日报&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;a href=&quot;http://weekly.manong.io/issues/&quot;&gt;码农周刊&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
刚成立的时候，正好应该是码农这个词大行其道的时候，当时还挺排斥这个词，但是瑕不掩瑜，每期还是聚集了很多很有深度的技术文章的&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;开源书籍&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
现在自出版也越来越流行，互联网帮助人们完成publish这个动作也越来越简单，撰写电子书、发表唱片都不像以前那么不可想象，而且互联网还改变了publish的方式，可以让更多人参与进来，合作完成。下面这两个网站基本涵盖了开源的一些手册、cookbook、编程语言参考等等。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://readthedocs.org/&quot;&gt;Read the docs&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://www.gitbook.com/explore&quot;&gt;Gitbook&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;信息源&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;a href=&quot;https://www.google.com/?gws_rd=ssl&quot;&gt;google&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://en.wikipedia.org/&quot;&gt;wikipedia&lt;/a&gt;&lt;br /&gt;
先google，后wiki应该作为找资料或发问前的两个必备功课&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/&quot;&gt;stackoverflow&lt;/a&gt;&lt;br /&gt;
其实可以作为程序员刷声望的地方&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://www.slideshare.net/&quot;&gt;slideshare&lt;/a&gt;&lt;br /&gt;
主要上去搜刮技术ppt，可是这里远远不止这些&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/1772748945623559663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2015/11/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/1772748945623559663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/1772748945623559663'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2015/11/blog-post.html' title='常去的技术网站'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-5803975191075519193</id><published>2011-06-03T05:10:00.000-07:00</published><updated>2011-12-01T09:40:17.872-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="latex"/><title type='text'>texlive 2010 制作虚包</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;为什么要做虚包？&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;因为我不是apt-get回来的，我觉得texlive还是去ctan上下载下来自己装比较舒服，如果你和我一样，那么一定就会想着做一个虚包的，因为，你比如说，你现在想装texmacs，可是，apt还是按部就班的找依赖，提示我们要装上一大堆我们已经有的texlive的东西了。所以咱们就做一个dummy（虚包）来忽悠它吧。下面是方法，关键是得到你已经装的包。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;$ aptitude install equivs # as root&lt;br style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;mkdir /tmp/tl-equivs &amp;amp;&amp;amp; cd /tmp/tl-equivs&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;&lt;br style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;equivs-control texlive-local&lt;br style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;# edit texlive-local (see below)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;$ equivs-build texlive-local&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;$ dpkg -i texlive-local_2010-1_all.deb # as root&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;这是官网提供的方法，但是呢，texlive-local，也就是我们的texlive到底安装了哪些东西，可能每个人都不一样，有一些人全装了，有些人只是装了一部分包，有些人装了之后还下了乱七八糟的来扩展它。不管怎样，方法都一样&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;$ tlmgr list --only-installed | awk &#39;{ print $2}&#39; &amp;gt;&amp;gt; texlive_pkg&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;这一行把已安装的包提取出来，放到texlive_pk下面，输出太多了，这里就不列出来了&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;注意这样处理之后，每行后面都有一个冒号，可以用vi打开texlive_pkg&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;然后&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-size: 12px; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: collapse; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; empty-cells: show; font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; line-height: normal; margin-left: 1px; table-layout: fixed; width: 1011px; word-wrap: break-word;&quot;&gt;&lt;tbody style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; line-height: normal; word-wrap: break-word;&quot;&gt;
&lt;tr style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; line-height: normal; word-wrap: break-word;&quot;&gt;&lt;td class=&quot;t_msgfont&quot; id=&quot;postmessage_12312183&quot; style=&quot;color: black; font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; font-size: 14px; font: normal normal normal 12px/normal song, Verdana; line-height: 1.6em; word-wrap: break-word;&quot;&gt;:1,$s/.$/,&lt;br /&gt;
或&lt;br /&gt;
:%s/.$/,&lt;br /&gt;
&lt;br /&gt;
乖乖，我做好deb之后，安装，接着试着安装asciidoc，居然发现不给力啊，不晓&lt;br /&gt;
得是什么问题，所以就先用2009的虚包吧&lt;br /&gt;
&lt;br /&gt;
texlive_local文件如下&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;Section: misc
Priority: optional
Standards-Version: 3.6.2

Package: texlive-local
Version: 2009-1~1
Maintainer: you &amp;lt;you@yourdomain.example.org&amp;gt;
Provides: biblatex, biblatex-dw, cm-super, cm-super-minimal, context, dvipng,
 feynmf, fragmaster, lacheck, latex-beamer, latex-cjk-all, latex-cjk-chinese,
 latex-cjk-chinese-arphic-bkai00mp, latex-cjk-chinese-arphic-bsmi00lp,
 latex-cjk-chinese-arphic-gbsn00lp, latex-cjk-chinese-arphic-gkai00mp,
 latex-cjk-common, latex-cjk-japanese, latex-cjk-japanese-wadalab,
 latex-cjk-korean, latex-cjk-thai, latex-cjk-xcjk, latexmk, latex-sanskrit,
 latex-xcolor, lcdf-typetools, lmodern, luatex, musixlyr, musixtex, pgf,
 preview-latex-style, prosper, ps2eps, psutils, purifyeps, t1utils, tex4ht,
 tex4ht-common, tex-gyre, texlive, texlive-base, texlive-base-bin,
 texlive-base-bin-doc, texlive-bibtex-extra, texlive-binaries, texlive-common,
 texlive-doc-base, texlive-doc-bg, texlive-doc-cs+sk, texlive-doc-de,
 texlive-doc-el, texlive-doc-en, texlive-doc-es, texlive-doc-fi,
 texlive-doc-fr, texlive-doc-it, texlive-doc-ja, texlive-doc-ko,
 texlive-doc-mn, texlive-doc-nl, texlive-doc-pl, texlive-doc-pt,
 texlive-doc-ru, texlive-doc-si, texlive-doc-th, texlive-doc-tr,
 texlive-doc-uk, texlive-doc-vi, texlive-doc-zh, texlive-extra-utils,
 texlive-fonts-extra, texlive-fonts-extra-doc, texlive-fonts-recommended,
 texlive-fonts-recommended-doc, texlive-font-utils, texlive-formats-extra,
 texlive-games, texlive-generic-extra, texlive-generic-recommended,
 texlive-humanities, texlive-humanities-doc, texlive-lang-african,
 texlive-lang-all, texlive-lang-arab, texlive-lang-arabic,
 texlive-lang-armenian, texlive-lang-croatian, texlive-lang-cyrillic,
 texlive-lang-czechslovak, texlive-lang-danish, texlive-lang-dutch,
 texlive-lang-finnish, texlive-lang-french, texlive-lang-german,
 texlive-lang-greek, texlive-lang-hebrew, texlive-lang-hungarian,
 texlive-lang-indic, texlive-lang-italian, texlive-lang-latin,
 texlive-lang-latvian, texlive-lang-lithuanian, texlive-lang-manju,
 texlive-lang-mongolian, texlive-lang-norwegian, texlive-lang-other,
 texlive-lang-polish, texlive-lang-portuguese, texlive-lang-spanish,
 texlive-lang-swedish, texlive-lang-tibetan, texlive-lang-ukenglish,
 texlive-lang-vietnamese, texlive-latex3, texlive-latex-base,
 texlive-latex-base-doc, texlive-latex-extra, texlive-latex-extra-doc,
 texlive-latex-recommended, texlive-latex-recommended-doc, texlive-luatex,
 texlive-math-extra, texlive-metapost, texlive-metapost-doc, texlive-music,
 texlive-omega, texlive-pictures, texlive-pictures-doc, texlive-plain-extra,
 texlive-pstricks, texlive-pstricks-doc, texlive-publishers,
 texlive-publishers-doc, texlive-science, texlive-science-doc, texlive-xetex,
 texpower, texpower-manual, thailatex, tipa, ttf-freefont, ttf-gfs-artemisia,
 ttf-gfs-baskerville, ttf-gfs-bodoni-classic, ttf-gfs-didot,
 ttf-gfs-didot-classic, ttf-gfs-gazis, ttf-gfs-neohellenic, ttf-gfs-olga,
 ttf-gfs-porson, ttf-gfs-solomos, ttf-gfs-theokritos, ttf-sil-gentium, xindy,
 xindy-rules
Architecture: all
Description: My local installation of TeX Live 2009.&lt;/pre&gt;&lt;pre style=&quot;font-family: &#39;WenQuanYi Micro Hei&#39;, sans-serif !important; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;嗯，总算没有再提示我缺依赖了&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/5803975191075519193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2011/06/texlive-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/5803975191075519193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/5803975191075519193'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2011/06/texlive-2010.html' title='texlive 2010 制作虚包'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-4935964656326314967</id><published>2011-06-02T10:00:00.000-07:00</published><updated>2015-11-08T04:40:12.920-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="lxr"/><title type='text'>linux代码查看工具lxr的安装和配置</title><content type='html'>配置好之后，我只能说，这个东西如果你没有一定的耐心的话，还真是折腾不下去，不像windows下的source insight，一路next，就马上有一个很好的交叉索引好的代码查看了，可是linux木有啊。那咱们就只有耐着性子折腾了。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCb8fOQ0W6UPVikBjbXll-zLtPVGKk2BvSOPUT7G69RsPlsNsncyyCK0_LEnbEGfjridwk2yXRJlCqvWu2dt19grv7-4OyUG1IFGGGqnLOhT1wmIc9WyyYYQTORljH4d8BHzhD02x7N3g/s1600/Selection_001.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCb8fOQ0W6UPVikBjbXll-zLtPVGKk2BvSOPUT7G69RsPlsNsncyyCK0_LEnbEGfjridwk2yXRJlCqvWu2dt19grv7-4OyUG1IFGGGqnLOhT1wmIc9WyyYYQTORljH4d8BHzhD02x7N3g/s640/Selection_001.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
用lxr看我的计算器实现&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
还是分步说吧&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
第一步，装好所有依赖&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
lxr需要用到的东西&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;exuberant ctags&lt;/li&gt;
&lt;li&gt;一个关系型数据库,可以是mysql和postgresql&lt;/li&gt;
&lt;li&gt;一个web服务器，推荐apache + mod_perl&lt;/li&gt;
&lt;li&gt;一个free-text searching. 可以是glimpse或者swish-e&lt;/li&gt;
&lt;li&gt;Perl的File::MMagic模块&lt;/li&gt;
&lt;li&gt;Perl的database driver interface DBI 和你所选择的数据库对应的DBD&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
好吧，这的确是要费不少力气的，所以我会推荐最省力的方式&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1. exuberant ctags&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
这个你就直接sudo apt-get install exuberant-ctags,如果你觉得不爽，可以去下源码来，自己编译，不过，告诉你，是差不多的&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2.postgresql&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
这里我是下了源码来安装，很简单，典型的三步&lt;/div&gt;
&lt;div&gt;
./configure&lt;/div&gt;
&lt;div&gt;
make&lt;/div&gt;
&lt;div&gt;
sudo make install&lt;/div&gt;
&lt;div&gt;
就可以了&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
为了方便，我还把他的bin路径添加到了.bashrc的PATH中了&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3.apache&lt;/div&gt;
&lt;div&gt;
源码安装&lt;/div&gt;
&lt;div&gt;
./configure&lt;/div&gt;
&lt;div&gt;
make&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
sudo make install&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
这里装完之后，你可以测试一下&lt;/div&gt;
&lt;div&gt;
启动apache&lt;br /&gt;
sudo /usr/local/apache2/bin/apachectl start&lt;br /&gt;
&lt;br /&gt;
然后在浏览器里打开&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
http://localhost&lt;br /&gt;
&lt;br /&gt;
看看有没有成功了，如果可以，那么就继续吧&lt;br /&gt;
&lt;br /&gt;
4.mod_perl的安装&lt;br /&gt;
&lt;br /&gt;
到了这一步，我觉得事情就简单了&lt;br /&gt;
直接到cpan去找mod_perl,下载下来，然后典型的四步&lt;br /&gt;
perl MakeFile.pl&lt;br /&gt;
make&lt;br /&gt;
make test&lt;br /&gt;
sudo make install&lt;br /&gt;
&lt;br /&gt;
5.DBI，DBD，File:MMagic的安装&lt;br /&gt;
这几个perl模块都只要到CPAN上下载，然后四步&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
perl MakeFile.pl&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
make&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
make test&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
sudo make install&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
6.free-text searching的安装&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
这里是可以选择glimpse或者swish-e的，但是两者区别,glimpse是对搜索友好一些，但和svn结合得不好，swish-e对搜索和索引不是很友好，但是和svn结合的好像不错，考虑了一下，自己主要是阅读一些开源代码的，所以就选择了glimpse&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
安装也很简单，直接就&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
./configure&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
make&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
sudo make install&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
三步就可以了&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
装完完这些依赖之后，你可以休息一下，晒晒太阳什么的，换换脑子&lt;br /&gt;
&lt;br /&gt;
.....&lt;br /&gt;
&lt;br /&gt;
配置开始&lt;br /&gt;
&lt;br /&gt;
lxr的配置文件就两个&lt;br /&gt;
&lt;br /&gt;
一个是apache的http.conf&lt;br /&gt;
&lt;br /&gt;
vi /usr/local/apache2/conf/http.conf&lt;br /&gt;
&lt;br /&gt;
直接看我的配置吧，我把关键的地方贴上来就可以了&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlRequire /home/pythonee/lxr/apache2-require.pl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alias /lxr /home/pythonee/lxr&lt;br /&gt;
&amp;lt;Directory /home/pythonee/lxr&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; AllowOverride All&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alias /icons/ &quot;/usr/local/apache2/icons/&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory &quot;/usr/local/apache2/icons&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Options Indexes MultiViews&lt;br /&gt;
&amp;nbsp; &amp;nbsp; AllowOverride None&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Order allow,deny&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
应该都还好理解&lt;br /&gt;
&lt;br /&gt;
另外一个配置文件就是lxr.conf, 不过话说lxr project提供了一个sample文件，可以在它的基础上做更改，配上lxr的readme文件，应该都比较好改，为了省大家的时间，我挑出要改的地方来吧&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;, &#39;glimpsebin&#39; &amp;nbsp; =&amp;gt; &#39;/usr/local/bin/glimpse&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;glimpseindex&#39; =&amp;gt; &#39;/usr/local/bin/glimpseindex&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# Location of SWISH-E binary&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#, &#39;swishbin&#39; =&amp;gt; &#39;/usr/local/bin/swish-e&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# Path to Exuberant Ctags executable&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;ectagsbin&#39; =&amp;gt; &#39;/usr/bin/ctags&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# Location of the ectags.conf file&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;ectagsconf&#39; =&amp;gt; &#39;/home/pythonee/lxr/lib/LXR/Lang/ectags.conf&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&#39;baseurl&#39; =&amp;gt; &#39;http://localhost/lxr&#39; &amp;nbsp; &amp;nbsp;# Put your URL here&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; # baseurl_aliases allows other URLs to be used to reach the site&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; # comment this out if you do not want any aliases&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;baseurl_aliases&#39; =&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;[ &#39;http://localhost/lxr&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;, &#39;http://127.0.0.1/lxr&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;virtroot&#39; &amp;nbsp; &amp;nbsp;=&amp;gt; &#39;/lxr&#39; &amp;nbsp; # The bit after the / above&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;, &#39;sourceroot&#39; =&amp;gt; &#39;/home/pythonee/lxr/indexed-src&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; , &#39;dbname&#39; =&amp;gt; &#39;dbi:Pg:dbname=lxr&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# If you need to specify the username or password for the database connection,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# uncomment the following two lines&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;dbpass&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;=&amp;gt; &#39;lxr&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;dbuser&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;=&amp;gt; &#39;lxr&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# If you need multiple lxr configurations in one database, set different table&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# prefixes for them.&lt;br /&gt;
&amp;nbsp; #&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;dbprefix&#39; =&amp;gt; &#39;lxr_&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# For using glimpse, the directory to store the .glimpse files in is required&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;, &#39;glimpsedir&#39; =&amp;gt; &#39;/home/pythonee/lxr/glimpse/databases&#39;&lt;br /&gt;
&lt;br /&gt;
好了，如果你还想配工程名啊，默认版本啊，都可以按照文档的来了&lt;br /&gt;
&lt;br /&gt;
总算配置完了，不过，还不能用，还得初始化数据库，lxr的根目录有各个数据库的初始脚本，有mysql，postgresql,oracle什么的，对应我的选择，我就用postgresql的初始化.&lt;br /&gt;
&lt;br /&gt;
psql -U lxr lxr&lt;br /&gt;
\i initdb-postgres&lt;br /&gt;
&lt;br /&gt;
最后，写一个启动脚本吧&lt;br /&gt;
&lt;br /&gt;
sudo /usr/local/apache2/bin/apachectl start&lt;br /&gt;
postgres -D /usr/local/pgsql/data&lt;br /&gt;
&lt;br /&gt;
# ./genxref --url=http://localhost/lxr --version=v4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
话说，我的安装都是看readme或install说明文件的，如果大家有疑问，一切答案都会在这两个文件中，我只不过是为了怕自己遗忘或者能省大家一点时间做了一个记录&lt;br /&gt;
&lt;br /&gt;
再是，在使用中，我还不知道怎么来看导入多个工程的代码，毕竟这是一个常用的需求，现在我只能对比一个工程的多个版本，不知道多个工程多个版本有没有人玩出来了，不过好像官网有说吧，我太懒了，不想去翻，等有闲心再去翻吧&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/4935964656326314967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2011/06/linuxlxr.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/4935964656326314967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/4935964656326314967'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2011/06/linuxlxr.html' title='linux代码查看工具lxr的安装和配置'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCb8fOQ0W6UPVikBjbXll-zLtPVGKk2BvSOPUT7G69RsPlsNsncyyCK0_LEnbEGfjridwk2yXRJlCqvWu2dt19grv7-4OyUG1IFGGGqnLOhT1wmIc9WyyYYQTORljH4d8BHzhD02x7N3g/s72-c/Selection_001.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-7695009555489408799</id><published>2011-06-01T17:18:00.000-07:00</published><updated>2015-11-08T04:41:47.575-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hadoop"/><category scheme="http://www.blogger.com/atom/ns#" term="mahout"/><category scheme="http://www.blogger.com/atom/ns#" term="map"/><category scheme="http://www.blogger.com/atom/ns#" term="reduce"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="virtualbox"/><title type='text'>ubuntu10.10下用virtual box跑hadoop全分布[2]</title><content type='html'>以上的四步，可以说，我们的环境基本搭建完成，下面就是hadoop的配置了&lt;br /&gt;
&lt;br /&gt;
hadoop的配置就是几个文件，但是要注意，三台电脑上的hadoop最好最好是保持不变吧&lt;br /&gt;
&lt;br /&gt;
我的hadoop路径是放在&lt;br /&gt;
&lt;br /&gt;
/home/pythonee/java_lib/hadoop-0.20.2下，以下看你的情况来更改&lt;br /&gt;
&lt;br /&gt;
首先是配置hadoop-env.sh,把你的JDK路径告诉hadoop吧&lt;br /&gt;
export JAVA_HOME=&quot;/usr/lib/jvm/java-6-sun-1.6.0.24&quot;&lt;br /&gt;
&lt;br /&gt;
和hadoop真正相关的文件&lt;br /&gt;
&lt;br /&gt;
第一个文件:masters，写上你的master计算机名，不要填IP，我的这里就是host里的master&lt;br /&gt;
第二个文件:slaves,写上你所有slave的计算机名，不要填IP，我的这里就是slave和child&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
第三个文件:hdfs-site.xml,配置name,data,tmp的路径&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;configuration.xsl&quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Put site-specific property overrides in this file. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;dfs.name.dir&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;/home/pythonee/java_lib/hadoop-0.20.2/name&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;description&amp;gt; &amp;nbsp;&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;dfs.data.dir&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;/home/pythonee/java_lib/hadoop-0.20.2/data&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;description&amp;gt; &amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;hadoop.tmp.dir&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;/home/pythonee/java_lib/hadoop-0.20.2/tmp&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;description&amp;gt; &amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;dfs.replication&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
第四个文件:mapred-site.xml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;configuration.xsl&quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Put site-specific property overrides in this file. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;mapred.job.tracker&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;master:9200&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;mapred.local.dir&amp;lt;/name&amp;gt; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;/home/pythonee/java_lib/hadoop-0.20.2/mapred&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
第五个文件:core-site.xml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;configuration.xsl&quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Put site-specific property overrides in this file. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;fs.default.name&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;hdfs://master:9100&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
好像hadoop之前的版本是将这三个文件分开的，这里我也是只贴了最简单的可用配置。&lt;br /&gt;
&lt;br /&gt;
下面就上我运行的截图吧，无图无真相啊&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh16ifcqVft9osZqoGrLLFFTmPJEGSLUdVscCzhPQ7RbLyjch_vD_cfLS2EOXk95tMys31kzBo2ce_wUubQd2MVxdZ3y4X-BTlfJHB3fpqhrTWBHjWAv6MGBUI1Q5NoMUUWZY0OlZBtbx4/s1600/Selection_001.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;523&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh16ifcqVft9osZqoGrLLFFTmPJEGSLUdVscCzhPQ7RbLyjch_vD_cfLS2EOXk95tMys31kzBo2ce_wUubQd2MVxdZ3y4X-BTlfJHB3fpqhrTWBHjWAv6MGBUI1Q5NoMUUWZY0OlZBtbx4/s640/Selection_001.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;map 和 reduce在跑&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBP2LXPQPZnh2hucHlxN51tjBWY0V1u4FU8m9A67OfOkP48VyXPRBeG1feCZQK_r17k4D-ax_qCx1Ghh24akn0FjU8VdXcQIuX2ayCqDj09Fq_NpdFYmrleNsloJwpJw7Z916a7-HBMaQ/s1600/Selection_003.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBP2LXPQPZnh2hucHlxN51tjBWY0V1u4FU8m9A67OfOkP48VyXPRBeG1feCZQK_r17k4D-ax_qCx1Ghh24akn0FjU8VdXcQIuX2ayCqDj09Fq_NpdFYmrleNsloJwpJw7Z916a7-HBMaQ/s640/Selection_003.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;看，我的集群&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBuyHH8DDaOK7E9ZEFNBLUk5EJVIvCDQx872if9Iqhe3Z47rrcT2X-okhPL3-AzsfvNzflsi71BCH-XmhkZQuYRb95lbe1VpnSWIcvUsqjPTHSUWFdhQNXorLbyZezOG-E2jeWPBXAPZ4/s1600/Selection_004.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBuyHH8DDaOK7E9ZEFNBLUk5EJVIvCDQx872if9Iqhe3Z47rrcT2X-okhPL3-AzsfvNzflsi71BCH-XmhkZQuYRb95lbe1VpnSWIcvUsqjPTHSUWFdhQNXorLbyZezOG-E2jeWPBXAPZ4/s640/Selection_004.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;input和output&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUNILn0mSyGGA5Uw8b0ROyCkw79a1DXmZakF0coe8oqXiIhhS3NQumkkjLdsMVdhxpXax7Tnhwo35J25x3u4ENZBnkFcrzl0Sa7jtyj0B-wg6YD8d2UraJwXtLIwkoQmvngbonCx-FTyo/s1600/Selection_005.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUNILn0mSyGGA5Uw8b0ROyCkw79a1DXmZakF0coe8oqXiIhhS3NQumkkjLdsMVdhxpXax7Tnhwo35J25x3u4ENZBnkFcrzl0Sa7jtyj0B-wg6YD8d2UraJwXtLIwkoQmvngbonCx-FTyo/s640/Selection_005.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;运行的history&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
总结&lt;br /&gt;
&lt;br /&gt;
这两篇简单的配置是为了大家能让hadoop小飞象飞起来，并没有弄太多具体的一些配置，因为搭建hadoop不是用来玩的，如果真要弄，还得去深入学习map/reduce的原理，hadoop据说也要重构了，因为他们发现hadoop集群变大的时候，hadoop的性能急剧下降。&lt;br /&gt;
&lt;br /&gt;
如果你懒得弄这些，纯粹为了应用，那么我觉得可以用Google app engine或amazon的服务，这些都是搭好的集群。&lt;br /&gt;
&lt;br /&gt;
总算是了了一个心愿了，不过话说，我把mahout和hadoop结合的时候，我的单机就吃不消了，下次要弄一个真正的来跑一跑</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/7695009555489408799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2011/06/ubuntu1010virtual-boxhadoop2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/7695009555489408799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/7695009555489408799'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2011/06/ubuntu1010virtual-boxhadoop2.html' title='ubuntu10.10下用virtual box跑hadoop全分布[2]'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh16ifcqVft9osZqoGrLLFFTmPJEGSLUdVscCzhPQ7RbLyjch_vD_cfLS2EOXk95tMys31kzBo2ce_wUubQd2MVxdZ3y4X-BTlfJHB3fpqhrTWBHjWAv6MGBUI1Q5NoMUUWZY0OlZBtbx4/s72-c/Selection_001.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-2071830522111461419</id><published>2011-06-01T16:39:00.000-07:00</published><updated>2015-11-08T04:43:28.847-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hadoop"/><category scheme="http://www.blogger.com/atom/ns#" term="mahout"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="virtualbox"/><title type='text'>ubuntu10.10下用virtual box跑hadoop全分布[1]</title><content type='html'>因为本科的时候的毕业设计是用mahout来做个性化推荐系统，当时那个系统真是麻雀虽小，但是五脏俱全，有爬虫，有搜索，有个性化推荐，有调用开放api来做mashup。但是呢，我的那部分用mahout来做推荐引擎部分其实当时并没有做到完美，主要是速度非常非常慢。因为mahout是建立在hadoop集群上的，而当时我们的系统是windows,所以就懒得去折腾hadoop的全分布，所以当时的hack方向就是怎么减少数据集来减少数据量，但是发现精确度是不够的。如果你也有兴趣的话，你会发现典型的mapper和reducer。 但是现在有了时间，所以就想把这个未完成的心愿补完吧，这边文章主要描述如何在ubuntu下通过virtualbox建立一个小集群。并成功运行word count的例子&lt;br /&gt;
&lt;br /&gt;
我的集群&lt;br /&gt;
一台master&lt;br /&gt;
两个slave，计算机名分别为slave和child&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ip&lt;br /&gt;
master &amp;nbsp; &amp;nbsp; 192.168.1.15&lt;br /&gt;
slave &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.56.101&lt;br /&gt;
child &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.56.102&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
准备环境&lt;br /&gt;
&lt;br /&gt;
主机:ubuntu 10.10 maverick&lt;br /&gt;
虚拟机: virtualbox 3.2.8&lt;br /&gt;
&lt;br /&gt;
Package:Hadoop-0.20.2&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OpenSSH-server&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OpenSSH-client&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rsync&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sun-java6-jdk&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sun-java6-plugin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
第一步:安装virtalbox-ose&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 在ubuntu下，只要一步 sudo apt-get install virtualbox-ose即可&lt;br /&gt;
&lt;br /&gt;
第二步:准备java环境&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 在ubutnu下，这件事情也非常简单，比windows还简单，因为你都可以不用配置环境变量了&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 直接敲&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 然后把默认的openJDK换过来,命令是&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; sudo update-alternatives --config java&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 根据提示，选择sun-java6-jdk就好了&lt;br /&gt;
&lt;br /&gt;
第三步:安装slave&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 我因为懒的下载了，所以master和slave的OS都是ubuntu 10.10 maverick，不过话说&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 这样更好吧，因为你都不需要应付可能出现的问题，这一步不用说吧，直接把iso放到virtualbox的虚拟光驱中，然后启动安装，这个比真机快多了，因为没有格式化和什么的&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 这里安装两台slave就可以了，跑多了，电脑带不动&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 这里还得注意，我在slave安装的时候，用户名和密码和master是一模一样的，换句话说，我的master和slave是如法炮制的&lt;br /&gt;
&lt;br /&gt;
第四步:master和slave的无密码SSH通讯&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 这步是重中之重，我在这一步上栽倒了很多次，不是SSH通讯不成功，而是通讯成功之后，hadoop跑起来之后，总是会在中间的怀节卡住，所以这一步我要提醒大家要充分注意自己的设置&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 首先&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 我们得保证master和slave在同一个子网中，简单说就是，如果master的ip是192.168.1.15，那么slave的ip就应该是192.168.*.*什么的，而在virtualbox有四种网卡的配置，分别是Nat,Bridged Adapter,Internal,Host-only,可以肯定的Nat和Internal是不适合这里的，至于为什么，大家可以Google一下，这四种模式下，slave和master的互访关系和限制。那么bridged也就是我们常说的桥接应该是最简单的，选择这种方式就已经让slave和master在同一子网中了，你就想做是一个寝室了多了一台电脑吧。而host-only是比较麻烦的，先不讲这种吧，不过可是肯定的是，这两种方式我都实验了，而且都成功了。接下来的ssh通讯设置是假设你是使用bridged网卡设置。另外我们得保证三台电脑有一个相同的用户名，在第三步安装slave的时候我说了，我三台机器都用的是pythonee作为用户名。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 通讯的第一步就是修改host文件，这一步也是容易犯错的地方，这里为了简单说明，如果你的host里没有很特别的设置的话，你完全是可以清空整个文件的，一点问题没有。下面是我的设置&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 在master上的/etc/host文件&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.56.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; master&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.56.101 &amp;nbsp; &amp;nbsp; slave&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.56.102 &amp;nbsp; &amp;nbsp; child&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 注意，我这里是用的host-only的方式的，上个截图吧，一切就清楚了&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd6Rx88801jgDI7NFyMi1VfNMg23JinRUVk7o2Dtq5Y3Sw1Fwnk1sRwQvc-Xn1bBUxgg_9oeQaYxFpKFm9wV2HaPW3Mgue1k3dLsRGG8Z1eR7f_jOZYySNqtks1lg0vtef0ry5inLoKdo/s1600/Screenshot-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd6Rx88801jgDI7NFyMi1VfNMg23JinRUVk7o2Dtq5Y3Sw1Fwnk1sRwQvc-Xn1bBUxgg_9oeQaYxFpKFm9wV2HaPW3Mgue1k3dLsRGG8Z1eR7f_jOZYySNqtks1lg0vtef0ry5inLoKdo/s640/Screenshot-1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;点击可以看大图&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 下面是三台电脑ifconfig得到的信息&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXsKd0HUGnrt8sOM_sgxmI1NTLBbXgtYPivGktQfp84nmchcTIgpCVhZyGT6DW0AlxAmk9Ckhhd1kTw-HQJ30569np7mxBbUKyLXpA_5S0WKpLRDpDQ9pNiiMZ9906zpjeyJ1nBO-D67s/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXsKd0HUGnrt8sOM_sgxmI1NTLBbXgtYPivGktQfp84nmchcTIgpCVhZyGT6DW0AlxAmk9Ckhhd1kTw-HQJ30569np7mxBbUKyLXpA_5S0WKpLRDpDQ9pNiiMZ9906zpjeyJ1nBO-D67s/s640/Screenshot.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;点击看大图&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 好了，在继续往前走之前，大家可以在每台机子上ping一下，如果可以ping通，那么就可以继续往前走了。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 安装openssh-server&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 照样的sudo apt-get install openssh-server&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 这一个要在master和两台slave都要装上&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 然后在master上生成密钥对，命令是&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; ssh-keygen -t rsa&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 熟悉公钥加密通讯的话，这一步应该很好理解，接下来就是把master的公钥给slave,懒人就用scp吧&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cd .ssh&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; scp -r id_rsa.pub pythonee@slave:/home/pythonee/.ssh/authorized_keys_m&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; scp -r id_rsa.pub pythonee@child:/home/pythonee/.ssh/authorized_keys_m&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 以上的所有动作是把master的公钥复制给了slave和child&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 同样的道理，接下来就是把slave和child的公钥送给master&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 用pythonee登录到slave，生成密钥对&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; ssh-keygen -t rsa&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cd .ssh&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; scp -r id_rsa.pub pythonee@slave:/home/pythonee/.ssh/authorized_keys_s&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 用pythonee登录到child,生成密钥对&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; ssh-keygen -t rsa&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cd .ssh&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; scp -r id_rsa.pub pythonee@master:/home/pythonee/.ssh/authorized_keys_c&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 最后合并&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 在slave上&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cd .ssh&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; mv authorized_keys_m authorized_keys&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cat id_rsa.pub &amp;gt;&amp;gt; authorized_keys&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 在child上&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cd .ssh&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; mv authorized_keys_m authorized_keys&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cat id_rsa.pub &amp;gt;&amp;gt; authorized_keys&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 在master上&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cd .ssh&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; mv authorized_keys_s authorized_keys&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cat id_rsa.pub &amp;gt;&amp;gt; authorized_keys&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; cat authorized_keys_c &amp;gt;&amp;gt; authorized_keys&lt;br /&gt;
&lt;br /&gt;
到这里，我们算是到了一个里程碑，三台电脑可以不用输入密码就可以ssh通讯了，你可以简单测试下&lt;br /&gt;
&lt;br /&gt;
在master上&lt;br /&gt;
ssh slave&lt;br /&gt;
ssh child&lt;br /&gt;
&lt;br /&gt;
在slave上&lt;br /&gt;
ssh master&lt;br /&gt;
&lt;br /&gt;
在child上&lt;br /&gt;
ssh master&lt;br /&gt;
&lt;br /&gt;
如果这三个都不用输入密码就成功登录了，那么我们就可以休息一下，下面接着整我们真正的主角hadoop了</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/2071830522111461419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2011/06/ubuntu1010virtual-boxhadoop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/2071830522111461419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/2071830522111461419'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2011/06/ubuntu1010virtual-boxhadoop.html' title='ubuntu10.10下用virtual box跑hadoop全分布[1]'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd6Rx88801jgDI7NFyMi1VfNMg23JinRUVk7o2Dtq5Y3Sw1Fwnk1sRwQvc-Xn1bBUxgg_9oeQaYxFpKFm9wV2HaPW3Mgue1k3dLsRGG8Z1eR7f_jOZYySNqtks1lg0vtef0ry5inLoKdo/s72-c/Screenshot-1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3861077904786157832.post-4068213907740086973</id><published>2011-06-01T14:12:00.000-07:00</published><updated>2011-11-15T05:44:35.312-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="beautifulsoup"/><category scheme="http://www.blogger.com/atom/ns#" term="lxml"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>使用beautifulsoup和lxml来解析html和xml文件</title><content type='html'>这两个库的介绍就不说了吧，在网上，我们可以看到很多用beautifulsoup和urllib2就可以写出不用50行就可以很强大的爬虫。如果加上优先权队列还有多线程什么的，再简单对页面上的&amp;lt;a&amp;gt;进行pagerank,那么就是一个本科的毕业设计题目了吧，lxml这个库真是太优秀了，在xml的解析中，我还真没有见到如此好用的库，性能也很好。当然你要用lxml来解析html也是可以的。不过我不是很喜欢那种不漂亮的代码。下面就看我这次是怎么来玩的吧。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
事情的起因是，我想完善我的google custom search engine。我平时用google reader订阅了很多大牛的feed,所以我的习惯是，先用google搜索我的keyword，慢慢的锁定我要找的范围，然后看看它给的search suggestion。 一旦锁定了范围，那么我就会到我的google reader再细化我的搜索，通常都能短时间内找到高质量的文章。因为我的google reader feed数达到了784个。但是我比较懒，所以我就想把google reader里的feed添加到custom search engine中，开始认为可以用google reader的导出功能，然后只要import到custom search engine就可以了，结果....不行，尼玛啊，这里得说，google还是要提高自己产品的互连的。不然老是被大家诟病。 Google reader可以导出opml格式的文件。说白了就是一个xml文件，我们接下来就要解析这个xml文件，提取我们需要的链接。&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
另外，我的google bookmark是收藏了一些无法订阅的网站，比如国外的一些科研网站，这些网站都是懒得做全文feed输出的，所以我也需要合并到我的custom search engine中，不过和google reader的导出不太一样，这个导出的是一个html文件，我们下面的代码是对这个html进行解析。让我见识一下beautifulsoup是不是很delicious吧。&lt;br /&gt;
&lt;br /&gt;
长话短说，opml的格式大概如下:&lt;br /&gt;
&amp;lt;?xml version=”1.0” encoding=”UTF-8” ?&amp;gt;&lt;br /&gt;
&amp;lt;opml version=”1.0”&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;xxxxxxx&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;outline text=&quot;PYthonee Blog&quot;&lt;br /&gt;
&amp;nbsp;               &amp;nbsp; &amp;nbsp; title=&quot;PYthonee Blog&quot; type=&quot;rss&quot;&lt;br /&gt;
&amp;nbsp;               &amp;nbsp; &amp;nbsp; xmlUrl=&quot;http://pythonee.blogspot.com/feeds/posts/default&quot;      &lt;br /&gt;
&amp;nbsp;               &amp;nbsp; &amp;nbsp; htmlUrl=&quot;http://pythonee.blogspot.com/&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;outline&amp;gt;&lt;br /&gt;
&amp;nbsp;              &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;outline&amp;gt;&lt;br /&gt;
&amp;nbsp;              &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/outline&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/outline&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;outline&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/outline&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/opml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
这里就简单说说吧，head就一个title元素，没有什么好说的，就是你的google reader啦，body里就是outline，就是一个一个feed。但是注意的，outline是可以嵌套的，outline有text,title,xmlUrl和htmlUrl地址四个属性，这里我们只对xmlUrl和htmlUrl感兴趣，xmlUrl就是feed地址，htmlUrl就是网站地址，所以我们要提取出所有的outline的htmlUrl。好了，这里可以上代码了&lt;br /&gt;
&lt;br /&gt;
from lxml import etree,objectify&lt;br /&gt;
&lt;br /&gt;
result = open(&#39;result.txt&#39;,&#39;a&#39;) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
root = objectify.parse(&quot;google-reader-subscriptions.xml&quot;).getroot() &lt;br /&gt;
&lt;br /&gt;
for el in root.iter(): &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; if el.get(&#39;htmlUrl&#39;): &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.write(str(el.get(&#39;htmlUrl&#39;))+&quot;\n&quot;)&lt;br /&gt;
&lt;br /&gt;
对，这就是我们全部的代码。舒服吧&lt;br /&gt;
&lt;br /&gt;
接下了，解析由google bookmark导出的html文件，这里就可以不用看这个html文件了吧，^_^&lt;br /&gt;
直接上代码了&lt;br /&gt;
&lt;br /&gt;
from BeautifulSoup import BeautifulSoup,SoupStrainer&lt;br /&gt;
&lt;br /&gt;
links = BeautifulSoup(bookmarks,parseOnlyThese=SoupStrainer(&#39;a&#39;)) &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
for link in links:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; result.write(link[&#39;href&#39;] + &quot;\n&quot;) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
真是让人赏心悦目啊&lt;br /&gt;
&lt;br /&gt;
另外，附上完整的代码一份，我还去抓取了csdn所有专家的链接，以让自己的搜索更全面一些吧，因为csdn上还有不少我喜欢的前辈，像pongba, g9, albertlee等人&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from BeautifulSoup import BeautifulSoup,SoupStrainer&lt;br /&gt;
from lxml import etree,objectify&lt;br /&gt;
&lt;br /&gt;
result = open(&#39;result.txt&#39;,&#39;a&#39;)&lt;br /&gt;
&lt;br /&gt;
bookmarks = open(&quot;GoogleBookmarks.html&quot;,&quot;r&quot;).read()&lt;br /&gt;
&lt;br /&gt;
#print bookmarks&lt;br /&gt;
&lt;br /&gt;
links = BeautifulSoup(bookmarks,parseOnlyThese=SoupStrainer(&#39;a&#39;))&lt;br /&gt;
&lt;br /&gt;
for link in links:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; result.write(link[&#39;href&#39;] + &quot;\n&quot;)&lt;br /&gt;
&lt;br /&gt;
root = objectify.parse(&quot;google-reader-subscriptions.xml&quot;).getroot()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for el in root.iter():&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if el.get(&#39;htmlUrl&#39;):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.write(str(el.get(&#39;htmlUrl&#39;))+&quot;\n&quot;)&lt;br /&gt;
&lt;br /&gt;
csdnexpert = open(&quot;expert.html&quot;,&quot;r&quot;).read()&lt;br /&gt;
&lt;br /&gt;
csdnlinks = BeautifulSoup(csdnexpert,parseOnlyThese=SoupStrainer(&#39;a&#39;))&lt;br /&gt;
&lt;br /&gt;
for link in csdnlinks:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if link.has_key(&#39;href&#39;) and str(link[&#39;href&#39;]).startswith(&quot;http://blog.csdn.net&quot;):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.write(link[&#39;href&#39;]+&quot;\n&quot;)&lt;br /&gt;
&lt;br /&gt;
附上本人辛苦折腾的这个custom search engine吧，猛击&lt;a href=&quot;http://www.google.com/cse/home?cx=003314338486782386267:vt9rd-d2fus&quot;&gt;这里&lt;/a&gt;，希望这个可以让各位编程时候的搜索更加愉快吧</content><link rel='replies' type='application/atom+xml' href='http://pythonee.blogspot.com/feeds/4068213907740086973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pythonee.blogspot.com/2011/06/beautifulsouplxmlhtmlxml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/4068213907740086973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3861077904786157832/posts/default/4068213907740086973'/><link rel='alternate' type='text/html' href='http://pythonee.blogspot.com/2011/06/beautifulsouplxmlhtmlxml.html' title='使用beautifulsoup和lxml来解析html和xml文件'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>