发博文
个人资料
§澜意※烟雨
§澜意※烟雨
  • 博客等级:
  • 博客积分:180
  • 博客访问:1,847
  • 关注人气:2
大喇叭啦啦啦
 
请点击下面这个链接,访问我的博客。
此处仅作为中转站。
http://www.liulantao.com/
QQ103074

 
图片播放器
好友
加载中…
博文
<step1>: kernel .config:
    madwifi need WIRELESS_EXT, which depends on HOSTAP || PRISM, i chose HOSTAP

<step2>: /etc/conf.d/net:
    modules=("wpa_supplicant")  # use wireless-tools only support wep
    #wpa_supplicant_wlan0="-Dmadwifi"    # i dont use madwifi, just skip <step1>
    iwconfig_wlan0="mode managed"    # so put wireless card to managed-mode

<step3>:
    /etc/init.d/net.wlan0 start   # works!


<reference>:
    http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4


http://www.liulantao.com/
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

it

分类: 破电脑
Twitter早期的更新采用Capistrano和Git,每次程序更新时间与服务起数目呈线性关系。当服务器数量迅速增加时,更新 效率开始成为问题。
基于中心代码库,更新时代码库压力较大。通过增加Git库的副本,可以缓解问题,但是从长期看,需要持续进行Git库扩展。

后来,Twitter引入去中心化的方案,在程序更新中采用BitTorrent,将更新时间从40分钟降低到12秒!


Capistrano: Ruby世界流行的一个部署框架,在实际服务器上执行任务。
Git:代码管理。
Murder:启动BTtracker,创建seeds,文件传输等任务。
BitTornado:对BitTorrent改造,更适合DataCenter内部高质量的网络环境。


http://www.liulantao.com/portal/
附原文:

Murder: Fast datacenter code deploys using BitTorrent

Thursday, July 15, 2010

Twitter has thousands of servers. What makes having boatloads of servers particularly annoying though is that we need to quickly get multiple iterations of code and binaries onto all of them on a regular basis. We used to have a git-based deploy system where we’d just instruct our front-ends to download the latest code from our main git machine and serve that. Unfortunately, once we got past a few hundred servers, things got ugly. We recognized that this problem was not unlike many of the scaling problems we’ve had and dealt with in the past though -- we were suffering the symptoms of a centralized system.

By sitting beside a particularly vocal Release Engineer, I received first-hand experience of the frustration caused by slow deploys. We needed a way to dramatically speed things up. I thought of some quick hacks to get this fixed: maybe replicate the git repo or maybe shard it so everyone isn’t hitting the same thing at once. Most of these quasi-centralized solutions will still require re-replicating or re-sharding again in the near future though (especially at our growth). It was time for something completely different, something decentralized, something more like.. BitTorrent.. running inside of our datacenter to quickly copy files around. Using the file-sharing protocol, we launched a side-project called Murder and after a few days (and especially nights) of nervous full-site tinkering, it turned a 40 minute deploy process into one that lasted just 12 seconds!

Murder (which by the way is the name for a flock of crows) is a combination of scripts written in Python and Ruby to easily deploy large binaries throughout your company’s datacenter(s). It takes advantage of the fact that the environment in a datacenter is somewhat different from regular internet connections: low-latency access to servers, high bandwidth, no NAT/Firewall issues, no ISP traffic shaping, only trusted peers, etc. This let us come up with a list of optimizations on top of BitTornado to make BitTorrent not only reasonable, but also effective on our internal network. Since at the time we used Capistrano for signaling our servers to perform tasks, Murder also includes a Capistrano deploy strategy to make it easy for existing users of Capistrano to convert their file distribution to be decentralized. The final component is the work Matt Freels (@mf) did in bundling everything into an easy to install ruby gem. This further helped get Murder to be usable for more deploy tasks at Twitter.


Reference:
    http://engineering.twitter.com/2010/07/murder-fast-datacenter-code-deploys.html
    Murder:(Python/Ruby)http://github.com/lg/murder

http://www.liulantao.com/portal/
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2010-08-08 23:19)
标签:

家庭

杂谈

分类: 寒暄一番

立秋过后,眨眼就溜向年底了,得抓点儿紧。

工作上一大堆,倒是可以一件一件完成。要考虑自己中长期的发展,要考虑家庭等等。不能懒惰。

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2010-01-17 22:25)
标签:

情感

日子滴滴嗒嗒,缓缓急急,入盛夏过深秋到寒冬。

半年的新生活,渐渐地,习惯了朝九晚九的新节奏,在一个狭小的区域里,每天摆来又摆去,重复着不变的节奏。 却疏远了深夜的麻辣烫,黄昏乌鸦鸣叫的校园,还有近郊香山高处的风与景。在这里,生活繁琐而艰难,每天面对各种诱惑,然后以各种路过的姿态,回归自己正常 的方向

