vi 编辑文件错误处理
Posted 9 months ago at 8:08 pm. 0 comments
vim 编辑文件的时候曾经死掉,以后每次打开 a.txt 都会报告,要么已经被打开了,要么曾经崩溃过。
删除 .a.txt.swp 后,正常。
rm .a.txt.swp
Popularity: 31% [?]
Tags: vivim 编辑文件的时候曾经死掉,以后每次打开 a.txt 都会报告,要么已经被打开了,要么曾经崩溃过。
删除 .a.txt.swp 后,正常。
rm .a.txt.swp
Popularity: 31% [?]
Tags: viVI编辑器有3种模式这3种模式中,插入模式是最基础的模式。
用好了插入模式,才可谈及想命令和底层模式使用发展。
当然更高级模式是在掌握了更多的vi知识上才能提高效率的。
而光标类型的命令是插入和命令模式通用的,只是命令模式下以前消除字符的快捷键只是起到移动光标位置的作用 。
下来就对以知的光标命令作测试和总结。
移动光标类命令:
i,insert和esc键是在2个模式下互换的命令,大小写无所谓。
以下为命令和插入模式下,各键以中心点为单位移动1个字符朝那边偏移。
(^代表ctrl),数字代表关num lock的小键盘,文字代方向键盘。如图:
k 8 上
h l 4 6 左 右
j 2 下
home 和 end键使光标移动当行最左边和最右边。
Delete:光标不动,删除后面字符1个
以下为命令模式下各键光标位置变化:
Space
w或W:光标总是向后移1个单词,跨越1个空格,tab
b或B:如光标未在本单词字首,移动到字首,如果光标就在本单词的第一个字上,往回移动到前面单词的字首。
e或E:如光标未在本单词字尾,移动到字尾,如果光标就在本单词的最后一个字上,往回移动到前面单词的字尾。
):光标向移动到下一个句子的第一个单词的的第一个字母上。
(:光标向移动到上一个句子的第一个单词的的第一个字母上。
}:光标向移动到下段落开头
{:光标向移动到下段落开头
[bi]n应该为正整数[/bi]
nG:光标移动至n行首
n-:光标下移n-1行至行首
n+:光标下移n+1行至行首
n$:光标下移n-1行至行尾
0:光标移至当前行首
$:光标移至当前行尾
Ctrl+G——光标所在位置的行数占据总高的百分比。
Enter:光标下移一行
Space:光标后移动1字符
Backspace:光标前移动1字符
以下为插入模式下各键光标位置变化:
Enter:光标带整行下移一行
Space:光标后移动1字符同时,光标后所有段落排队方式都后移动一个字符。
Backspace:光标前移动1字符同时删除前面的字符,光标后所有段落前移一个字符。
屏幕翻滚类命令
[bi]插入和命令模式下同用命令。[/bi]
pageup:上翻1页
pagedown:下翻1页
[bi]命令模式下命令[/bi]
Ctrl+u:向文件首翻半屏
Ctrl+d:向文件尾翻半屏
Ctrl+f:向文件尾翻一屏
Ctrl+b;向文件首翻一屏
[bi]插如模式下命令[/bi]
Ctrl+u:相当于Backspace键
编辑命令
i、a、r——在光标的前、后以及所在处插入字符命令(i=insert、a=append、r=replace)。
cw、dw——改变(置换)/删除光标所在处的单词的命令 (c=change、d=delete)。
x、d$、dd——删除一个字符、删除光标所在处到行尾的所有字符以及删除整行的命令。
插入文本类命令
i :在光标前
I :在当前行首
a:光标后
A:在当前行尾
o:在当前行之下新开一行
O:在当前行之上新开一行
r:替换当前字符
R:替换当前字符及其后的字符,直至按ESC键
s:从当前光标位置处开始,以输入的文本替代指定数目的字符
S:删除指定数目的行,并以所输入文本代替之
ncw或nCW:修改指定数目的字
nCC:修改指定数目的行
unbuntu VIM 版本 7.0.35 测试
Popularity: 18% [?]
Tags: vi关闭窗口:
:q
退出vi且不保存编辑:
:qa!
移动光标类命令:
H:光标左移一个字符
I:光标右移一个字符
Space:光标右移一个字符
Backspace:光标左移一个字符
K或Ctrl+P:光标上移一行
J或Ctrl+N :光标下移一行
Enter:光标下移一行
w或W:光标右移一个字至字首
b或B:光标左移一个字至字首
e或E:光标右移一个字j至字尾
):光标移至句尾
(:光标移至句首
}:光标移至段落开头
{:光标移至段落结尾
nG:光标移至第n行首
n+:光标下移n行
n-:光标上移n行
n$:光标移至第n行尾
H :光标移至屏幕顶行
M:光标移至屏幕中间行
L :光标移至屏幕最后行
0:(注意是数字零)光标移至当前行首
$:光标移至当前行尾
nG——跳转命令。n为行数,该命令立即使光标跳到指定行。
Ctrl+G——光标所在位置的行数占据总高的百分比。
屏幕翻滚类命令
Ctrl+u:向文件首翻半屏
Ctrl+d:向文件尾翻半屏
Ctrl+f:向文件尾翻一屏
Ctrl+b;向文件首翻一屏
nz:将第n行滚至屏幕顶部,不指定n时将当前行滚至屏幕顶部。
编辑命令
i、a、r——在光标的前、后以及所在处插入字符命令(i=insert、a=append、r=replace)。
cw、dw——改变(置换)/删除光标所在处的单词的命令 (c=change、d=delete)。
x、d$、dd——删除一个字符、删除光标所在处到行尾的所有字符以及删除整行的命令。
插入文本类命令
i :在光标前
I :在当前行首
a:光标后
A:在当前行尾
o:在当前行之下新开一行
O:在当前行之上新开一行
r:替换当前字符
R:替换当前字符及其后的字符,直至按ESC键
s:从当前光标位置处开始,以输入的文本替代指定数目的字符
S:删除指定数目的行,并以所输入文本代替之
ncw或nCW:修改指定数目的字
nCC:修改指定数目的行
Vi编辑器的基本使用方法!
1、vi的基本概念
基本上vi可以分为三种状态,分别是命令模式(command mode)、插入模式(Insert mode)和底行模式(last line mode),各模式的功能区分如下:
1) 命令行模式command mode)
控制屏幕光标的移动,字符、字或行的删除,移动复制某区段及进入Insert mode下,或者到 last line mode。
2) 插入模式(Insert mode)
只有在Insert mode下,才可以做文字输入,按「ESC」键可回到命令行模式。
3) 底行模式(last line mode)
将文件保存或退出vi,也可以设置编辑环境,如寻找字符串、列出行号……等。不过一般我们在使用时把vi简化成两个模式,就是将底行模式(last line mode)也算入命令行模式(command mode)。
2、vi的基本操作
a) 进入vi
在系统提示符号输入vi及文件名称后,就进入vi全屏幕编辑画面:
$ vi myfile
不过有一点要特别注意,就是您进入vi之后,是处于「命令行模式(command mode)」,您要切换到「插入模式(Insert mode)」才能够输入文字。初次使用vi的人都会想先用上下左右键移动光标,结果电脑一直哔哔叫,把自己气个半死,所以进入vi后,先不要乱动,转换到「插入模式(Insert mode)」再说吧!
b) 切换至插入模式(Insert mode)编辑文件
在「命令行模式(command mode)」下按一下字母「i」就可以进入「插入模式(Insert mode),这时候你就可以开始输入文字了。
c) Insert 的切换
您目前处于「插入模式(Insert mode)」,您就只能一直输入文字,如果您发现输错了字!想用光标键往回移动,将该字删除,就要先按一下「ESC」键转到「命令行模式(command mode)」再删除文字。
d) 退出vi及保存文件
在「命令行模式(command mode)」下,按一下「:」冒号键进入「Last line mode」,例如:
: w filename (输入 「w filename」将文章以指定的文件名filename保存)
: wq (输入「wq」,存盘并退出vi)
: q! (输入q!, 不存盘强制退出vi)
3、命令行模式(command mode)功能键
1). 插入模式
按「i」切换进入插入模式「insert mode」,按“i”进入插入模式后是从光标当前位置开始输入文件;
按「a」进入插入模式后,是从目前光标所在位置的下一个位置开始输入文字;
按「o」进入插入模式后,是插入新的一行,从行首开始输入文字。
2). 从插入模式切换为命令行模式
按「ESC」键。
3). 移动光标
vi可以直接用键盘上的光标来上下左右移动,但正规的vi是用小写英文字母「h」、「j」、「k」、「l」,分别控制光标左、下、上、右移一格。
按「ctrl」+「b」:屏幕往“后”移动一页。
按「ctrl」+「f」:屏幕往“前”移动一页。
按「ctrl」+「u」:屏幕往“后”移动半页。
按「ctrl」+「d」:屏幕往“前”移动半页。
按数字「0」:移到文章的开头。
按「G」:移动到文章的最后。
按「$」:移动到光标所在行的“行尾”。
按「^」:移动到光标所在行的“行首”
按「w」:光标跳到下个字的开头
按「e」:光标跳到下个字的字尾
按「b」:光标回到上个字的开头
按「#l」:光标移到该行的第#个位置,如:5l,56l。
4). 删除文字
「x」:每按一次,删除光标所在位置的“后面”一个字符。
「#x」:例如,「6x」表示删除光标所在位置的“后面”6个字符。
「X」:大写的X,每按一次,删除光标所在位置的“前面”一个字符。
「#X」:例如,「20X」表示删除光标所在位置的“前面”20个字符。
「dd」:删除光标所在行。
「#dd」:从光标所在行开始删除#行
5). 复制
「yw」:将光标所在之处到字尾的字符复制到缓冲区中。
「#yw」:复制#个字到缓冲区
「yy」:复制光标所在行到缓冲区。
「#yy」:例如,「6yy」表示拷贝从光标所在的该行“往下数”6行文字。
「p」:将缓冲区内的字符贴到光标所在位置。注意:所有与“y”有关的复制命令都必须与“p”配合才能完成复制与粘贴功能。
6). 替换
「r」:替换光标所在处的字符。
「R」:替换光标所到之处的字符,直到按下「ESC」键为止。
7). 回复上一次操作
「u」:如果您误执行一个命令,可以马上按下「u」,回到上一个操作。按多次“u”可以执行多次回复。
8). 更改
「cw」:更改光标所在处的字到字尾处
「c#w」:例如,「c3w」表示更改3个字
9). 跳至指定的行
「ctrl」+「g」列出光标所在行的行号。
「#G」:例如,「15G」,表示移动光标至文章的第15行行首。
4、Last line mode下命令简介
在使用「last line mode」之前,请记住先按「ESC」键确定您已经处于「command mode」下后,再按「:」冒号即可进入「last line mode」。
A) 列出行号
「set nu」:输入「set nu」后,会在文件中的每一行前面列出行号。
B) 跳到文件中的某一行
「#」:「#」号表示一个数字,在冒号后输入一个数字,再按回车键就会跳到该行了,如输入数字15,再回车,就会跳到文章的第15行。
C) 查找字符
「/关键字」:先按「/」键,再输入您想寻找的字符,如果第一次找的关键字不是您想要的,可以一直按「n」会往后寻找到您要的关键字为止。
「?关键字」:先按「?」键,再输入您想寻找的字符,如果第一次找的关键字不是您想要的,可以一直按「n」会往前寻找到您要的关键字为止。
D) 保存文件
「w」:在冒号输入字母「w」就可以将文件保存起来。
E) 离开vi
「q」:按「q」就是退出,如果无法离开vi,可以在「q」后跟一个「!」强制离开vi。
「qw」:一般建议离开时,搭配「w」一起使用,这样在退出的时候还可以保存文件。
5、vi命令列表
1、下表列出命令模式下的一些键的功能:
h
左移光标一个字符
l
右移光标一个字符
k
光标上移一行
j
光标下移一行
^
光标移动至行首
0
数字“0”,光标移至文章的开头
G
光标移至文章的最后
$
光标移动至行尾
Ctrl+f
向前翻屏
Ctrl+b
向后翻屏
Ctrl+d
向前翻半屏
Ctrl+u
向后翻半屏
i
在光标位置前插入字符
a
在光标所在位置的后一个字符开始增加
o
插入新的一行,从行首开始输入
ESC
从输入状态退至命令状态
x
删除光标后面的字符
#x
删除光标后的#个字符
X
(大写X),删除光标前面的字符
#X
删除光标前面的#个字符
dd
删除光标所在的行
#dd
删除从光标所在行数的#行
yw
复制光标所在位置的一个字
#yw
复制光标所在位置的#个字
yy
复制光标所在位置的一行
#yy
复制从光标所在行数的#行
p
粘贴
u
取消操作
cw
更改光标所在位置的一个字
#cw
更改光标所在位置的#个字
2、下表列出行命令模式下的一些指令
w filename
储存正在编辑的文件为filename
wq filename
储存正在编辑的文件为filename,并退出vi
q!
放弃所有修改,退出vi
set nu
显示行号
/或?
查找,在/后输入要查找的内容
n
与/或?一起使用,如果查找的内容不是想要找的关键字,按n或向后(与/联用)或向前(与?联用)继续查找,直到找到为止。
对于第一次用vi,有几点注意要提醒一下:
1、用vi打开文件后,是处于「命令行模式(command mode)」,您要切换到「插入模式(Insert mode)」才能够输入文字。切换方法:在「命令行模式(command mode)」下按一下字母「i」就可以进入「插入模式(Insert mode)」,这时候你就可以开始输入文字了。
2、编辑好后,需从插入模式切换为命令行模式才能对文件进行保存,切换方法:按「ESC」键。
3、保存并退出文件:在命令模式下输入:wq即可!
Popularity: 16% [?]
Tags: vi反向连接不需要网关映射,因此不需要惊动网管大人,这样我就可以从家里(ADSL)连接控制单位局域网中的我的机器…
嘿嘿…坏处就是,两头都要有人…
感谢 pal(小时)蹲在我家里帮忙测试。
ssh 反向连接
如果没有安装 ssh的话,安装之
sudo apt-get install ssh
被控端,执行
ssh -f -N -R 10000:localhost:22 guoshuang@xxx.xxx.xxx.xxx
控制端执行
ssh guoshuang@localhost -p 10000
参考此文
vnc 反向连接
其实只要网关(防火墙)没有关掉 5500 就可以。注意:是5500能出去即可,不是进来,所以一般都是开放的。
sudo apt-get install x11vnc
控制端执行下面命令,等待邀请
vncviewer -listen
被控端,主动发起邀请
x11vnc -connect xxx.xxx.xxx.xxx:5500
参考此文
windows 和 mac 下的软件可参考下文
Free and easy remote access (through firewalls and NAT routers) with VNC reverse connections
内网远程控制全攻略
注意:vncviewer -fullscreen 模式全屏连接 vnc,用 f8 或者 ctrl+esc esc 退出。即便如此,也会经常出现不能退出或者控制失灵的情况,这篇 patch: fix WM bindings for vncviewer -fullscreen 应该有些帮助
或者使用 xvnc4viewer(sudo apt-get install xvnc4viewer)而不是tightvnc viewer。
f8 和窗口控制都没问题。
Popularity: 37% [?]
Tags: blog, hp, install, linux, ls, screen, ubuntu, unix, vitotem 中文字幕问题
感谢 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=cp9362、修改`/.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”
参考资料:
guoshuang2007-11-06+把电影和字幕拖进 Kaffeine 窗口,在设置中 subtiltle 选择编码,中文一般是 gb18030。
Popularity: 27% [?]
Tags: deb, font, gnome, mplayer, ubuntu, vi错误信息 Error opening/initializing the selected video_out(-vo) device!
如果是在终端中敲命令的话
mplayer -vo x11 *.asf
如果用skin的话(必须保证有skin)
修改~.mplayer/gui.conf
找到相关选项,将其该为
vo_driver = “x11″
运行gmplayer
错误信息 Requested audio codec family [mp3] (afm=mp3lib) not available. enable it at compilation
# 開啟 Mplayer
# 在 Mplayer 上按右鍵 選 Preferences
# 切換到Codecs & Demuxer
# 找到 Audio codec family 選擇”FFmpeg/libavcodec audio decoders
# 按OK 重启 gmplayer
修復 Try adding “echo 1024 > /proc/sys/dev/rtc/max-user-freq” to your system startup scripts. 的方法有下列三種:
* echo 1024 > /proc/sys/dev/rtc/max-user-freq
* sysctl dev/rtc/max-user-freq=1024
* /etc/sysctl.conf 加入 dev/rtc/max-user-freq=1024
加了這個後, 若聲音會不同步, 建議就拿掉, 不然就在 mplayer 的 script 加入 -autosync 30 的參數
附上我的 ~/.mplayer/gui.conf 文件内容
enable_audio_equ = “no”
vo_driver = “x11″
vo_panscan = “0.000000″
vo_doublebuffering = “yes”
vo_direct_render = “no”
vo_dxr3_device = “/dev/em8300-0″
v_framedrop = “0″
v_flip = “0″
v_ni = “no”
v_idx = “-1″
a_afm = “ffmpeg”
vf_pp = “no”
vf_autoq = “0″
vf_lavc = “no”
ao_driver = “alsa”
ao_volnorm = “no”
softvol = “no”
ao_surround = “no”
ao_extra_stereo = “no”
ao_extra_stereo_coefficient = “1.000000″
dvd_device = “/dev/dvd”
cdrom_device = “/dev/cdrom”
osd_level = “1″
sub_auto_load = “yes”
sub_unicode = “no”
sub_pos = “100″
sub_overlap = “no”
sub_cp = “cp936″
font_factor = “0.750000″
font_name = “/media/hda1/WINDOWS/Fonts/simsun.ttc”
font_text_scale = “5.000000″
font_osd_scale = “6.000000″
font_blur = “2.000000″
font_outline = “2.000000″
Popularity: 22% [?]
Tags: decode, font, ls, mplayer, vi原文来自 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
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原文来自 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, vii 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