====[[[[宾克斯的酒]]]]====
演绎版本 哟霍霍霍霍 哟霍霍霍霍 送你杯,宾克斯的酒 离港口,莫回呀头 啦...啦... 送你杯,宾克斯的酒 雷电怒,风雨急 哟霍霍霍霍 哟霍霍霍霍 | 直译版本 哟霍霍霍 哟霍霍霍 X4 我给你送去,宾客斯的酒 再见了港口,纺织品之乡 - - 我给你送去,宾客斯的酒 暴风雨来了,海荒千里 哟霍霍霍,哟霍霍霍 x4 我给你送去,宾客斯的酒 我给你送去,宾客斯的酒 |
West is just another place, not another way to live. A man has to know what he wants.
====[[[[宾克斯的酒]]]]====
演绎版本 哟霍霍霍霍 哟霍霍霍霍 送你杯,宾克斯的酒 离港口,莫回呀头 啦...啦... 送你杯,宾克斯的酒 雷电怒,风雨急 哟霍霍霍霍 哟霍霍霍霍 | 直译版本 哟霍霍霍 哟霍霍霍 X4 我给你送去,宾客斯的酒 再见了港口,纺织品之乡 - - 我给你送去,宾客斯的酒 暴风雨来了,海荒千里 哟霍霍霍,哟霍霍霍 x4 我给你送去,宾客斯的酒 我给你送去,宾客斯的酒 |
pdftex -ini -fmt=pdflatex.fmt latex.ltx
./configure --prefix=/home/cps536-n1.07/elisp # install package
--with-lispdir=/home/cps536-n1.07/elisp # install auctex.el
--with-texmf-dir=/home/cps536-n1.07/texmf-local/ # put config in texmf
make; make install
cd $Linux-kernel-dir;Useful hot keys:
find include/linux/ fs/ init/ ipc/ kernel/ lib/ mm/ net/ arch/i386/ -type f -iregex .*\.[csh] -exec etags -a '{}' -o kernel-TAGS \;
- M-. tag
- Find first definition of tag (
find-tag).- C-u M-.
- Find next alternate definition of last tag specified.
- C-u - M-.
- Go back to previous tag found.
- C-M-. pattern
- Find a tag whose name matches pattern (
find-tag-regexp).- C-u C-M-.
- Find the next tag whose name matches the last pattern used.
- C-x 4 . tag
- Find first definition of tag, but display it in another window
- (
find-tag-other-window).- C-x 5 . tag
- Find first definition of tag, and create a new frame to select the
- buffer (
find-tag-other-frame).- M-*
- Pop back to where you previously invoked M-. and friends.
__init tells GCC to put the function in a special section. These functions are
only used during booting, and are removed from memory after boot (see the
"Freeing unused kernel memory: 200k freed" or similar boot message.
fseek(input, 0L, SEEK_END); /* Position to end of file */
lFileLen = ftell(input); /* Get file length */
rewind(input); /* Back to start of file */
fread(str, lFileLen, 1, input);
anon_umask=022 (最后的权限是rwxrwxrwx-022=rwxr-xr-x)
Screen的另外一个用法要稍微特殊一些,这么说吧,比如你开了n个窗口正在工作,突然有事要停下来,暂时关闭掉作别的事,或者是在公司没作完回家接着作,抑或是到服务器的网络连接断掉了,那么你已经打开的n个窗口、你的工作状态能不能保留呢?答案当然是肯定的!这也是Screen的一大特色,遇到上述情况,你只要Ctrl+a d就从screen的工作界面中跳出来了,回到正常的shell环境,什么时候想回来了,再使用screen -r命令就又能连接到你刚才的工作状态继续工作了。即使是在公司的screen没有用Ctrl+a d命令进行deatach,还可以用screen -x把控制权“抢”过来,嘿嘿。
Screen还具有log功能,使用Screen -L命令启动,就会在用户的home目录下自动生成screenlog.?文件,其中?是你在screen中开的“窗口”号,默认第一个为0。这样用户在 screen中的所有操作就都可以记录下来了,不管是为了写文章还是存档用都很方便。不过screenlog中还记录了Escape Code信息,所以直接用vi或者less查看很不方便,cat出来倒是原汁原味,保存了彩色shell的所有颜色,但毕竟不方便,所以我自己写了一个把screenlog转换为html代码的工具,自己觉得还有点用吧。
screenlog中的颜色和linux shell中的颜色一样,都是用Escape Code中的颜色代码来实现的,关于这些颜色代码,Pradeep Padala有一篇文章介绍的比较详细,值得学习一下。
发信人: qiuxing (球星), 信区: Linux
标 题: GNU Screen -- MITBBS Linux版镇版之宝
发信站: BBS 未名空间站 (Sun Feb 17 19:04:40 2008)
GNU Screen -- MITBBS Linux版镇版之宝
* 什么是GNU Screen
常来我们版的,基本上就算没有自己用过也听说过screen的名字了,那么到底什
么是screen, 它又是干什么的呢?为什么它能称得上是我们的镇版之宝?
screen的手册上说了,screen是一个terminal multiplexer。但是对于普通人来
讲,这个定义和没有定义差不多。我觉得最通俗的解释,应该说screen相当于文
本界面下面的一个desktop,就像GNOME, KDE之于X窗口系统。其次,screen还提
供类似于远程桌面(freenx, vnc, 或者Windows下的remote desktop)的功能,
你可以在本地生成一个"桌面",然后通过网络重新连到这个"桌面",所有你开的
"窗口"都还在。从这一点上说,screen完全可以取代nohup帮助你远程跑长时间的
程序,比如说需要过夜计算的simulation之类。
* Screen的基本功能
在我们谈screen的基本功能之前,我们来看看一个现代desktop,比如说gnome,
到底都为用户提供了什么。
首先,gnome提供了一个多窗口管理机制。以前这一块由metacity提供,现在很多
情况下是由compiz fusion 3D窗口管理器管。无论是老土的metacity还是眩目的
compiz fusion,其实说穿了都不过是给用户一个机制来管理多个同时运行的图形
化程序。广而论之,X下面的virtual desktop也不过是这个机制的延伸。
其次,gnome提供了一个(或者多个)panel,这个panel上可以加载很多有用的插
件。其中最有用的是window list,显示出你当前打开的几个应用程序的名字,然
后提供一个切换的方法。
第二有用的panel插件大概就是system monitor吧,能够显示出系统当前的
loads, memory等等。有的人大概还喜欢在panel上面显示时间,机器名等等信息。
再接下来,gnome还提供了一些别的服务,比如说程序与程序间的copy/paste服务,
设置多语言编码方式,键盘热键设定,必要的时候把屏幕锁上等等。
我们很快就能看到,以上说的这些功能,都有screen下的对应。当然,gnome是个
庞然大物,里头还有无数应用程序,就是那些以g开头的无数程序。但这些严格的
讲并不是一个桌面系统的一部分。甚至连nautilus严格的讲也不能算是desktop里
头不可分割的一部分。这些应用程序其实很多在文本界面下也有对应物,只不过
不由screen负责而已。我会在本文里头附带稍微介绍一下一些文本模式下的应用
程序。
* Screen的基本操作
** 第一次启动screen
每一个screen进程本身代表一个session. 最简单的方法是在一个终端下直接输入
screen然后回车。这时你会看到一个很简陋的greeting界面,然后你随便按一个
空格它就消失了,剩下的就是普通的shell提示符,好像什么都没发生过。你可以
运行一些标准shell指令,比如说ls,你会发现这个shell和别的shell没有任何不
同。
运行如下命令
screen -ls
你会发现它告诉你有一个screen在跑:
$ screen -ls
There is a screen on:
8671.pts-1.inferno (Attached)
1 Socket in /var/run/screen/S-qiuxing.
现在你输入Ctrl-a, 然后单个字母w,会发现左下角出现一个提示,比如说:
0*$ bash
现在再按Ctrl-a然后d,这时你开头运行命令出现的那些文字都不见了。我们现在再来
跑一次screen -ls:
$ screen -ls
There is a screen on:
8671.pts-1.inferno (Detached)
1 Socket in /var/run/screen/S-qiuxing
什么都没变除了状态由Attached变成了Detached。
现在你把你刚刚用的xterm关掉,重开一个xterm,或者有条件的话换一部电脑,
ssh到你的第一部机器,然后输入screen -r。你看见了什么?是不是之前的那些
文字都又回来了?
其实真正发生的是这么一个过程:screen创建了一个socket(一般是在
/var/run/screen/下面),把它伪装成为一个虚拟文本终端(pty device)来充当
标准输入输出设备,然后调用了一个shell 程序让它运行在这个文本终端(其实
是个socket)上。当你从一个xterm里头detach掉了screen,screen下运行的程序
不会直接退出,因为它们用的标准输入输入装置已经不是你的xterm(下面跑的那
个shell)所相关的那个虚拟文本终端,而是一个socket了。
** 管理session
一般来说,我们不会裸起一个screen. 好的practice是每次新开一个screen,都
给它取一个好记的名字:
screen -S a_name
下次再用screen -ls的时候就会发现它有一个名字了(就是随机数后面的那一部
分)。
以下为和管理session有关的命令:
- 检查有多少screen session和它们的状态用screen -ls
- detach一个正在跑的session用Ctrl-a d
- reattach这个session用screen -r,
- 如果有多个detached的session, 而我们又想attach到某一个的话,就用screen
-r a_name
- 在一个正在跑的session里头改名字: 先按Ctrl-a, 然后按冒号:, 出来一个类
似vi的输入命令的界面,在里头运行这个内部命令:sessionname a_name
一个很常见的情况:有时我们需要强制reattach到一个attached session,比如
说忘记detach了,或者是ssh的时候网络断线了. 这个命令是: screen -RD
a_name. 事实上它的实现是先给a_name session发出一个detach指令,然后在发
出一个attach指令。
** 管理窗口
- 生成一个新的窗口: Ctrl-a c。这个新的窗口跑的是你的shell。
- 生成一个新的窗口,并且让它跑某个指定的程序: Ctrl-a :, 然后输入:
screen -t其中 是窗口的名字, 是窗口号, 是指定的程序。这个命令主要是在配置文件里头用。
- 关闭一个窗口: 退出这个窗口的程序,则窗口自动关闭
- 在无法退出某个程序的时候强制关闭一个窗口: Ctrl-a K
- 窗口列表: Ctrl-a w
- 窗口切换:
1. Ctrl-a ", 出现一个菜单可以选择
2. Ctrl-a, 是从0到9的窗口ID,这个命令直接切换到第 号窗口
3. Ctrl-a SPACE, 下一个窗口
4. Ctrl-a BACKSPACE, 前一个窗口
5. Ctrl-a Ctrl-a, 在当前和前一个窗口之间转换,相当于Alt-Tab的功能
- 窗口改名: Ctrl-a A
** 分屏
- 上下分成两个区域: Ctrl-a S (相当于emacs里的C-x 2
- 在两个区域里头切换: Ctrl-a TAB
- 合并两个区域: Ctrl-a Q (相当于emacs里的C-x 1), Ctrl-a X (相当于
emacs里头的C-x 0)
** copy/paste
正常模式下screen把所有的不以Ctrl-a开头的命令都完全透明地pass给窗口里
头的程序了。其实screen还有一个copy/paste模式,进入这个模式后screen的行
为就更像一个text editor(vi),你可以copy/paste,也可以上下移动(相当于
scroll window)。
- 进入copy/paste mode: Ctrl-a ESC或者Ctrl-a [.
- 在c/p mode下移动光标: 上下左右箭头,pgup/pgdown等。vi的hjkl,BE,/?等
等也都work
- Set mark: SPACE (类似emacs里面的Ctrl-SPACE)
- 两个mark里的内容自动进入screen的c/p buffer, 并且退出c/p mode。
- 这个c/p buffer还可以用文件写出来: Ctrl-a >
在正常模式下,Ctrl-a ]能够paste刚刚选中的内容。
** 其它有用功能/注意事项
第一重要的注意事项: 不要乱按Ctrl-a s. 它会锁死你的shell。不过不小心碰
到了也别怕,再按一下Ctrl-a q,你的shell就活过来了。
第二重要的事情: 我习惯了在shell/emacs里用Ctrl-a而不是Home跳到句首。可
是现在Ctrl-a被screen占用了。那么,我们怎么输入一个Ctrl-a? 答案: Ctrl-a
再加字母a.
推论: 如果在一个screen里头不小心attach了另外一个screen怎么办? 用Ctr-a
a d来detach里头的那个screen.
- 查看系统时间等信息: Ctrl-a t
- 查看screen本身的信息: Ctrl-a v
- 锁住屏幕: Ctrl-a x
- 清理屏幕: Ctrl-a l
- 有时候screen会显示一些信息,想要显示上一次显示的提示内容的话:
Ctrl-a m
- 给当前窗口录像(生成一个log,记录所有的信息): Ctrl-a H
- 使用visual bell: Ctrl-a Ctrl-g
* 配置文件
screen的基本配置文件是~/.screenrc(用户目录下的一个隐藏文件)。事实上在
这里控制的screen参数都可以在一个正在跑的screen里面通过进入命令行模式
(Ctrl-a :),输入相关命令来实现。但写配置文件可以省不少重复性的工作。
启动screen时有一个"-c"的参数来使用任何一个指定文件作为配置文件。比如:
screen -c .screenrc2
附录里有一个screenrc文件例子,里头详细的注释了每一行是干什么的。
* 高级用法
** 关注某个窗口
有时候我们可能开了一个窗口来跑一个要跑很久的程序,又或者那个窗口跑的是
pine/mutt,但我们在另外一个窗口干活。绝大多数时候第一个窗口都不会有任何
信息,但假设出现了变化比如说程序跑完了或者收到了新的email,我们也希望能
够在干活的当前窗口得到一个提示。
还有另外一种相反的情况,比如说编译一个大程序,不断的会出各种信息。但如
果不出了,那就说明编译完了(或者错了),这时候我们也希望得到通知。这个
功能大约对于Gentoo用户来说是最有用的.
这些都可以通过打开/关闭monitoring来实现。
- Ctrl-a M. 这样当前窗口如果出现变化,系统会通过message来通知你
- Ctrl-a _. 正好是上面的反面,如果当前窗口15秒都没动静了,则screen会发
一个msg.
** caption/hardstatus line
之前我提到过screen可以实现类似于gnome panel的功能。这个功能在screen里面
叫做caption line或者hardstatus line。它的配置看起来比较复杂,但一旦搞明
白了你就可以用它干很多很cool的事情。一个类比是配置bash的提示符,也是属
于不大好配置但很强大的东西。
我先举一个简单的例子吧:
caption always "%{+b Yk}%w"
hardstatus alwayslastline "Host: %H Load: %l "
它的效果是出现了两条panel, 第一条叫做caption line, 里头的内容是带颜色的
窗口信息, 第二条是hardstatus line, 里头有host和system load的信息。
在"%{+b Yk}%w"里头,%是escape sequence,+b是指粗体,Yk指的是亮黄(Y)字体,
配黑色(k)背景,%w是窗口号/名字。hardstatus bar里面,%H是hostname, %l是
系统load(和top里头显示的一样),其他就是一般的字符。
下面是一个比较复杂的hardstatus line配置, 视觉效果比单纯的%w要好:
hardstatus alwayslastline '%{Yk}%-w%{.Yk}%n %t%{-}%+w %=%{.w}'
更多的色彩,信息,请参阅screen manual里头关于string escapes那一章。
** Panel插件
虽然screen提供了很多string escapes, 但它们还是不可能满足所有人所有的需
要。比如说我自己就想知道系统使用了多少内存,有的人可能还想查看有没有新
邮件,等等。在gnome panel里头,这些都是通过panel插件来实现的。在screen
的caption/hardstatus line里也有一个类似的机制,让你把任何一个指定的程序
的output放在panel上。
一个简单的例子:
backtick 1 5 5 uptime
hardstatus alwayslastline "%1`"
解释一下:backtick 1 5 5 uptime的意思是定义外部命令uptime的标准输出作为
一个string escape, ID为1. 一次显示5秒钟,5秒钟之后重新运行一次。
比较复杂的例子(这也是我自己在用的screenrc):
backtick 1 5 5 /home/qiuxing/bin/my_sysload1
backtick 2 5 5 /home/qiuxing/bin/my_free
hardstatus string '%{Yk}%-w%{.Yk}%n %t%{-}%+w %=%{.w} %{.Yr}%1` %{.Yb}%2`M %
{kY}%C'
其中my_sysload1和my_free的内容如下:
my_sysload1:
#!/bin/bash
cat /proc/loadavg | cut -d" " -f1
my_free:
free -m | tail -n 2 | head -n 1 | cut -c27-29
** 256色
比较新的screen支持256色。如果自己编译,记得在编译的时候打开这个选项。
Feisty和之前的Ubuntu下的screen没有加这个编译选项,但在Gutsy里这个选项已
经有了。我知道的支持256色的程序有vi/emacs/elinks。如果你知道别的文本模
式程序支持256色,请务必让我知道。
如果你知道你的screen支持256色,请在.screenrc里头加入这么几句:
term xterm-256color
attrcolor b ".I"
termcapinfo xterm-256color 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"
其中第一句让screen伪装成一个xterm-256color,第二句让screen使用bold字体,
第三句告诉screen怎么定义前景背景等信息,最后一句是让screen用背景色来
erase text。
另外要确认一下你的系统上的确有xterm-256color这个term的信息。在Ubuntu里,
这个库叫做ncurses-term。
** X/鼠标支持
有一些文本程序也支持鼠标(emacs, elinks, w3m),有的甚至还支持inline
picture display(w3m)。screen对于这些都支持得很好。只要记住远程连接的时
候打开X11 forwarding开关(ssh -X),另外要检查一下shell变量DISPLAY是不
是设置对了(本地显示应该是:0.0,远程一般是:10.0之类的东西)。
** 编码转换
screen还有一个鲜为人知的功能:实现编码转换。比如说mrxvt只能支持gbk,但
不能支持unicode。可是我的中文文件都是unicode编码的。这时就可以通过
screen来实现编码转换:
encoding GBK UTF-8
只要在一个支持unicode的terminal里头生成一个screen session,detach之,下
次在一个编码为zh_CN.gbk的mrxvt里头reattach上这个session,所有的
zh_CN.utf8编码的中文文字就会自动转换为gbk格式。
** 多用户支持
screen还可以支持多用户。也就是说一个用户生成了一个session,然后让guest
来参与。具体的做法是先让screen变成一个setuid root的程序,然后在
screenrc里头允许另外一个用户连接。
如果你用过这个功能就会发现它相当的cool。但因为有一定的security concern,
我就不写太详细了。真要想用的话请参照这个Gentoo howto:
http://gentoo-wiki.com/HOWTO_Snoop_terminal_session#Screen
* 附录
** screenrc文件范例
# 和256色相关的配置
term xterm-256color
attrcolor b ".I"
termcapinfo xterm-256color 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"
# 编码转换
encoding GBK UTF-8
# 使用visual bell
vbell on
# 断线的时候自动detach
autodetach on
# 不要出来那个烦人的greeting
startup_message off
# make the shell in every window a login shell
# 意思是会去执行~/.bash_profile
shell -$SHELL
# 在copy/paste模式下可以回溯到5000行的历史
defscrollback 5000
#remove some stupid / dangerous key bindings
bind k
bind ^k
bind .
bind ^\
bind \\
bind ^h
bind h
#make them better
bind 'K' kill
bind 'I' login on
bind 'O' login off
bind '}' history
# default windows
screen -t work 0
screen -t shell 1
screen -t su 3 sudo su -
screen -t others 4
chdir /home/qiuxing/Documents/writing/linux
screen -t notes 5
chdir
screen -t mutt 6 mutt
select 0
# hardstatus line hack
backtick 1 5 5 /home/xqiu/bin/my_sysload1
backtick 2 5 5 /home/xqiu/bin/my_free
hardstatus alwayslastline '%{Yk}%-w%{.Yk}%n %t%{-}%+w %=%{.w} %{.Yr}%1` %{.
Yb}%2`M %{kY}%C'
** 常用文本模式程序
- 文件管理器:
1. bash
2. mc (midnight commander)
- 系统资源管理
1. top
2. htop
3. ps
- 文本编辑: emacs -nw, vi, nano, ...
- 网络浏览器: w3m(中文支持很好), elinks
- 聊天:
1. finch. 这个是pidgin/gaim的文本模式, 唯一支持QQ的text mode程序
2. centericq 很早以前用过,功能也很强大
3. irssi 最好的IRC聊天室client
4. irssi + bitlbee 如果你用这个组合,你就是真正的chat geek了!
- 邮件/新闻组
1. mutt
2. pine
3. gnus
- 文件传输
1. lftp (支持很多协议包括sftp, www)
2. wget
3. rsync
4. unison
- 科学运算 R, octave, maxima, python (scipy), ...
- 网络调试
1. tcpdump
2. nmap
3. netcat
- 音乐 mpg321, mplayer, 还有一些比较复杂的比如说cplay, moc等。
- Bittorrent: rtorrent
** 更多信息
最简单的入门:http://blogamundo.net/code/screen/
复杂一点的:http://gentoo-wiki.com/TIP_Using_screen
当然最全的信息还是screen user's manual:
http://www.delorie.com/gnu/docs/screen/screen_toc.html
要排解郁闷,比较好的办法是睡觉,可惜这样会带来更大的负罪感,已经好几次由于睡觉误事而自责。没办法,尸位素餐吧,又没地方玩,只能玩电脑了。
看naruto动画,漫画,剧场版,下ost来听。漫画要赞的,延续着紧张的剧情。动画到后面感觉像敷衍了,鸣人没成长啊,弄来弄去就那几样东西。
看网络小说,这个是被疯子和大猪头影响的。没有像他们一样博览群书,我只是stick to some books. 紫川,阿里布达,随波逐流之一代军师。以前通宵看 国之利刃,我是特种兵,真是印象深刻,热血贲张。总之,看网络小说消磨时间真的很快很快,特别是我这种一根筋的家伙,副作用也是很大。紫川好久没更新了,不会TJ了吧,散伙饭上喝醉了不省人事,被同学抬回寝室的路上突然有了些意识,意识到自己在说的竟然是“紫川”,“远东”,“魔族”,“光明王”,马上住口,然后继续不省人事。第二天还被同学笑,真怀念。
anyway, 目前拿的出手的兴趣爱好还真没有,什么都会一点但没有一样是很深入的,头疼啊。
\usepackage[pdftex]{graphicx}
\setlength\fboxsep{3pt} %定义边框和图像之间的距离
\setlength\fboxrule{4pt} %定义边框厚度
\begin{figure}
\fbox{\scalebox{.5}{\includegraphics*[bb=0 0 400 300]{file-name.pdf}}}
\caption{This is figure.}
\label{fig:fig1}
\end{figure}
http://www.cs.bu.edu/teaching/tool/emacs/programming/
M-$ Check word's spelling
M-x spell-buffer Check buffer's spelling
M-x spell-region Check region's spelling
Modes:
M-x emacs-lisp-mode Emacs-Lisp mode
C-x C-e Evaluate preceding expression
C-M-x Evaluate expression(contain the cursor or after)
M-x eval-region Evaluate code in region
M-x eval-current-buffer Evaluate all code in buffer
M-x lisp-interaction-mode Emacs-interaction-lisp mode
C-j Evaluate expression preceding the cursor
Moving Among Defuns:
C-M-a Move to start of current or previous defun
C-M-e Move to end of current or next defun
C-M-f Move forward over the current or next sexp
C-M-b Move backward over sexp
C-M-n Move forward over list
C-M-p Move backward over list
C-M-u Move up a list
C-M-d Move down a list
Marking Text:
C-M-h Put region around defun
C-M-@ Puts a mark after the next sexp
Indentation & Comment:
C-j Finish line and indent next
C-M-\ Indent all lines in region
C-M-q Indent list contents
C-u TAB Shift list to correct alignment
M-; Append a comment to current line
C-u - C-x Delete comment on current line
C-M-j Finish current comment line and start a new comment
黄家驹-谁伴我闯荡.mp3
The MP3 file download:
TheCranberries-08-Wanted.mp3
如果不能做自己喜欢做的事情,那就去喜欢自己做的事情吧。
.emacs (更新中)
(set-language-environment 'utf-8)
(prefer-coding-system 'utf-8)
;;使用文泉驿中文字体,同时设定字体大小。
(create-fontset-from-fontset-spec
"-adobe-courier-medium-r-*-*-14-*-*-*-*-*-fontset-ifree,
chinese-gb2312:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-big5-1:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-big5-2:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-sisheng:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-3:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-4:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-5:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-6:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-7:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0208-1978:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0208:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0212:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0213-1:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0213-2:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
"
)
(set-default-font "fontset-ifree")
(add-to-list 'after-make-frame-functions
(lambda (new-frame) (select-frame new-frame)
(set-default-font "fontset-ifree")))
;; 指针颜色设置为白色,seems not working, add it at the bottom
(set-cursor-color "white")
;; 鼠标颜色设置为白色
(set-mouse-color "white")
;; 设置背景颜色和字体颜色
(set-foreground-color "#FDFF00")
(set-background-color "#343434") ;;增强对比度
;; 设置另外一些颜色:语法高亮显示的背景和主题,区域选择的背景和主题,二次选择的背景和选择
(set-face-foreground 'highlight "white")
(set-face-background 'highlight "blue")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")
;;设置日历的一些颜色
(setq calendar-load-hook
'(lambda ()
(set-face-foreground 'diary-face "skyblue")
(set-face-background 'holiday-face "slate blue")
(set-face-foreground 'holiday-face "white")))
;;hilights grammer
(global-font-lock-mode t)
;;不要滚动栏
(scroll-bar-mode nil)
;;时间显示设置
;;启用时间显示设置,在minibuffer上面的那个杠上(忘了叫什么来着)
(display-time-mode 1)
;;时间使用24小时制
(setq display-time-24hr-format t)
;;时间显示包括日期和具体时间
(setq display-time-day-and-date t)
;;所有的问题用y/n方式,不用yes/no方式。有点懒,只想输入一个字母
(fset 'yes-or-no-p 'y-or-n-p)
;;鼠标自动避开指针,如当你输入的时候,指针到了鼠标的位置,鼠标有点挡住视线了
(mouse-avoidance-mode 'animate)
;;允许自动打开图片,如wiki里面
(auto-image-file-mode)
;;可以操作压缩文档
(auto-compression-mode 1)
;;在minibuffer上面可以显示列号
(column-number-mode t)
;;显示默认的文档的宽度,看起来比较舒服?
(setq default-fill-column 60)
;;指针不要闪,我得眼睛花了
(blink-cursor-mode -1)
(transient-mark-mode 1)
;;当指针到一个括号时,自动显示所匹配的另一个括号
(show-paren-mode 1)
;;是用滚轴鼠标
(mouse-wheel-mode t)
;;去掉烦人的警告铃声
(setq visible-bell t)
;;滚动页面时比较舒服
(setq scroll-step 1
scroll-margin 3
scroll-conservatively 10000)
;;允许emacs和外部其他程序的粘贴
(setq x-select-enable-clipboard t)
(set-cursor-color "white")
(require 'ange-ftp) ;;自动导入文件目录
(setq tex-dvi-view-command "yap") ;;设定dvi打开程序,还可windvi,xdvi
;;关闭启动画面
(setq inhibit-startup-message t)
;;所有备份文件转移到~/myBackup/Emacs目录下,保持最新的五个版本和最原始的两个不版本
(setq backup-directory-alist (quote (("." . "~/myBackup/Emacs"))))
(setq version-control t)
(setq kept-old-versions 2)
(setq kept-new-versions 5)
(setq delete-old-versions t)
(setq backup-by-copying t)
;;不产生备份文件
;(setq make-backup-files nil)
;;开启图片浏览
(auto-image-file-mode t)
;在标题栏显示目前在什么位置
(setq frame-title-format "yang@%b")
参考以下文章:
How To Install On Debian with Several Codecs
deb http://debian.uchicago.edu/debian/ testing main contrib non-free
These step by step instructions have been updated and tested on September 3, 2006
I have tested this how-to on Etch (Testing).
This howto only includes codecs for win32, Quicktime, RealPlayer, and Live.com (streaming for protocols such as reaplayer)
Not up for doing all of this? There are unofficial debian packages provided by marillat: read more
Otherwise...
MPlayer v1.0pre8 source - 7.8M - You may download directly from the Mplayer HQ Download or from: (mirror1 )
(unless you have a src file of your own you wish to use)
essential-YYYYMMDD.tar.bz2 - Grab the latest version "essential codecs package" from Mplayer HQ Download
live555-latest.tar.gz - about 400 K (live555.com download)
mplayer-user-conf.tar - 690 k (mirror1 | mirror2)
Since I don't know where you are downloading these to, you will just need to move them to the proper place when I ask you to unpack them.
If you have an older version of mplayer on your system remove all traces of it (if you used a deb do dpkg -P mplayer then go through your system and make sure EVERYTHING for mplayer is gone, some things will not be removed with dpkg -P). This step is VERY important.
as root:
apt-get install libogg0 libogg-dev libvorbis0a libvorbis-dev vorbis-tools libpng12-0 libpng10-dev liblogfile-rotate-perl libconfhelper-perl debhelper fakeroot g++ libgtk1.2 libgtk1.2-dev svgalibg1 svgalibg1-dev libsdl1.2-dev libaa1 libaa1-dev x11proto-gl-dev
NOTE: Make sure your gcc and g++ versions match!
as root:
rm -r /usr/lib/win32
(If it exists. These are the w32 codecs, don't worry, we will replace these later, you can pack them up and move them if you are really concerned about losing them)
tar -jxvf essential-YYYYMMDD.tar.bz2
mv essential-YYYYMMDD/ /usr/lib/win32
Live.com Codecs (for streaming realplayer)
cd /usr/local/lib/
rm -r live/
(If it exists. These are the old live.com codecs, don't worry, we will replace these later, you can pack them up and move them if you are really concerned about losing them)
tar -xvvzf live555-latest.tar.gz
cd live/
./genMakefiles linux
make
(Here MOVE THE WHOLE LIVE DIRECTORY TO /USR/LOCAL/LIB THEN COMPILE!)
(you can skip this if you have your own configs and settings, and/or don't want to use gmplayer)
become your user
cd
tar -xvvf mplayer-user-conf.tar
this will create the ~/.mplayer directory including a skin (neutron), arial size 18 font, and config file
in line 27 of the ~/.mplayer/gui.conf file, change: font_name = "/home/lyz/.mplayer/font/font.desc" to reflect your username (I havent found a way around this step, ~ doesn't work).
as root:
cd /usr/src/mplayer/
tar -jxvvf MPlayerVersion.tar.bz2 (where 'Version' is your version, ie -1.0pre7)
cd MPlayerVersion
DEB_BUILD_OPTIONS="--disable-runtime-cpudetection --disable-rtc --enable-live --with-livelibdir=/usr/local/lib/live" fakeroot debian/rules binary
Make sure there aren't spaces between -- and any-of-the-options
when it's finished compiling, it will create an mplayerVersion.deb file in /usr/src/mplayer
cd /usr/src/mplayer/
dpkg -i mplayerVersion.deb
when it asks about video output choose which is right for you, if unsure just use xv
launch mplayer by typing mplayer moviefile (where moviefile is the name of the file you wish to use to test mplayer)
You're done! Congrats!
This also includes gmplayer. gmplayer allows you to use "skins" for mplayer, I don't usually use skins because I don't need the gui control, and the skins tend to take away from speed and quailty of movie decoding.
If you're having problems using xv as a video output, try gl or gl2; mplayer -vo help will give you a listing of your options.
Sometimes you will want to watch realplayer files that are .rm; remember that a .rm can be viewed as a simple text file with the stream location of the actual .ra is in that file. mplayer will not play the .rm but it will play the .ra stream. (Apparently there is a patch out so that mplayer will play .rm but I have never used it).
Something broke, can you help?
I might be able to, as I said, I have tested this, and if something broke it might be a conflict in versions (stable vs testing vs unstable vs mixed system) or a simple user error. It is quite possibly due to not completely uninstalling previous versions of mplayer, this is a very important step! If all else fails, you can always uninstall the deb, and reinstall what you had before.
I'm not on debian but I want to install mplayer, any pointers?
Not really, I could point you to some sites I have found for other distros, but I have never tried them, so I can't guarantee they will work.
Why don't you include more codecs?
Are there many more? I have included the ones I primarily use, so these are the only codecs I have installed and tested.
Why do you make a .deb? How do I compile it without making a .deb?
I make a .deb because it's debian's package management tool. If you just want to compile it and not bother with the deb, the "DEB_BUILD_OPTIONS" are what would normally be passed when you compile the package by hand.
What about DVD support?
I don't have a DVD-ROM, so I have no way of testing DVD support, sorry.
MPlayerHQ - Main MPlayer site
Live555.com - Home of the live.com codecs
linux.coconia.net "Installing Mplayer" - Not Debian specific, but includes some codecs that I haven't bothered with
Special thanks to Mark and Magni who host two of the mirrors!
Thanks to Grifter for teaching me how to install this.
Thanks so much to everyone else who has emailed me to point out mistakes and offered compatibility notes, I appreciate it greatly and encourage others to do the same.
Comments? Questions? Pointers? Email me at Lyz@PrincessLeia.com
PasswordAuthentication Yes
apt-get build-dep libxfce4mcs
apt-get install libasound2-dev
ape player for linux
#tar zxvf ape.tgz
#cd ape
#./install.sh
#cplay