Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
totem 中文字幕问题
感谢 Huang Jiahua在源里做好的 xine-fonts-cn,直接在新立得中搜索安装 xine-fonts-cn 即可。甚至都不用配置 ~/.gnome2/totem_config 文件。这样即可解决 totem 支持 .srt 中文字幕的问题。
源里没有的话,直接用 xine-fonts-cn_0.1.2_all.deb 地址下载
注:srt 与 avi 同名,totem 会自动加载字幕;或者,把两个文件一起拖到 totem 窗口中;或者命令行
totem file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.avi#subtitle:file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.chs.srt
原理如下:
totem 使用的字体在 /usr/share/xine/libxin/fonts 中,而这里没有中文字体,所以字幕乱码或干脆不显示。需要 xine-fontconv 这个软件来制作所需的中文字体。
以下为引用内容:
一:添加源代码源:
sudo gedit /etc/apt/sources.list
增加
deb-src http://archive.ubuntu.com/ubuntu/ breezy main restricted universe multiverse
二:下载源代码,编译出 xine-fontconv :
sudo apt-get update
sudo apt-get source libxine1c2
cd xine-lib-1.0.1/misc/
sudo gcc -o /usr/local/bin/xine-fontconv xine-fontconv.c `freetype-config –cflags –libs`
三:生成中文字体
cd /usr/share/xine/libxine1/fonts
sudo xine-fontconv /usr/share/fonts/zh_CN/TrueType/SIMSUN.TTF simsun gb18030
四:修改totem的配置:
gedit ~/.gnome2/totem_config
找到中间的项目修改为:
subtitles.separate.font:simsun
subtitles.separate.src_encoding:gb18030
五:播放:
totem file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.avi#subtitle:file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.chs.srt
via http://forum.ubuntu.org.cn/about2760.html
Mplayer 中文字幕
大约这样的命令格式
mplayer 影片名 -sub 字幕名 -subcp cp936 -font 中文字体名
中文字体名,就是类似 /media/hda1/WINDOWS/Fonts/simsun.ttc 这样(我的 windows 在 hda1)。我试验了
-font /usr/share/fonts/X11/misc/wenquanyi_12pt.pcf.gz
但是很卡。所以还是推荐 windows 的那些字体。下面是比较完整的例子
mplayer [肥皂].A.Soap.2006.LIMITED.DVDRip.XviD-MESS.avi -sub [肥皂].A.Soap.2006.LIMITED.DVDRip.XviD-MESS.srt -subcp cp936 -font /media/hda1/WINDOWS/Fonts/simsun.ttc
简写
mplayer *.avi -subcp cp936 -font /media/hda1/WINDOWS/Fonts/simsun.ttc
即可。但还avi和字幕要同名。
以下为引用内容:
mplayer 如果希望默认字体就支持中文
1、修改~/.mplayer/config文件中间的项目为:
font=/usr/share/fonts/zh_CN/TrueType/SIMSUN.TTF
subcp=cp936
2、修改`/.mplayer/gui.conf文件中间的项目为:
sub_auto_load = “yes”
sub_unicode = “yes”
sub_pos = “99″
sub_overlap = “no”
sub_cp = “cp936″
font_factor = “0.750000″
font_name = “/usr/share/fonts/zh_CN/TrueType/SIMSUN.TTF”
font_encoding = “unicode”
参考资料:
totem 观看 avi+src 中文字幕方法
guoshuang2007-11-06+把电影和字幕拖进 Kaffeine 窗口,在设置中 subtiltle 选择编码,中文一般是 gb18030。
Popularity: 27% [?]
Tags:
deb,
font,
gnome,
mplayer,
ubuntu,
vi
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
原文来自 Bash Shell Keyboard Shortcuts For Linux Users,大部分快捷方式我以前一无所知…
# Ctrl + A - Go to the beginning of the line you are currently typing on
# Ctrl + E - Go to the end of the line you are currently typing on
切到命令行开始|结尾
# Ctrl + L - Clears the Screen, similar to the clear command
清屏,类似于 clear 命令
# Ctrl + U - Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
清除光标以前
# Ctrl + H - Same as backspace
退格键 backspace
# Ctrl + R - Let’s you search through previously used commands
从命令历史中找
# Ctrl + C - Kill whatever you are running
终止命令
# Ctrl + D - Exit the current shell
退出 shell
# Ctrl + Z - Puts whatever you are running into a suspended background process. fg restores it.
??
# Ctrl + W - Delete the word before the cursor
清除光标之前
# Ctrl + K - Clear the line after the cursor
清除光标之后
# Ctrl + T - Swap the last two characters before the cursor
# Esc + T - Swap the last two words before the cursor
切换光标前最后两个字母(单词)
# Alt + F - Move cursor forward one word on the current line
# Alt + B - Move cursor backward one word on the current line
??在 ubuntu x windows终端中会切换到菜单!tty 可能可以
# Tab - Auto-complete files and folder names
自动补全
# Ctrl + Y - to paste it (as in delete and copy) all text in front of the cursor
粘贴(刚才 ctrl+w 或者 ctrl+k 的内容)
# Esc + . (or Esc + Underscore) - Insert Last Argument
??
# Ctrl + b - Move back a character
# Ctrl + f - Move forward a character
向前|后移动一个字母
# Ctrl + r - Search the history backwards
??
# Ctrl + xx - Move between EOL and current cursor position
光标在当前位置和 EOL 之间切换(EOL end of line?但我实验,是在开头和当前位置之间切换,怎么理解?谁知道?)
# Ctrl + x @ - Show possible hostname completions
# Alt +
# Alt + > - Move to the last line in the history
# Alt + ? - Show current completion list
# Alt + * - Insert all possible completions
# Alt + / - Attempt to complete filename
# Alt + . - Yank last argument to previous command
# Alt + c - Capitalize the word
# Alt + d - Delete word
# Alt + l - Make word lowercase
# Alt + n - Search the history forwards non-incremental
# Alt + p - Search the history backwards non-incremental
# Alt + r - Recall command
# Alt + t - Move words around
# Alt + u - Make word uppercase
# Alt + back-space - Delete backward from cursor
# Here “2T” means Press TAB twice
# $ 2T - All available commands(common)
# $ (string) 2T - All available commands starting with (string)
# $ /2T - Entire directory structure including Hidden one
# $ 2T - Only Sub Dirs inside including Hidden one
# $ *2T - Only Sub Dirs inside without Hidden one
# $ ~2T - All Present Users on system from “/etc/passwd”
# $ $2T - All Sys variables
# $ @2T - Entries from “/etc/hosts”
# $ =2T - Output like ls or dir
Popularity: 28% [?]
Tags:
blog,
linux,
ls,
screen,
shell,
tty,
ubuntu,
vi
Posted 9 months, 2 weeks ago at 11:32 am. 1 comment

sudo apt-get install rdesktop
rdesktop 192.168.100.x
-f 全屏
-a 16位色
端口 3389(linux 22 sh)
注意:windows 的服务中的 Terminal Servies 需要开启。我的电脑 右键 属性 远程中,勾选 允许远程用户链接到此计算机。另外,退出的时候选择注销,而不是关机!
问题有二:
1.windows xp 必须打开 允许远程用户登录
2.很奇怪,我的 guoshuang 登录时,会提示踢掉已经登录的用户(据查,xp sp2 以后不能同时登录)
3.我的 windows 2003 允许远程用户登录 灰色不可选!
更多参数:
-u xxxxxx 登录用户,可选
-p xxxxxx 登录密码,可选
-r clipboard:PRIMARYCLIPBOARD 重要,剪贴板可以与远程桌面交互
-a 16 颜色,可选,不过最高就是16位
-z 压缩,可选
-g 1024×768 分辨率,可选,缺省是一种比当前本地桌面低的分辨率
-P 缓冲,可选
-r disk:wj=/home/magicgod 映射虚拟盘,可选,会在远程机器的网上邻居里虚拟出一个映射盘,功能很强,甚至可以是软盘或光盘
-r sound:off 关闭声音,当然也可以把远程发的声音映射到本地来。
重定向:
这时才发现它原来也可以将本地磁盘带到远端,而且连中文文件名也支持。只要加上 -r 参数就可以了。它除了可以将本地磁盘带到远端以外,还支持串口和打印机,这下 Windows 上远程桌面客户端的功能在 Linux 上都齐了。-r 参数的格式如下:
-r comport:COM1=/dev/ttyS0 // 将串口 /dev/ttyS0 重定向为 COM1
-r comport:COM1=/dev/ttyS0,COM2=/dev/ttyS1 // 多个串口重定向
-r disk:floppy=/mnt/floppy // 将 /mnt/floppy 重定向为远程共享磁盘 ‘floppy’
-r disk:floppy=/mnt/floppy,cdrom=/mnt/cdrom,root=/,c=/mnt/c // 多个磁盘重定向
-r clientname= // 为重定向的磁盘设置显示的客户端名称
-r lptport:LPT1=/dev/lp0 // 将并口 /dev/lp0 重定向为 LPT1
-r lptport:LPT1=/dev/lp0,LPT2=/dev/lp1 // 多个并口重定向
-r printer:mydeskjet // 打印机重定向
-r printer:mydeskjet=”HP LaserJet IIIP” // 打印机重定向
-r sound:[local|off|remote] // 声音重定向
Popularity: 30% [?]
Tags:
hp,
install,
linux,
tty,
ubuntu,
vi
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
原文来自 http://xlntsolution.blogspot.com/2007/03/feisty-performance-fly-like-butterfly.html
blogspt 似乎再次封掉了,:( 我是通过这个代理看到的
部分内容如下:
sudo gedit /etc/hosts
你会看到类似
127.0.0.1 localhost
127.0.1.1 guoshuang-laptop
这样的内容,在 localost 后面加上你的主机名,如guoshuang-laptop
127.0.0.1 localhost guoshuang-laptop
127.0.1.1 guoshuang-laptop
1. Disable IPv6
At least I dont need IPv6 yet so this is what I do to disable it.
sudo kate /etc/modprobe.d/aliases
And change the line:
alias net-pf-10 ipv6
to:
alias net-pf-10 off #ipv6
This will disable IPv6 on all network interfaces. You need to reboot.
2. Run boot processes in parallel
This will make upstart to run the boot processes in parallel and speed up the boot process.
sudo kate /etc/init.d/rc
Find and change the line:
CONCURRENCY=none
to:
CONCURRENCY=shell
3. Aliasing hostname to localhost
Right or wrong, you decide. But I picked this up in the Ubuntu forums the other day and it does improve the startup of some apps.
sudo kate /etc/hosts
and add you hostname to the first line after localhost like this:
127.0.0.1 localhost yourhost
127.0.1.1 yourhost
4. Disable pango
I know that this is already taken care of in firefox but it still makes a good performance boost to thunderbird and some other apps.
sudo kate /etc/environment
and add:
MOZ_DISABLE_PANGO=”1″
5. Preload
It does what you think. It preloads most common used libs and files = faster startup times on your applications.
sudo apt-get install preload
What about prelink?
Prelink is no longer necessary in feisty. Feisty uses a new linking mechanism called DT_GNU_HASH which speeds up the linking process without the need for continuously running prelink.
6. Swappiness
The default value for vm.swappiness is 60 in Ubuntu Feisty whic is a good default value but if you want to tweak the performance a little bit more you can change this value to a lower value to reduce the load of the swap. If you run the follwing command:
sysctl -q vm.swappiness
You will se that the value is set to 60. And by running:
sudo sysctl vm.swappiness=10
You will change the value from 60 to 10 which will make your system write to swap a lot less and I would recommend this to everyone that has 512 mb of memory or more. If you find that you have very little use of swap set the value to 0. This will not disable the swap but it will make your system write to the swap as little as possible and keep as much as possible in memory. This makes a huge improvment when switching between applications since they are now likley to be in physical ram instead of on the swap partition.
To set your value permanent you need to change the sysctl.conf file:
sudo kate /etc/sysctl.conf
Add the line
vm.swappiness=10
To the end of the file. This way it will be set upon boot.
I’ve found that the value of 5 works very good for my use and I have 1 GB of memory.
7. Profile grub
There is a option to grub called profile which will profile your startup. What it does is that it kind of indexing all the files read during boot/startup and later on it will find and read those files quicker.
Hit the escape button when booting to get to the grub menu.
Select your default boot kernel and hit the e button.
Go down to the second line and hit the e button again.
Add profile to the end of the line and press enter.
Hit the b button to boot with your new option.
The first time it will take a little bit longer to boot because it has to build the index (or whatever they want to call it) but every boot after this will be a lot smoother.
You need to do this every time you update your kernel or have made other huge changes to your system that might affect the files needed during boot.
The following could cause your system to be unstable or even unable to boot so please use them care…
8. sysv-rc-conf
Install sysv-rc-conf and disable the services you don’t need at startup.
As an example. On my computer I don’t have bluetooth so I don’t need to start it at boot time.
So simply disable what ever you don’t have or use.
sudo apt-get install sysv-rc-conf
and then run:
sudo sysv-rc-conf
9. Kernel hacking
Even thought the new kernel in feisty is very good and already tuned a bit there still are some things you can do to the kernel the will make your system snappier and boot up even faster.
Use this thread from the ubuntu forums as a guide on how to compile your own kernel.
master kernel thread
What I do is that I make sure to add my file systems I use to the kernel instead of loading them as modules. Take out whatever I don’t have or use and then compile my new and hopefully improved kernel 
10. Filesystem setup
The choice and use of the file system is a big issue when dealing with performance. Depending on your usage of your system you might need to configure your filesystem different.
For my usage I like to use the following setup (which I think is a good desktop setup)
Mountpoint
filesystem
Size
/boot
ext2
100 MB
/root
LVM, VG=system, xfs
6 GB
/swap
LVM, VG=system, swap
The size of RAM in your computer. Making it smaller and you will not be able to hibernate.
/home
LVM, VG=system, xfs
1 GB, or the rest of the space in that VG
/data
LVM, VG=data, xfs
The rest of the free space
Using the following options in fstab for all my xfs partitions:
noatime,nodiratime,logbufs=8
Using LVM can really speed up the disk performance. And you get a lot of other good stuff with it as well. Read more about LVM here.
I choose to have /root and /home on one VolumeGroup and /data on another simply because I can then split them up on diffrent physical disks and have them spanning over multiple physical disks witch really speeds up the reads and writes.
At the moment this is pretty much it but I will update this as soon as I discover more performance tunings…
Tuning applications
Not so much to add here but this what I like to do.
1. Firefox
Use swiftfox instead. It’s optimized for your CPU.
Install the fasterfox add-on
If it’s not already set, disable IPv6. In the url enter about:config and find the ipv6 entry and disable it.
Install adblock plus add-on
to disable ad’s it helps a lot 
2. openoffice
If you don’t need that extras that java JRE provides then simply disable it openoffice. That’s what I do.
Once Feisty is released I will have a script done that all you brave people can run that will do most of this in one go 
I will also write down the kernel options that I use to compile my kernel for those who are interested.
But until then, use this and enjoy a much faster and smoother running Feisty.
Popularity: 40% [?]
Tags:
blog,
cat,
feisty,
install,
laptop,
ls,
right,
shell,
tty,
tweak,
ubuntu,
vi
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
Questions and answers
ubuntu documents
ubuntu wiki
ubuntu planet
ubuntu weeklynews
ubuntu 版本
Locale support - Chinese
IRC: #ubuntu-zh on irc.freenode.net
Mailing list: http://lists.ubuntu.com/mailman/listinfo/ubuntu-zh
Website: ubuntu.org.cn
Forums: forum.ubuntu.org.cn
Wiki Documentation: wiki.ubuntu.org.cn
Popularity: 15% [?]
Tags:
hp,
linux,
ubuntu
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments


感谢 simple,我才知道 ubuntu 本身就有对比各镜像站点速度的功能。
系统 - 系统管理 - 软件源 - ubuntu software - others - select fast mirror
很遗憾!我的 ubuntu 报告需要 reload,但reload 后报告 lock 错误。重启后就再也打不开了。
Popularity: 10% [?]
Tags:
ubuntu
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
i know that i resol my problem 915resolution but how i install this file
First Adding Universe to your repositories (https://help.ubuntu.com/community/Repositories/Kubuntu), then install 915resolution package in adept or in console: sudo apt-get install 915resolution
via https://answers.launchpad.net/ubuntu/+source/kde-systemsettings/+ticket/4927
Popularity: 21% [?]
Tags:
hp,
install,
ubuntu,
vi
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
sudo apt-get install checkgmail
即可。这个比下面的 gmail-notify 功能更多一些,可以直接查看最近的一些邮件,发信等等。
二、gmail-notify
sudo apt-get install gmail-notify
更适合等信。
三、直接用 livebookmark 订阅自己的邮箱,只要有firefox就可以了,win 下也可如此。我以前主要用这种方式。
https://mail.google.com/mail/feed/atom
BTW:建立 checkmail 菜单操作如下
sudo gedit /usr/share/applications/checkgmail.desktop
内容如下:
[Desktop Entry]
Encoding=UTF-8
Name=CheckGmail
Exec=checkgmail
Terminal=false
Type=Application
StartupNotify=true
Icon=
Categories=Application;Network;
然后刷新 gnome 菜单
sudo killall gnome-panel
checkgmail 的图标图片在 gmail 图标 可以找到。
相关日志:
gmail IMAP 协议设置
checkgmail 资料
How do I play a sound when new mail arrives?
Enter a command in the “Command to execute on new mail” section in the preferences. For example, to play a WAV sound, you could use
aplay /path/to/mysound.wav
What else can the “Command to execute on new mail” do?
Well, it can do whatever you want. I use it to turn on my laptop’s dedicated mail LED light:
echo 1 > /proc/acpi/asus/mled
but anyone with the Blinkd software package installed could get their numlock or scroll-lock lights to blink with
blink –numlock –rate %m
What’s that ‘%m’ thing doing there? Well, that’s a new feature of version 1.10.1, and represents the number of new messages. Which means that in the example above your numlock LED will blink with the number of new messages. It’s gimmicky, I know (and there’s no way I could live with it personally) … but you’ve gotta admit, it’s kinda cool!
If you’re going to turn an LED on, though, you’ll also want to turn it off - and that’s why there’s also a “Command to execute for no mail” option. In the example above, you’ll want something like
blink –numlock –rate 0
And of course, you can combine options together by using semicolons, for example:
aplay /path/to/mysound.wav; blink –numlock –rate %m
The whole idea is to be as extensible here as possible, and recognise that not everyone wants a sound to play when new mail arrives, but they might want something else to happen instead …
Popularity: 33% [?]
Tags:
blog,
cat,
ebook,
gnome,
install,
laptop,
ls,
screen,
ubuntu
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
pidgin(gaim)原来装 openQ,1.0 以后新版本直接支持(但我几天前实验失败)
EVA 是目前模仿QQ程度最高的,KDE软件
lumaQQ
Popularity: 8% [?]
Tags:
ubuntu
Posted 9 months, 2 weeks ago at 11:32 am. 0 comments
不知道什么原因,升级管理器也没有打开。可能上次没有正常关闭。错误信息如下
无法获得锁 /var/lib/apt/lists/lock - open (11 Resource temporarily unavailable)
E: 无法对状态列表目录加锁
解决办法,直接删除 lock 文件
sudo rm /var/lib/apt/lists/lock
Popularity: 6% [?]
Tags:
ubuntu
ad 468x60