一个烦躁不安的日子,翻阅着半年来几个月里朋友们的文字,那些远走他处享受生活的,那些
仍 在这个水泥都市里奋斗的,那些消失许久后又现身的,都在各自的经历之后,发出了大大小小的满意的声音。印象里的一个个充满精力彻夜狂欢着的形象,顿显 成熟的影子。年轻人们的话题,那些飞扬的梦想,大概都伴随那时的日记本放进了尘封的储物箱中了。

在熙熙攘攘的人群中穿梭,在齐整划一的办公间拼搏,在深夜的孤 灯熄灭处栖身,每天又每天之后,终于,我们对周围的一切心满意足。
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 

Install Debian GNU/Linux under an existing Unix-like system VIA chroot and debootstrap

 

I should say the new debian GNU/Linux LENNY is an excellent platform to meet various users' needs.

Before starting our installation, the new version of debootstrap and chroot should work on your machine.
Information about chroot can be found an "http://en.wikipedia.org/wiki/Chroot".
These two software should have been contained in the repository of most of the popular distributions such as redhat/debian/suse, etc. "yum install chroot debootstrap -y" should work on RHEL/Centos/Fedora, and "apt-get install chroot debootstrap -y" should work on Debian/Ubuntu.

The operations below need root priviledge. The following command line started with a '#' should be perform on you existing system, and the line start with two '#'s should be perform in the chrooted environment. Additional the line started with three '#'s should be perform after the new debian lenny was boot up.

Let's GO!

1 - PREPARE DISK SPACE
 1.1 - I just want to install my new Debian LENNY on /dev/sda3, you should replace this with own choice.
# mke2fs -j /dev/sda3
# mkswap /dev/sda8
# sync; sync; sync
# swapon /dev/sda8
 1.2 - mount the partition.
#mkdir /debian
#mount /dev/sda3 /debian

2 - INSTALL BASIC SYSTEM WITH DEBOOTSTRAP.
# debootstrap --arch i386 lenny /debian/ URL
 replace "URL" with the mirror you have chosen, eg:
# debootstrap --arch i386 lenny /debian/ ftp://ftp3.tsinghua.edu.cn/mirror/debian/debian

3 - CHROOT TO THE NEW SYSTEM.

#LANG=C chroot /debian/ /bin/bash

4 - NOW WE ARE IN THE CHROOTED SYSTEM, A BRAND NEW WORLD
mount the /proc filesystem
## mount -t proc proc /proc

perform some initial operation.
## MAKEDEV

5 - CONFIGURE LENNY.
configure the filesystem.
## editor /etc/fstab
## mount -a

configure the network.
## editor /etc/network/interfaces
## echo HOSTNAME >> /etc/hostname
## editor /etc/hosts

6 - OTHER CONFIGURATION AND PACKAGES TO INSTALL.
configure sourcelist of you mirror.
## editor /etc/apt/source.list
## aptitude update

configure system locales.
## aptitude install locales
## dpkg-reconfigure locales

------------- optional : after reboot  ---------------
### aptitude install console-data
### dpkg-reconfigure console-data
------------------------------------------------

7 - KERNEL AND BOOTLOADER.
find some kernel files to boot your machine.
## apt-cache search linux-image
## aptitude install linux-image-2.6.26-1.686
## editor /etc/kernel-img.conf

install the grub bootloader
## aptitude install grub
## grub-install /dev/sda3
## update-grub

8 - AUTOMATICALLY INSTALL SOME PACKAGE.
install basic system packages.
## tasksel install standard
## aptitude clean

install various packages for laptop and desktop application, OPTIONAL.
## tasksel install laptop
## tasksel install desktop

8 - REBOOT TO LENNY.
 iT works, HAVE FUN!
--
Liu Lantao
College of Information Science and Technology, Beijing Normal University
EMAIL: liulantao ( at ) gmail ( dot ) com ;
WEBSITE: http://www.liulantao.com/ .
------
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

ror

rails

radrails

eclipse

it

分类: 破电脑

ROR development with RadRails in Eclipse

安装Eclips。
菜单:Help - Software Updates - Available Software - Add Sites, http://radrails.sourceforge.net/update, http://updatesite.rubypeople.org/release
------------参考文章-------------------
installing RadRails on Eclipse ...........

I could not find a proper answer when i wanted to install RadRails on eclipse . This is how it is done , .... in the Eclipse menu go to
Help-->Software Updates --> Find and Install....
then in the pop - up window which appears ,..
Search for new features to install
and then click next and then u will have to add 2 new remote sites, .. the details for the sites are the ones which were very difficult to obtain , they are
site 1 :
Name :RadRails
URL : http://radrails.sourceforge.net/update
site 2 :
Name :RDT
URL : http://updatesite.rubypeople.org/release
then click on finish , u are almost done with the installation , u have to just follow the instructions from here on to finish the installation .

