- svnsync 的主要用途是创建 svn repository 的 readonly mirror, 如果向 mirror 进行了 commit, 则以后的 sync 会 fail
- svnsync sync 之后, mirror 的 source repository 是不允许再修改的
- svnsync init 只能 init 一个刚创建的空的 repository, 否则报错: svnsync: Cannot initialize a repository with content in it
2007-07-30
svnsync
Posted by
Display Name
-
7:47 PM
0
comments
Labels: Version Control
2007-07-27
AutoIt: Windows Automation Language
AutoIt is a freeware Windows automation language. It can be used to script most simple Windows-based tasks (great for PC rollouts or home automation).
AutoIt has been in popular use since 1999 and continues to provide users and administrators with an easy way to script the Windows GUI. In February 2004 the latest version of AutoIt - known as AutoIt v3 - was released and added powerful scripting features.
AutoIt v3 was developed in a small team with the help of contributors around the world and this has led to a great set of help files, examples, support forum, mailing list, editor files, and third-party utilities. Oh, and lets not forget some nice graphics and wallpapers too!
All development is focused on AutoIt v3 but v2 will continue to be downloadable and supported as it is in such widespread use.
Posted by
Display Name
-
1:20 PM
0
comments
Labels: Utils
2007-07-26
Perl Misc
近两年没怎么用 perl, 忘得差不多了:
- perldoc perlre
- perldoc -f ref
- perldoc -m Socket
- perl -de 0 ARGV ...
- apt-get install zoidberg
- perldoc.perl.org
Posted by
Display Name
-
6:01 PM
0
comments
Labels: Debian/Ubuntu, Perl
2007-07-25
2007-07-24
New screen features
New screen features available
| From: | Michael Schroeder |
| Subject: | New screen features available |
| Date: | Tue, 6 Feb 2007 23:34:31 +0100 |
| User-agent: | Mutt/1.4.2.1i |
Hi Screen Users,
you probably wonder why the new version of screen is not already
available. Well, it got delayed a bit because of a couple of new
features I've added. The development version is available from
GNU savanna:
cvs -z3 -d:pserver:address@hidden:/sources/screen co screen
Here are the new features:
- vertical split, complete with resizing
^A | split vertically
resize [-l] [-h] [-v]
-l : resize is local to slice
-h : resize horizontally
-v : resize vertically
amount: 10 resize to size 10
amount: +10 make 10 bigger
amount: -10 make 10 smaller
amount: 10% make it 10% of all
amount: = make all windows equal
- better resize code using weights
the layout will stay in shape even after heavy resizing
- window groups
currently a bit ugly to create:
screen -t//group
creates a group named
a group is a subset of windows, ^Aw will only display the
current group and next/prev will not leave the group.
Use ^A" to list all windows of the current group (this also
leaves to group, so that next/prev or a second ^A" will
show the other windows.
- layouts
A layout stores the current setup of the display, i.e. all the
slices and the window assignments.
layout save Desktop1
will save the current setup under the name "Desktop1". If you
detach and reattach later on, the layout will automatically
be restored. "Desktop1" will become the current layout.
layout autosave off
This turns the autosafe feature off. Layouts are automatically
saved if autosave is on and the user detachs or switches to
another layout.
layout new Desktop2
Create a new empty layout named "Desktop2".
layout name "foo"
Rename the current layout to "foo".
layout next
layout prev
layout load "name"
Load the next/prev layout / the layout named "name".
layout attach :last
layout attach "name"
Set the layout used when somebody is attaching. Default is ":last",
this is the layout that was current when the last detach was done.
Besides the restoring of the screen on re-attach, layouts can be
used to implement a kind of "virtual desktop" in screen. Say
you put "layout save Desktop1" in your ~/.screenrc. If you
need a new Desktop, do "^A:layout new Desktop2". You can then
use "layout next" to switch between both layouts.
So, feedback welcome. You probably have a lot of suggestions and
enhancement requests. Sorry that development is a bit slow at
the moment due to not enough spare time...
Cheers,
Michael.
Posted by
Display Name
-
10:01 AM
0
comments
Labels: Utils
2007-07-23
Screen available for Cygwin
前天新装 cygwin 时发现 package 列表中有 screen (4.0.3) 了, 喜
screen is now available in Cygwin
| From: | Andrew Schulman |
| Subject: | screen is now available in Cygwin |
| Date: | Fri, 20 Jul 2007 05:09:46 -0400 |
screen 4.0.3 is now available in the Cygwin distribution. Cygwin users can
install it using the setup utility; screen is in the "Utils" category.
Questions or bug reports about screen in Cygwin should be directed to the
Cygwin list, cygwin at cygwin dot com.
Andrew.
Posted by
Display Name
-
9:11 PM
0
comments
2007-07-21
SVN 1000
今日俺的 svn repository 的 revision 增至 1000, 留念 :-)
Posted by
Display Name
-
5:27 PM
0
comments
Labels: Version Control
Dixie Chicks - Not Ready to Make Nice
Forget, I'm not sure I could.
They say time heals everything,
But I'm still waiting
I'm through, with doubt,
There's nothing left for me to figure out,
I've paid a price, and i'll keep paying
I'm not ready to make nice,
I'm not ready to back down,
I'm still mad as hell
And I don't have time
To go round and round and round
It's too late to make it right
I probably wouldn't if I could
Cause I'm mad as hell
Can't bring myself to do what it is
You think I should
I know you said
Why can't you just get over it,
It turned my whole world around
and i kind of like it
I made by bed, and I sleep like a baby,
With no regrets and I don't mind saying,
It's a sad sad story
That a mother will teach her daughter
that she ought to hate a perfect stranger.
And how in the world
Can the words that I said
Send somebody so over the edge
That they'd write me a letter
Saying that I better shut up and sing
Or my life will be over
I'm not ready to make nice,
I'm not ready to back down,
I'm still mad as hell
And I don't have time
To go round and round and round
It's too late to make it right
I probably wouldn't if I could
Cause I'm mad as hell
Can't bring myself to do what it is
You think I should
I'm not ready to make nice,
I'm not ready to back down,
I'm still mad as hell
And I don't have time
To go round and round and round
It's too late to make it right
I probably wouldn't if I could
Cause I'm mad as hell
Can't bring myself to do what it is
You think I should
Forgive, sounds good.
Forget, I'm not sure I could.
They say time heals everything,
But I'm still waiting
Posted by
Display Name
-
2:58 PM
0
comments
Labels: Music
Dixie Chicks - The Long Way Around
Moved into houses in the same ZIP codes
Where their parents live
But I, I could never follow
No I, I could never follow
I hit the highway in a pink RV with stars on the ceiling
Lived like a gypsy
Six strong hands on the steering wheel
I've been a long time gone now
Maybe someday, someday I'm gonna settle down
But I've always found my way somehow
By taking the long way
Taking the long way around
Taking the long way
Taking the long way around
I met the queen of whatever
Drank with the Irish and smoked with the hippies
Moved with the shakers
Wouldn't kiss all the asses that they told me to
No I, I could never follow
No I, I could never follow
It's been two long years now
Since the top of the world came crashing down
And I'm getting' it back on the road now
But I'm taking the long way
Taking the long way around
I'm taking the long way
Taking the long way around
The long
The long way around
Well, I fought with a stranger and I met myself
I opened my mouth and I heard myself
It can get pretty lonely when you show yourself
Guess I could have made it easier on myself
But I, I could never follow
No I, I could never follow
Well, I never seem to do it like anybody else
Maybe someday, someday I'm gonna settle down
If you ever want to find me I can still be found
Taking the long way
Taking the long way around
Taking the long way
Taking the long way around
Posted by
Display Name
-
2:54 PM
0
comments
Labels: Music
2007-07-20
养鸡场的死鸡哪去了
南方周末 2007-07-19 15:38:07
一种畸形养殖模式,导致鸡大批死亡。而当中国人每年吃掉近五十亿只鸡时,我们不得不去关注——
养鸡场的死鸡哪去了
□周思妤 成希 郑焕坚 □本报记者 穆彤 张英 发自北京 上海
广州
■只有比较新鲜的死鸡才会整只出售给商家,用于加工烧鸡、烤鸡;不太新鲜的,会把鸡翅、鸡腿、鸡爪切出来,制成冷冻食品
■吃死鸡并不会感染禽流感,因为高温可以杀死禽流感病毒。但有可能得病的是那些杀鸡、抓鸡的人,禽流感是接触传染的
■“集中营式”养殖,使得这些鸡异常脆弱。一位专家在肉鸡场做调查,竟然还发现了放在地上连路都不会走的鸡!这样的鸡进入食物链,对人体的危害可想而知
当中国人每年吃掉的鸡接近50亿只时,一个问题必须引起高度关注--这种餐桌上必不可少的食物是否安全?
中科院专家调研得出惊人结果
一位资深学者揭开了这个公开的秘密--他叫蒋高明,中国科学院植物研究所首席研究员。2005年7月至今,他与他的课题组在山东、内蒙古、北京等多个省份,展开了一项对“养鸡场死鸡去向”的调查,其结论是:大部分死鸡被端上了餐桌。
“养殖户大都是比较淳朴的农民,他们对死鸡的去向都直言不讳--全部卖给了收死鸡的人。”蒋高明说,“有的鸡农还向我炫耀:一次他拉了三千多只鸡进城,送到批发市场已经死了三百多只。他把这些死鸡直接运到附近的农贸市场卖掉,省了很多成本。”
南方周末记者的调查进一步印证了这个结论。而当记者以鸡贩子的身份致电陕西、湖北、安徽、江苏的十多家养鸡场后,发现小型养鸡场大都出售死鸡。这个交易过程很简单:买者直接过去,看货、给钱,他们负责找个车拉走。
只有拥有10万只鸡以上的大型养殖场拒绝出售死鸡。“这只是表面现象,因为你和他们不熟。”一名死鸡贩子对记者说,“他们不敢拿自己的信誉做赌注。”
“在我们调查的养鸡场中,进入食物链的死鸡超过八成。”蒋高明说。
另一个事实也被揭开:大量死鸡从禽病医院流入了市场。蒋高明发现,医院里的死鸡本是鸡农带来让医生诊断的--这些可能有疫病的家禽,应该做焚烧或掩埋处 理。“但是通过熟人介绍,医院发现死鸡可以卖钱。”蒋高明说,“于是,卖死鸡就成了禽病医院的生意。现在,每天都有专人到医院收购死鸡。”不要小看禽病医 院里的死鸡量,有些养殖户会带半麻袋鸡来看病--他们宁愿多带些样本,让大夫瞧个明白。
它们这样走上餐桌
这些令人作呕的死鸡,养活了一群人。他们清晨四五点钟出门,每天甚至要跑四五百公里的路程,到各个养鸡场收购死鸡。当然,如果把这个生意做大,就可以在家中等货上门。而在每个禽类交易市场,也活跃着专收死鸡的群体。每天,他们像淘宝一样,在各个“档口”以低价进货。
在华南一个禽类批发市场里,记者以业务员的名义认识了鸡贩子陈仔。他只有22岁,但从事禽畜动物批发已经7年,3年前就拥有自己独立的档口。按他的说 法,批发市场中的绝大部分死鸡都被出售,除了极少数高度腐烂的。“每天至少有50万只鸡流入市场,按照5%的最低死亡率,大约2.5万只死鸡被市民吃 掉。”陈仔说。
为证实上述观点,这个批发商带记者在多个禽类市场进行了考察。死鸡都被装进编织袋,扔在每个档口的臭水沟里,皮毛不整、异味扑鼻。它们也被明码标价,并随着市场行情上下浮动。比如竹丝鸡目前每只3元,清远鸡每只9元。
无论是去养殖场取货,还是在禽类批发市场收购,死鸡都有一个“再分解”的加工过程。在河北的一个死鸡加工点,本报记者曾亲眼目睹这一系列肮脏的工序-- 首先是用热水甚至沥青烫,再放入褪毛机,最后放在水中浸泡,以去除其身上的淤血。一般人是无法忍受工作的“艰辛”的--在现场,一个刚来不久的小工突然呕 吐不止。
只有比较新鲜的死鸡才会整只出售给商家,用于加工烧鸡、烤鸡;不太新鲜的,会把鸡翅、鸡腿、鸡爪切出来,制成冷冻食品。“冷冻食品都 不新鲜,很难看出哪是病死鸡哪是健康鸡,所以容易掩人耳目。”一位业内人士说。另外,死鸡的内脏--比如说鸡胗,大多流向烧烤摊位;而腐烂比较严重的鸡, 还能制成火腿肠。值得注意的是,有些饭店的“乳鸽”,或者那些油炸“麻雀”,其实就是剥过皮的小死鸡。
此间的产业链已非常成熟。在下游,有专门要内脏的商贩,有专取白条鸡的商贩,还有加工熟食的。其终端就是饭店、熟食店、烧烤摊甚至超级市场,死鸡由此进入人们的餐桌。
流通背后的利益链
某禽病中心医生称,他正准备享受“美味”烧鸡时,被吓出了一身汗。眼前的食品是由“包心包肝”的鸡做成的--所谓“包心包肝”,是指鸡死于大肠杆菌感染 后,心脏或肝脏外会形成厚约1毫米的蛋白分泌物,呈黄白色。烧鸡店老板没有将此分泌物处理干净,就做了烧鸡。“专业人员可以吃出死鸡来,普通人怎么吃得 出?”一位禽类专家说。
但黑心商人不会在乎这些,对于他们,利润才是第一位的。有位老板给暗访的央视记者算过一笔账:“收一只死鸡平均2元钱。加工成烧鸡半成品重约1公斤,按批发价是一斤4.5元,每只鸡能挣6-7元。如果一天做300只,就收入2000元左右。”
“对养殖户来说,也是因为回收成本心情急切让他们不顾食物安全。”蒋高明说,“在政府方面,只有禽流感死亡的鸡才给养殖户补偿,虽然大部分地区规定了每 只补助10元,但是农民要拿到是很困难的。这也并非政府的完全不作为--一个五六万人的乡镇,有30-40个大型养殖场,活鸡两三百万,但政府工作人员只 有三五个人。怎么管理呢?”
有关部门的不作为,助长了死鸡的流通。“卫生标准往往是摆在那里应付检查的。”一位养殖户说,“养殖场里难闻的气味,令检查的官员避之惟恐不及,很多时候在外面转转就交差了。”
这种情况同样出现在禽类批发市场。广州一个鸡贩子说,禽流感严重的时候,市场加大了监管力度,派出专人每天去各个档口收集死亡的禽畜,买卖死禽被严惩。但禽流感一过,有关部门睁一只眼闭一只眼,商户出售死鸡也越来越明目张胆。
死鸡伤人有多深?
尽管这些死鸡让人很反感,但可以肯定的是,煮熟的它们不会传播禽流感。接受南方周末记者采访时,中国工程院院士、中国疾病预防控制中心专家陈君石解释:“高温可以杀死禽流感病毒。但有可能得病的是那些杀鸡、抓鸡的人,禽流感是接触传染的。”
“但动物死后,尸体的腐烂会很快开始,过程会产生对人体有害的物质。”中国健康教育协会副会长、复旦大学教授李枫说,“何况死鸡往往是病鸡,带有各种传染性病菌。加工者为了掩盖死鸡的异味,往往又加了过多的添加剂,这对人体的危害更大。”
一般情况下,鸡的死因有两种:传染病死亡和非传染病死亡--比如药物中毒、天气过热、环境污染、打斗致死等。南方周末记者根据多方调查总结,目前,大部分养鸡场的死亡率为5%-10%。“这是一个不正常的数字。”蒋高明说。
据蒋高明调查,很多养殖户为了让鸡少患病,将磺胺类药物掺入它们的食物中,甚至使用禁用药物喹乙醇。“工厂化养殖的鸡,每天吃着大量的添加剂、安眠药、 抗生素和激素,养殖者把它们的生命周期由200多天缩短到40天左右。”蒋高明说,“这样不科学的喂养,怎能不提高鸡的死亡率?”
同时被这位研究者严厉指责的,还有“集中营”式的养殖方式。在天津、北京等北方城市,本报记者曾亲眼目睹这种方式--至少七八十只鸡一直挤在1平方米的狭小空间里,身体都转不过来。惟一可以享受自由的,是它们探出笼子的头。
“严重违背生物学规律的养殖,使得这些鸡异常脆弱,放个鞭炮都能被吓死。”蒋高明说,“集约化养殖的鸡,不会飞已不是什么令人大惊小怪的事了。但是我这次在肉鸡场的调查,竟然还发现了放在地上连路都不会走的鸡!”
而这样的鸡进入食物链,无论是否死亡的,对人体的危害可想而知。即使这些鸡粪做成的肥料,都会因为重金属含量超标而产生危害。
在某些养鸡已经形成产业的地方,村民间已经形成了一条不成文的规矩:如果哪家人办喜事招待客人,图便宜买了肉鸡,就会让乡亲们笑话,从此抬不起头来。所以,即使最穷的人都要花高价买散养的柴鸡下厨。
更令一些生物专家担忧的是,这种严重违背生物学的养殖方式,已经扩大到了鸭和鹅。后者的出笼时间也是40天左右,甚至连它们戏水的基本权利都被剥夺了。
“很多食品安全问题不是突发性的--不是说,人一吃了就会马上发病。”一位消费者说,“而这种在畸形环境里成长起来的鸡,就可能给人体带来长期的威胁。”
为改变这种畸形养殖模式,蒋高明及著名学者温铁军等人提议:将“集中营”式的养殖转变为自由散养,利用广阔的草原、林下空地等生态空间,把鸡解放出牢 笼,还原其150-200天的“长大成鸡”周期。这被他们总结为“畜南下,禽北上”。这也是身为植物生态学家的蒋高明等人为什么开展死鸡调查的起因。
(有关中国法律禁止销售死鸡的规定,参见本报网站www.infzm.com)
Posted by
Anonymous
-
10:21 PM
0
comments
Labels: Misc
Dixie Chicks - Taking The Long Way
Dixie Chicks《Taking The Long Way》
http://www.sina.com.cn 2006年06月20日15:52 新浪娱乐

