寻觅生命中的那一片浅草......

每日存档 十月 14th, 2009

“不许联想”mp3player.xml处理

<?xml version=”1.0″ encoding=”UTF-8″?>
<player showDisplay=”yes” showPlaylist=”yes” autoStart=”no”> <song path=”http://music.u148.net/Kris_Kristofferson-holy_woman.mp3″ title=”Kris_Kristofferson-holy_woman” /> <song path=”http://music.u148.net/public_image_ltd-disappointed.mp3″ title=”public_image_ltd-disappointed” /> <song path=”http://music.u148.net/Muse-Uprising.mp3″ title=”Muse-Uprising” /> <song path=”http://music.u148.net/Orla_Fallon-She_Moved_Thro_the_Fair.mp3″ title=”Orla_Fallon-She_Moved_Thro_the_Fair” /> <song path=”http://music.u148.net/damon_and_naomi-E.T.A.mp3″ title=”damon_and_naomi-E.T.A.” /> <song path=”http://music.u148.net/England_Dan_And_John_Ford_Coley-Who_s_Lonely_Now.mp3″ title=”England_Dan_And_John_Ford_Coley-Who_s_Lonely_Now” /> <song path=”http://music.u148.net/the_avett_brothers-will_you_return.mp3″ title=”the_avett_brothers-will_you_return” /> <song path=”http://music.u148.net/richard_hawley-ashes_on_the_fire.mp3″ title=”richard_hawley-ashes_on_the_fire” /> <song path=”http://music.u148.net/avion_travel-abbassando.mp3″ title=”avion_travel-abbassando” /> <song path=”http://music.u148.net/Elisabeth_Kontomanou-I_gotta_right_to_sing_the_blues.mp3″ title=”Elisabeth_Kontomanou-I_gotta_right_to_sing_the_blues” /> <song path=”http://music.u148.net/Matthew_Barber-Easily_bruised.mp3″ title=”Matthew_Barber-Easily_bruised” /> <song path=”http://music.u148.net/Pearl_Jam-Just_Breathe.mp3″ title=”Pearl_Jam-Just_Breathe” /> <song path=”http://music.u148.net/Hope_Sandoval_&_The_Warm_Inventions-Wild_Roses.mp3″ title=”Hope_Sandoval_&_The_Warm_Inventions-Wild_Roses” /> <song path=”http://music.u148.net/u2-ill_go_crazy_if_i_dont_go_crazy_tonight.mp3″ title=”u2-ill_go_crazy_if_i_dont_go_crazy_tonight” /> <song path=”http://music.u148.net/Monsters_Of_Folk-Say_Please.mp3″ title=”Monsters_Of_Folk-Say_Please” /> <song path=”http://music.u148.net/Andres_Cepeda-Faltarán.mp3″ title=”Andres_Cepeda-Faltarán” /> <song path=”http://music.u148.net/Mark_Mulcahy-Be_Sure.mp3″ title=”Mark_Mulcahy-Be_Sure” /> <song path=”http://music.u148.net/Brett_Dennen-San Francisco.mp3″ title=”Brett_Dennen-San Francisco” /> <song path=”http://music.u148.net/Hnir_Pan-Piyka.mp3″ title=”Hnir_Pan-Piyka” /> <song path=”http://music.u148.net/KAYAH-EMBARCACAO.mp3″ title=”KAYAH-EMBARCACAO” /> <song path=”http://music.u148.net/Mosh_Ben_Ari-Bein_hazlilim.mp3″ title=”Mosh_Ben_Ari-Bein_hazlilim” /> <song path=”http://music.u148.net/the_black_crowes-appaloosa.mp3″ title=”the_black_crowes-appaloosa” /></player>

今天想去下载王小峰博客上的音乐,像往常一样,把http://www.wangxiaofeng.net/mp3player.xml拉回来,发现格式都乱了,像以上,只有2行(<player ×××>到</player>为一行)。
想过将http与mp3之间的内容提取出来,但不知道如何入手,最后想出先将它分行,再提出mp3地址

sed “s/<song/\n\r<song/g” mp3player.xml |cut -d\” -f2

输出,有首歌的歌名不是英文,乱码了,Mark_Mulcahy-Be_Sure.mp3

















http://music.u148.net/Brett_Dennen-San Francisco.mp3


注意,如果是vi mp3player.xml,替换时,换行符则只有\r,而用sed时则是\n\r
:s/<song/\r<song/g

Windows下用Notepad++打开正则表达式进行替换,换行符是\n

单命令用

grep -oP ‘(?<=song path=”)[^”]*(?=” title=)’ mp3player.xml

更简单的

grep -o ‘http[^”]*\.mp3’ mp3player.xml

xenserver license

1.使用XenCenter工具,连接至Server,Tool–>License Manager–>选择要更新License的服务器,点击Activate….按钮.如果,此服务器可以直接连接到外网,将可以直接获取LIC文件安装,如果不能连接至外网,将会出现更新失败提示,并提示保存申请License文件.选择将申请文件保存.
2.访问:https://activate.vmd.citrix.com, upload申请文件.
3.填写相关信息,主要是MAIL地址,用来接收License 文件.提交.
4.打开邮箱下载License文件.
5.使用Winscp工具将License文件复制到XenServer的/etc/xensource/下,并重新命名为license.
6.重新启动XenServer.
7.License更新完成,可以正常使用.

关于Citrix公司的XenServer免费使用,个人理解,虽然为免费版本,但为了方便管理, 以及获取用户的相关信息,Citrix采用了Free License管理的模式,在到期后,用户只需要再次重复申请新的License文件并进行License安装即可.不会影响XenServer的正常使 用.但是,Citrix公司并未发表声明永久性提供免费使用,至少我没有找到.特别在正式的生产环境,还是建议大家购买正式的服务,以提供更高的性能以及安全的合法的保障.

转载自:http://hi.baidu.com/ts%B4%F3%D1%BC%C0%E6/blog/item/c58976fb885250809f514653%2Ehtml

2009年十月
« 9月   11月 »
 1234
567891011
12131415161718
19202122232425
262728293031