Original link:http://satisheerpini.blogspot.com/2008/05/installing-radrails-on-eclipse.html
-------------------------------
--
Liu Lantao
College of Information Science and Technology, Beijing Normal University
EMAIL: liulantao ( at ) gmail ( dot ) com ;
WEBSITE: http://www.liulantao.com/ .
------
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

rails

mysql

liulantao

it

分类: 破电脑

Rails开发中的MySQL中文问题以及简单解决方式

Rails2.2.2对中文的支持是不错的,当然不仅仅是中文,所有多字节文字都能够很好得被支持。
对于一个有很高本地化l10n和国际化i18n需求的网站,多语言支持的实现方式很多,最常用的是采用gettext来实现。

在网页生成过程中,初学者最容易出问题的就是数据库连接的编码问题。最便捷的解决方式是采用utf8编码方式。
Rails应用中config/database.yml中可以在数据库段中设置encoding: utf8如下:
----------------
development:
adapter: mysql
encoding: utf8
database: project_development
pool: 5
username: root
password:
host: localhost
----------------
对于使用MySQL数据库的应用,只要设置/etc/my.cnf就可以保证正确的存取utf8数据了。

检查/etc/my.cnf文件,保证里面有如下两段内容,如果没有则添加进去:
--------------
[client]
default-character-set=utf8

[mysqld]
default-character-set=utf8
init_connect='SET NAMES utf8'
--------------
修改保存之后,重启服务器即可。
--
Liu Lantao
College of Information Science and Technology, Beijing Normal University
EMAIL: liulantao ( at ) gmail ( dot ) com ;
WEBSITE: http://www.liulantao.com/ .
------
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 

Rails国际化的关键步骤。Rails I18n Key Steps.

Rails I18n的关键点


1、设定locales文档。
config/locales/en.yml
------------------------------
en:
  hello: "Hello world"
  store: "Store"
------------------------------
config/locales/zh-CN.yml
------------------------------
zh-CN:
  hello: "你好"
  store: "商店"
------------------------------
2、解析locale。
app/controller/application.rb
------------------------------
  class ApplicationController < ActionController::Base
    before_filter :set_locale
    def set_locale
      I18n.locale = params[:locale] || 'zh-CN'              #如果没有,则使用默认值。
    end
    ...
  end
------------------------------
3、在控制器中读取变量
------------------------------
class StoreController < ApplicationController
  def index
    @products = Product.find_products_for_sale
    flash[:hello_flash] = t(:hello_flash)
  end
  ...
end
------------------------------
4、在视图层中使用变量
------------------------------
      <% if flash[:hello_flash] -%>
        <div id="hello_flash"><%= flash[:hello_flash] %></div>
      <% end -%>
------------------------------

--
Liu Lantao
College of Information Science and Technology, Beijing Normal University
EMAIL: liulantao ( at ) gmail ( dot ) com ;
WEBSITE: http://www.liulantao.com/ .
------
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 

计算两个整数最大公约数和最小公倍数的算法:C++语言实现

计算两个整数最大公约数和最小公倍数的算法:C++语言实现

#include <iostream>
using namespace std;
int gcd(int a, int b) //最大公约数
{
while(a!=b)
{ a>b ? a -= a/b * b : b -= b/a * a; }
return a;
}
int lcm(int a, int b) //最小公倍数
{
return a * b / gcd(a,b);
}
int main()
{
int x, y;
cout << "请输入两个正整数:" <<endl;
cin >> x >> y;
cout << "最大公约数: " << gcd(x,y) << " ; 最小公倍数: " << lcm(x,y) << endl;
return 0;
}


--
Liu Lantao
College of Information Science and Technology, Beijing Normal University
EMAIL: liulantao ( at ) liulantao ( dot ) com ;
WEBSITE: http://www.liulantao.com/ .
------

 
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 

fedora 8 声音问题解决方案

fedora 8 声音问题解决方案

症状:
1、通过system-config-soundcard测试,可以正确识别声卡。
2、普通用户无法调节音量,无法播放声音文件。

解决方法:

[lax@liulantao ~]$ sudo less /etc/security/console.perms.d/50-default.perms
Password:

添加以下内容

#lax defined
#lax defined
<laxaudio>=/dev/dsp* /dev/snd/*
<console> 0666 <laxaudio> 0600 root

重启系统,ok。

参考文章:http://home.nyc.rr.com/computertaijutsu/rhsound.html


--
Liu Lantao
College of Information Science and Technology, Beijing Normal University
EMAIL: liulantao ( at ) gmail ( dot ) com ;
WEBSITE: http://www.liulantao.com/ .
------

 
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
  

新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有