专辑名:《Taking The Long Way》
演唱者:Dixie Chicks
发行时间:2006年5月23日
发行公司:Sony
音乐风格:Neo-Traditionalist Country(新传统主义乡村),Pop/Rock(流行/摇滚)
| [曲目介绍] |
1. The Long Way Around
2. Easy Silence
3. Not Ready To Make Nice(推荐单曲)
4. Everybody Knows(推荐单曲)
5. Bitter End
6. Lullaby
7. Lubbock Or Leave It
8. Silent House
9. Favorite Year(推荐单曲)
10. Voice Inside My Head(推荐单曲)
11. I Like It
12. Baby Hold On
13. So Hard
14. I Hope
| [唱片点评] |
在将近四年之后,美国最受欢迎的当代乡村组合南方小鸡(Dixie Chicks)终于推出了她们最新的录音室专辑《Taking The Long Way》。这张《Taking The Long Way》在发行首周的单周销量达到52万6千张,力压同样由里克·鲁宾(Rick Rubin)制作的红辣椒乐队(Red Hot Chili Peppers)的最新双张专辑《Stadium Arcadium》,如愿登顶本周的Billboard 200专辑榜,成为Dixie Chicks第三张在Billboard 200专辑榜中折桂的专辑。Dixie Chicks此前两张冠军专辑分别是1999年发行的《Fly》和2002年发行的《Home》,而上张专辑《Home》在发行首周的销量更高,达到了 78万张。
在这张专辑中,Rick Rubin不仅担当制作人,而且还为Dixie Chicks召集来了Red Hot Chili Peppers乐队的鼓手查德·史密斯(Chad Smith),为汤姆·佩蒂(Tom Petty)伴奏的“伤心者”乐队(Heartbreakers)的键盘手本蒙特·坦奇(Benmont Tench)和吉他手麦克·坎贝尔(Mike Campbell)等实力不俗的乐手为Dixie Chicks的三位女将助阵。另外,在专辑歌曲的创作名单中,还包括了著名民谣摇滚女歌手雪儿·克洛(Sheryl Crow),当代布鲁斯吉他手Keb' Mo'以及另类乡村摇滚乐队The Jayhawks的成员加里·罗里斯(Gary Louris)等创作高手。更多新鲜血液的注入使Dixie Chicks这张专辑显得更加的丰润,《Not Ready To Make Nice》,《Everybody Knows》,有Sheryl Crow参与创作的《Favorite Year》以及《Voice Inside My Head》都是十分有Dixie Chicks特点的优秀单曲。而从歌词上来看,Dixie Chicks这三位女将也是非常值得钦佩的,面对各种威胁恐吓丝毫没有任何妥协,依然光明磊落,兢兢业业的做着她们自己的音乐。
从各方面来说,这张《Taking The Long Way》都丝毫不比四年前大卖的专辑《Home》逊色。相反,Dixie Chicks用实力证明了她们与Rick Rubin以及各界创作精英的合作是相当成功的。尽管已经四年没有新作问世,但Dixie Chicks用这张歌迷们已经期盼已久的专辑证明了她们仍是当今美国最有实力的乡村组合之一。KFC MAN/文
| [歌手介绍] |

Dixie Chicks这个名字最早来源于美国布鲁斯摇滚乐队Little Feat的歌曲《Dixie Chickens》。直到上世纪90年代末,Dixie Chicks才在美国主流乡村音乐界大红大紫。但早在1989年,Dixie Chicks组合就已经在达拉斯成立,最初组建Dixie Chicks的四位成员分别是:小提琴手马蒂·塞德尔(Martie Seidel)和他弹班卓琴的姐妹埃米丽·艾尔文(Emily Erwin),贝斯手劳拉·林奇(Laura Lynch)和吉他手罗宾·林恩·梅西(Robin Lynn Macy)。乐队最初也只是能够在街角以及当地的小酒吧演出,但随着Martie Seidel在美国小提琴大赛中获得季军,Dixie Chicks组合的事业也开始有了明显的好转。Dixie Chicks逐渐确定了自己将传统乡村音乐,民谣以及兰草等多种音乐融为一体的独特风格。1990年,Dixie Chicks独立发行了她们的首张专辑《Thank Heavens for Dale Evans》。
1992,在《Little Ol' Cowgirl》发行之后,Robin Lynn Macy宣布离队,而Laura Lynch开始担任主唱。1993年,Dixie Chicks首次以三人阵容发行了专辑《Shouldn't a Told You That》。1995年,在Dixie Chicks与Sony新设立的厂牌Monument签约后不久,Laura Lynch也离开了Dixie Chicks。之后,曾有媒体报道Robin Lynn Macy以及Laura Lynch的离队都是由于年龄问题。在Laura Lynch退出后不久,乡村吉他大师Lloyd Maines 21岁的女儿Natalie Maines成为了Dixie Chicks的新任主唱。
拥有了新阵容的Dixie Chicks将传统的乡村音乐做的愈加的流行化。正如媒体预言,Dixie Chicks组合1998年在大厂牌Monument发行的首张专辑《Wide Open Spaces》获得了巨大的成功,不仅获得了当年Billboard乡村专辑榜的冠军,而且在Billboard 200专辑榜中也取得第四名的好成绩。专辑中首支单曲《I Can Love You Better》成为Dixie Chicks第一支打入排行榜前十名的单曲,而《There's Your Trouble》以及同名单曲《Wide Open Spaces》都在乡村单曲榜中成功问鼎。在《Wide Open Spaces》专辑发行后的一年之内,专辑在美国的总销量达到四白金,Dixie Chicks一跃成为美国最受人瞩目的乡村组合之一,她们不仅获得美国乡村音乐协会评出的最佳组合以及Horizon奖两项大奖,而且在当年的美国音乐奖 的角逐中还被评为“歌迷最喜爱的乡村新人”。Dixie Chicks也凭借这张叫好又叫座的专辑获得1998年第41届格莱美奖的“最佳乡村组合”以及“最佳乡村专辑”两项大奖。
1999年8月,Dixie Chicks再接再厉,发行了加盟Monument之后的第二张专辑《Fly》。专辑中首支单曲《Ready to Run》以及之后的《Goodbye Earl》在乡村单曲榜中的表现很快就十分抢眼,而《Fly》也成为Dixie Chicks首张在Billboard 200专辑榜中夺冠的专辑。Dixie Chicks凭借这张《Fly》再度获得格莱美最佳乡村专辑奖。
2002年5月,Dixie Chicks和莎奇拉(Shakira),马丽·J·布里奇(Mary J. Blige),雪儿(Cher)和席琳·迪翁(Celine Dion)一起参加了VH1台在拉斯维加斯举办的Divas Show。仅仅三个月之后,Dixie Chicks发行了她们的第六张专辑《Home》。《Home》是Dixie Chicks组合在她们自己的厂牌Open Wide发行的第一张专辑,也是Dixie Chicks的第二张冠军专辑。在2002年第45届格莱美奖中,Dixie Chicks再次捧得三项大奖。2003年11月,Dixie Chicks发行了她们首张现场专辑《Top of the World Tour: Live》。2004年,Dixie Chicks依靠这张现场专辑得到了她们第八座格莱美奖杯。
2006年5月23日,Dixie Chicks的最新录音室专辑《Taking The Long Way》面世。专辑在美国发行首周共售出52万6千张,成为Dixie Chicks第三张在Billboard 200专辑榜中登顶的专辑。KFC MAN/文
Posted by
Display Name
-
12:33 PM
0
comments
Labels: Music
2007-07-18
2007-07-11
Bash on Debian/Ubuntu does not support using the /dev/tcp and /dev/udp files
$ cat < /dev/tcp/localhost/daytime
bash: /dev/tcp/localhost/daytime: No such file or directory
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=6.06
DISTRIB_CODENAME=dapper
DISTRIB_DESCRIPTION="Ubuntu 6.06.1 LTS"
$
Posted by
Display Name
-
10:19 AM
0
comments
Labels: Debian/Ubuntu, Shell/Scripting
[Mac OS X] Deleting users with dscl
Deleting Mac OS X users remotely with dscl
I had occasion recently to need to remotely delete a user — let’s call him “George” — on a Mac OS X box that is running the Client version of Tiger. I have ssh access to that machine and, since I keep meaning to learn how to do it, I decided to take the time to make a few notes on the process for the next such occasion.
What I needed to do was, first, remove him from any groups he was in and then delete his account. On OS X, this is usually handled by the NetInfo database, so I needed a way to manipulate it without using the GUI /Applications/Utilities/NetInfo Manager that I’d probably use were I physically sitting at the machine.
The command I’ll use is /usr/bin/dscl — the Directory Service command line utility. If you’re familiar with CLI utilities, the syntax of dscl won’t be problematic for you. It is a truly powerful program, bringing pretty much anything involved with NetInfo under your control. This is a good thing, but it is also dangerous. Which brings us to this warning:
Do not start doing this if you don’t know what you’re doing or are disconcerted by the idea of telling your computer what to do by typing. You can damage your system, not to mention possibly leaving you unable to have children. ¡Cuidado!
Before you make any changes to NetInfo, you should back its database up. That Apple article has a couple of methods. Use one of them. For the children.
With that out of the way, let’s talk about NetInfo domains. Assuming you didn’t RTFA at the link above, the basic idea is that there is a hierarchical database that handles all the user and group data (just to mention a couple of things) for Mac systems. NetInfo has been around since the NeXT days.
The NetInfo hierarchy starts with what it calls Domains. (This is a mite confusing at first since it doesn’t refer to Internet domain names.) Under each Domain there are Directories, and they can have Properties with accompanying Values, as well as contain other Directories. We’ll cover these ideas in practice as we go along.
Here’s an applicable example: like every Mac, my remote server has a /users directory under the local domain.
It’s important to differentiate here that this is not referring to the /Users folder in the filesystem where a user’s home folder usually is. This can be somewhat bewildering for NetInfo neophytes.
Now, inside the NetInfo /users Directory are a bunch of other Directories corresponding to all the users on the machine — human accounts (like my own and the one I’ll be deleting), but also system “users” like daemon, mysql, nobody, root, and www. In fact, here’s a command to give us a list of all the users on the machine:
dscl . list /users
Breaking it down: there’s dscl, a period “.” representing the local machine, the list command, and then the directory we want a listing of. This is also the basic syntax we’ll be dealing with throughout our exercise.
So, I run that on my remote machine and get a long list of users, including the about-to-be-deleted George. To see what NetInfo has to say about good old Georgie:
dscl . read /users/george
Pretty much the same idea as before, except we’re using the read command rather than list. Using the Finder as an analogy, list is like viewing a list of text files in a folder, and read is like viewing the contents of one of those files.
Here’s some (though not all) of what I got in response to my read request:
AppleMetaNodeLocation: /NetInfo/DefaultLocalNode
AuthenticationAuthority: ;ShadowHash;
NFSHomeDirectory: /Users/george
Password: *
PrimaryGroupID: 530
RealName: George Costanza
RecordName: george
UniqueID: 530
This can get overwhelming with all kinds of unfamiliar text flying by, so it can be useful to focus in on one value, e.g. where their home folder is. We find that out by examining NFSHomeDirectory, which is a users Property. Other such Properties include PrimaryGroupID, RealName, UniqueID, and the rest of /users/george.
Much like a variable in algebra, a Property has a corresponding Value. To ask for George’s home directory only, we use:
dscl . read /users/george NFSHomeDirectory
Which returns this line:
NFSHomeDirectory: /Users/george
So, for the Property NFSHomeDirectory the Value is /Users/george
Again, to keep it straight, that’s the /Users/george home folder in the Finder.
Now I have George in my sights, and I’m almost ready to get rid of him. But first, let’s deal with the groups he’s a member of. Similarly to getting a list of users on the local machine, we can do the same thing for groups:
dscl . list /groups
Long list there, but it includes the two groups I need to deal with. I happen to know that George is in only two groups: handmodels and george (a user is by default a member of a group with the same name).
Just for our edification, let’s get a list of the users in handmodels. We can do this by zeroing in on one Property like we did above, GroupMembership:
dscl . read /groups/handmodels GroupMembership
This returns:
GroupMembership: grady mia ramon mike george
A-ha! There he is, along with a few other folks. To kick him out of there, I’ll need to use sudo because you need admin access to make this kind of change to the database:
sudo dscl . delete /groups/handmodels GroupMembership george
A password prompt appears. Enter the admin password, hit Return, and George is gone from handmodels. Let’s just make sure:
dscl . read /groups/handmodels GroupMembership
And we get back:
GroupMembership: grady mia ramon mike
If George were HAL, he would be feeling his mind going right about now.
Getting rid of the george group is handled a bit differently since it’s a whole Directory and not the Value of a Property. To delete his group completely:
sudo dscl . delete /groups/george
And that’s it for George’s groups. George/HAL is singing “Bicycle Built For Two.”
For safety’s sake, please note the similarity between this last command and the one above that deleted his name from handmodels. Imagine how easy it could be to really screw things up by deleting something accidentally. Have you backed up lately?
Finally, we’re ready to delete George himself. The syntax is much the same as the last command:
sudo dscl . delete /users/george
Poof! George has ceased to be. He has expired and gone to meet his maker. He is an ex-user.
Now all that’s left is to remove the vestiges of George scattered around the filesystem, starting with his home folder /Users/george. Just to play it safe, you might want to archive George’s stuff. You know, if he happens to re-enter your good graces.
Maybe when you’re feeling magnanimous around Festivus time. ;)
Comments
Posted by
Display Name
-
9:36 AM
0
comments
Labels: Apple, Shell/Scripting
2007-07-10
[Mac OS X] User Template
Linux 系统里有个 /etc/skel 目录, Mac OS X 上对应的目录为 /System/Library/User Template
Posted by
Display Name
-
8:45 PM
0
comments
[Mac OS X] Adding a User From the Command Line
Adding a User From the Command Line
This section shows a simple example of using the Directory Service command-line tool, dscl(1), to add a user to the system. The example specifies some of the properties that you would normally associate with any user.
Note: These commands must be run as the root user. If you are executing them from the command line manually, you should do this with sudo(8). If you are using them in a script, you should use sudo when running the script.
Create a new entry in the local (
/) domain under the category/users.dscl / -create /Users/portingunixCreate and set the shell property to
bash.dscl / -create /Users/portingunix UserShell /bin/bashCreate and set the user’s full name.
dscl / -create /Users/portingunix RealName "Porting Unix Applications To Mac OS X"Create and set the user’s ID.
dscl / -create /Users/portingunix UniqueID 503Create and set the user’s group ID property.
dscl / -create /Users/portingunix PrimaryGroupID 1000Create and set the user home directory. (Despite the name
NFSHomeDirectory, this is the local path to the home directory.)dscl / -create /Users/portingunix NFSHomeDirectory /Local/Users/portingunixSet the password.
dscl / -passwd /Users/portingunix PASSWORDor
passwd portingunixTo make that user useful, you might want to add them to the admin group.
dscl / -append /Groups/admin GroupMembership portingunix
This is essentially what System Preferences does when it makes a new user, but the process is presented here so you can see more clearly what is going on behind the scenes with the NetInfo database. A look through the hierarchies in the NetInfo Manager application also helps you understand how the database is organized.
Posted by
Display Name
-
8:42 PM
0
comments
Labels: Apple, Shell/Scripting
2007-07-09
svn+ssh configuration
Tunneling over SSH
svnserve's built-in authentication can be very handy, because it avoids the need to create real system accounts. On the other hand, some administrators already have well-established SSH authentication frameworks in place. In these situations, all of the project's users already have system accounts and the ability to “SSH into” the server machine.
It's easy to use SSH in conjunction with svnserve. The client simply uses the svn+ssh:// URL schema to connect:
$ whoami
harry
$ svn list svn+ssh://host.example.com/repos/project
harry@host.example.com's password: *****
foo
bar
baz
…
In this example, the Subversion client is invoking a local ssh process, connecting to host.example.com, authenticating as the user harry, then spawning a private svnserve process on the remote machine running as the user harry. The svnserve command is being invoked in tunnel mode (-t) and its network protocol is being “tunneled” over the encrypted connection by ssh, the tunnel-agent. svnserve is aware that it's running as the user harry, and if the client performs a commit, the authenticated username will be attributed as the author of the new revision.
The important thing to understand here is that the Subversion client is not connecting to a running svnserve daemon. This method of access doesn't require a daemon, nor does it notice one if present. It relies wholly on the ability of ssh to spawn a temporary svnserve process, which then terminates when the network connection is closed.
When using svn+ssh:// URLs to access a repository, remember that it's the ssh program prompting for authentication, and not the svn client program. That means there's no automatic password caching going on (see the section called “Client Credentials Caching”). The Subversion client often makes multiple connections to the repository, though users don't normally notice this due to the password caching feature. When using svn+ssh:// URLs, however, users may be annoyed by ssh repeatedly asking for a password for every outbound connection. The solution is to use a separate SSH password-caching tool like ssh-agent on a Unix-like system, or pageant on Windows.
When running over a tunnel, authorization is primarily controlled by operating system permissions to the repository's database files; it's very much the same as if Harry were accessing the repository directly via a file:// URL. If multiple system users are going to be accessing the repository directly, you may want to place them into a common group, and you'll need to be careful about umasks. (Be sure to read the section called “Supporting Multiple Repository Access Methods”.) But even in the case of tunneling, the svnserve.conf file can still be used to block access, by simply setting auth-access = read or auth-access = none. [43]
You'd think that the story of SSH tunneling would end here, but it doesn't. Subversion allows you to create custom tunnel behaviors in your run-time config file (see the section called “Runtime Configuration Area”). For example, suppose you want to use RSH instead of SSH. In the [tunnels] section of your config file, simply define it like this:
[tunnels]
rsh = rsh
And now, you can use this new tunnel definition by using a URL schema that matches the name of your new variable: svn+rsh://host/path. When using the new URL schema, the Subversion client will actually be running the command rsh host svnserve -t behind the scenes. If you include a username in the URL (for example, svn+rsh://username@host/path) the client will also include that in its command (rsh username@host svnserve -t). But you can define new tunneling schemes to be much more clever than that:
[tunnels]
joessh = $JOESSH /opt/alternate/ssh -p 29934
This example demonstrates a couple of things. First, it shows how to make the Subversion client launch a very specific tunneling binary (the one located at /opt/alternate/ssh) with specific options. In this case, accessing a svn+joessh:// URL would invoke the particular SSH binary with -p 29934 as arguments—useful if you want the tunnel program to connect to a non-standard port.
Second, it shows how to define a custom environment variable that can override the name of the tunneling program. Setting the SVN_SSH environment variable is a convenient way to override the default SSH tunnel agent. But if you need to have several different overrides for different servers, each perhaps contacting a different port or passing a different set of options to SSH, you can use the mechanism demonstrated in this example. Now if we were to set the JOESSH environment variable, its value would override the entire value of the tunnel variable—$JOESSH would be executed instead of /opt/alternate/ssh -p 29934.
SSH configuration tricks
It's not only possible to control the way in which the client invokes ssh, but also to control the behavior of sshd on your server machine. In this section, we'll show how to control the exact svnserve command executed by sshd, as well as how to have multiple users share a single system account.
Initial setup
To begin, locate the home directory of the account you'll be using to launch svnserve. Make sure the account has an SSH public/private keypair installed, and that the user can log in via public-key authentication. Password authentication will not work, since all of the following SSH tricks revolve around using the SSH authorized_keys file.
If it doesn't already exist, create the authorized_keys file (on Unix, typically ~/.ssh/authorized_keys). Each line in this file describes a public key that is allowed to connect. The lines are typically of the form:
ssh-dsa AAAABtce9euch… user@example.com
The first field describes the type of key, the second field is the uuencoded key itself, and the third field is a comment. However, it's a lesser known fact that the entire line can be preceded by a command field:
command="program" ssh-dsa AAAABtce9euch… user@example.com
When the command field is set, the SSH daemon will run the named program instead of the typical svnserve -t invocation that the Subversion client asks for. This opens the door to a number of server-side tricks. In the following examples, we abbreviate the lines of the file as:
command="program" TYPE KEY COMMENT
Controlling the invoked command
Because we can specify the executed server-side command, it's easy to name a specific svnserve binary to run and to pass it extra arguments:
command="/path/to/svnserve -t -r /virtual/root" TYPE KEY COMMENT
In this example, /path/to/svnserve might be a custom wrapper script around svnserve which sets the umask (see the section called “Supporting Multiple Repository Access Methods”). It also shows how to anchor svnserve in a virtual root directory, just as one often does when running svnserve as a daemon process. This might be done either to restrict access to parts of the system, or simply to relieve the user of having to type an absolute path in the svn+ssh:// URL.
It's also possible to have multiple users share a single account. Instead of creating a separate system account for each user, generate a public/private keypair for each person. Then place each public key into the authorized_users file, one per line, and use the --tunnel-user option:
command="svnserve -t --tunnel-user=harry" TYPE1 KEY1 harry@example.com
command="svnserve -t --tunnel-user=sally" TYPE2 KEY2 sally@example.com
This example allows both Harry and Sally to connect to the same account via public-key authentication. Each of them has a custom command that will be executed; the --tunnel-user option tells svnserve -t to assume that the named argument is the authenticated user. Without --tunnel-user, it would appear as though all commits were coming from the one shared system account.
A final word of caution: giving a user access to the server via public-key in a shared account might still allow other forms of SSH access, even if you've set the command value in authorized_keys. For example, the user may still get shell access through SSH, or be able to perform X11 or general port-forwarding through your server. To give the user as little permission as possible, you may want to specify a number of restrictive options immediately after the command:
command="svnserve -t --tunnel-user=harry",no-port-forwarding,\
no-agent-forwarding,no-X11-forwarding,no-pty \
TYPE1 KEY1 harry@example.com
Posted by
Display Name
-
8:21 PM
0
comments
Labels: Version Control
svn+ssh does not support non-standard port
目前 svn+ssh://user@server/path 不能指定 ssh 的 port, 已经有人发了 bug.
Posted by
Display Name
-
8:08 PM
0
comments
Labels: Version Control
[转] PuTTY 中文教程
http://blog.chinaunix.net/u/553/showart.php?id=335551
http://docs.google.com/View?docid=ajbgz6fp3pjh_2dwwwwt
Posted by
Display Name
-
9:48 AM
0
comments
Labels: Utils

Nice review - but what about the OTHER groups which George may be a member of? You state "I happen to know that George is in only two groups: handmodels and george" - but what if George was an administrative user? In this case, he would also be a member of the "admin", "appserveradm" and "appserverusr" groups.
Any suggestions on how to scan ALL potential locations for a given shortname entry, to ensure you catch them all?
Try this :
dscl . -list /groups GroupMembership
It will give you all the groups with their members in a second column, you can then try to grep...
There is something I'd like to add, don't forget to delete the password files in /var/db/shadow/hash
% id -G -n george
Take a look at
http://www.ubergeeks.com/~jmalone/software/
Mac OS X command line user tools
These are wrapper scripts around the netinfo commands that mimic the useradd, userdel, groupadd, groupdel commands of other *nix operating systems. Still under development, but quite useful here where I work.
PLEASE let me know about any bugs/improvements you find/think of.
* niuseradd
* niuserdel
* nigroupadd
* nigroupdel