@import url(http://m.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
@import url(http://m.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
$ cat .vmware/config
xkeymap.nokeycodeMap=true
mirror.rootguide.org更新服務器(上海市 電信):
deb http://mirror.rootguide.org/ubuntu/ jaunty main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ jaunty main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu/ jaunty-backports main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ jaunty-backports main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu/ jaunty-security main restricted universe multiverse
deb-src http://mirror.rootguide.org/ubuntu/ jaunty-security main restricted universe multiverse
deb http://mirror.rootguide.org/ubuntu/ jaunty-proposed main multiverse restricted universe
deb-src http://mirror.rootguide.org/ubuntu/ jaunty-proposed main restricted universe multiverse
語言包:
系統-》系統管理-》語言支持-》添加中文
sudo apt-get install scim scim-chinese
sudo apt-get install gnome-do 注意配置成docky類型,這樣就可以達到類似于蘋果的那種效果了。
sudo apt-get install vim-full
sudo apt-cache search sun
sudo apt-get install sun-java6-jdk
sudo apt-get install sun-java6-source
sudo apt-get -y install stardict stardict-common stardict-gnome stardict-plugin
dpkg -l 可以查看安裝了哪些包;
dpkg -L vim 可以查看vim這個包都安裝了哪些東西
關于locale的設定:
http://blog.chinaunix.net/u/7334/showart_353129.html
/////////////////////////////////////////////////////////////////////////
安裝中文支持:
1、安裝中文字體
界面操作:系統--》管理--》language support
采用命令:sudo apt-get install language-pack-gnome-zh language-pack-gnome-zh-base language-pack-zh language-pack-zh-base language-support-zh
2、將中文字體設置為系統默認字體
網上看了一下,說是將以下幾句加到/etc/profile文件中:
LC_ALL=zh_CN.GBK
LC_CTYPE=zh_CN.GBK
LANG=zh_CN.GBK
但是我在通過命令:source /etc/profile使其生效時,報如下錯誤:
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.GBK): No such file or directory
表示字體zh_CN.GBK未找到,后面在網上找了一下,可以通過命令:locale -a,會列出如下內容(不同的機器會有不同):
C
POSIX
en_AG
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NG
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
zh_CN.utf8
zh_HK.utf8
zh_SG.utf8
zh_TW.utf8
這個時候將上面字體設置更改為:
LC_ALL=zh_CN.utf8
LC_CTYPE=zh_CN.utf8
LANG=zh_CN.utf8
再重新使設置生效即可
3、使設置生效
通過source命令使其生效:source /etc/profile
sudo gedit /var/lib/locales/supported.d/local
在文件中添加
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
執行
sudo dpkg-reconfigure –force locales
然后在輸出的結果中會出現
zh_CN.GB2312 done
zh_CN.GBK done
/////////////////////////////////////////////////////////////////////////
字體:
cp字體文件到~/.fonts或者/user/share/fonts下,sudo fc-cache -fv, 在需要的地方選擇新添加的字體即可。
刪除字體也很容易,只要把字體文件刪除掉,然后sudo fc-cache -fv即可。
使用Windows鍵:
點擊“系統”-“首選項”-“鍵盤”,當窗口出現以后切換到到“布局”標簽。點擊“布局選項”按鈕會出現一個對話框,在對話框里面點擊“Alt/Win鍵行為”旁邊的小箭頭,勾選“Super鍵映射到Windows鍵”,關閉所有窗口。
現在就可以使用Windows鍵組合其它鍵定義自己的快捷方式了。
譬如現在可以和Windows一樣定義Win+E來打開Nautilus,打開gconf-editor,找到“/apps/metacity
/keybinding_commands”,雙擊command_1項,在Value輸入框里面輸入“nautilus
computer://”。然后繼續在gconf-editor里面,找到“/apps/metaciy/global_keybindings”,雙擊
“run_command_1”項,在出現的對話框里面輸入“<Super>e”。關閉gconf-editor,按下Win+E,一個
Nautilus就會立刻彈出。
gconf-editor可以定義12個這樣的快捷方式,都可以在“/apps/metacity/keybinding_commands”和“/apps/metaciy/global_keybindings”里面定義。
盡管如此,還是有一些Win組合鍵無法使用。原因不明,但是如果再加上Ctrl或者Alt等組合使用就可以工作了。
另外組合鍵還可以使用“上下左右”等方向鍵,譬如可以使用Windows+Cursor
Left,也可以使用<Home>、<End>、 <Insert>、 <Delete>
和<Pause>,另外Page UP、Page Down和Scroll
Lock必須寫成Page_UP、Page_Down和Scroll_Lock。
說明:<Mod4>是win左鍵做組合鍵
VMWare有一個問題,guest os 的聲卡和Master os的聲卡會沖突。比如說當master
os在聽歌的時候,如果guest os需要發出聲音,VMWare就會報一個錯誤:
failed to open sound device /dev/dsp:
device or resource busy
解決的方法是使用oss。
參考ubuntu的做法:
1. su
2. 輸入root密碼
3. aptitude install alsa-oss
4. chmod +s /usr/lib/libaoss.so.*
5. cd
/usr/lib/vmware/bin/
6. mv vmware-vmx vmware-vmx.real
7. echo '#!/bin/bash' > vmware-vmx
8. echo 'LD_PRELOAD=libaoss.so exec
/usr/lib/vmware/bin/vmware-vmx.real "$@"' >> vmware-vmx
9. chmod +x vmware-vmx
就可以解決這個問題了。
開發環境搭建:
sudo apt-get install build-essential binutils-doc cpp-doc gcc-doc glibc-doc libstdc++6-4.3-doc stl-manual manpages manpages-dev manpages-posix manpages-posix-dev
測試一下:
c:
man strncasecmp
c++:
man std::string
posix:
man stdlib.h
sudo apt-get install nautilus-gksu nautilus-open-terminal nautilus-image-converter nautilus-wallpaper
http://g-scripts.sourceforge.net/
安裝wine,ie,阿里旺旺
sudo apt-get install wine cabextract
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
在使用vi打開文件前忘記加sudo了,依然能夠保存的方法: w !sudo tee %
Ubuntu中使用framebuffer的方法:
打開/etc/initramfs-tools/modules文件,在末尾加上:
fbcon
vesafb
打開/etc/modprobe.d/blacklist-framebuffer,找到“blacklist vesafb”一行,在這一行前面加上“#”把它注釋掉。
打開/boot/grub/menu.lst,找到相應的kernel一行,加上vga參數。例如我把分辨率設置為1024x768,對應的vga數值就是0x317。
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=3c51a0d7-d373-473b-830e-225b6d7aafdf ro quiet splash vga=0x317
最后執行:sudo update-initramfs -u更新,重啟一下。如果你禁用了圖形界面登陸,應該就能看到漂亮一些的字符界面了;如果沒有禁用,可以在桌面環境中按Ctrl+Alt+F1 ~ F6看看效果,按Ctrl+Alt+F7返回桌面環境。
firefox安裝vimperator后,配置文件:
" 解決全選、復制、粘帖、剪切和撤銷與vimperator沖突的問題,在/home/yourname/.vimperatorrc
noremap <C-V> <C-v>
noremap <C-Z> <C-z>
noremap <C-c> <C-v><C-c>
noremap <C-a> <C-v><C-a>
cnoremap <C-c> <C-v><C-c>
cnoremap <C-v> <C-v><C-v>
cnoremap <C-x> <C-v><C-x>
inoremap <C-a> <C-v><C-a>
inoremap <C-c> <C-v><C-c>
inoremap <C-v> <C-v><C-v>
inoremap <C-x> <C-v><C-x>
inoremap <C-z> <C-v><C-z>
inoremap <C-y> <C-v><C-y>
" 還原我的書簽欄和下載對話框快捷鍵
noremap <C-b> <C-v><C-b>
noremap <C-y> <C-v><C-y>
" 還原 ctrl-k 跳到搜索欄的快捷鍵
noremap <C-k> <C-v><A-d><Tab>
set editor=gvim" -f
set go=mTB
在vimperator中隨意切換tab的方法有以下幾種:
g0:切換到第一個tab
g$:切換到最后一個tab
Ngt/NCtrl+^:切換到第N個tab
Ctrl+^:在上一次瀏覽過的tab之間作switch
gt/T:切換到下/上一個tab
Ctrl+n/p:切換到下/上一個tab
:b N:切換到第N個tab
:B:列出所有的tab
允許root用戶登錄的方法:修改/etc/gdm/gdm.conf中AllowRoot=true即可
安裝conky:
需要附加軟件devilspie的支持,因此先用apt-get安裝它們,然后
配置~/.conkyrc為:
# vim: syntax=conkyrc
# set to yes if you want Conky to be forked in the background
background no
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
#font 6x10
#font 7x13
#font 8x13
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -misc-simsun-medium-r-normal-*-12-*-*-*-c-*-gb18030.2000-0
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont monospace:pixelsize=10
#xftfont
own_window_transparent yes
own_window_colour brown
# Text alpha when using Xft
xftalpha 1
on_bottom yes
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 1
# Create own window instead of using desktop (required in nautilus)
own_window yes
#own_window_type desktop
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
#minimum_size 280 5
maximum_width 320
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
override_utf8_locale
# Stippled borders?
stippled_borders 10
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white
# Text alignment, other possible values are commented
#alignment top_left
#minimum_size 10 10
#gap_x 1259
#gap_y 36
alignment top_right
#alignment top_left
#alignment bottom_right
# Gap between borders of screen and text
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer no
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# boinc (seti) dir
# seti_dir /opt/seti
# Possible variables to be used:
#
# Variable Arguments Description
# acpiacadapter ACPI ac adapter state.
# acpifan ACPI fan state
# acpitemp ACPI temperature.
# adt746xcpu CPU temperature from therm_adt746x
# adt746xfan Fan speed from therm_adt746x
# battery (num) Remaining capasity in ACPI or APM
# battery. ACPI battery number can be
# given as argument (default is BAT0).
# buffers Amount of memory buffered
# cached Amount of memory cached
# color (color) Change drawing color to color
# cpu CPU usage in percents
# cpubar (height) Bar that shows CPU usage, height is
# bar's height in pixels
# downspeed net Download speed in kilobytes
# downspeedf net Download speed in kilobytes with one
# decimal
# exec shell command Executes a shell command and displays
# the output in torsmo. warning: this
# takes a lot more resources than other
# variables. I'd recommend coding wanted
# behaviour in C and posting a patch :-).
# execi interval, shell Same as exec but with specific interval.
# command Interval can't be less than
# update_interval in configuration.
# fs_bar (height), (fs) Bar that shows how much space is used on
# a file system. height is the height in
# pixels. fs is any file on that file
# system.
# fs_free (fs) Free space on a file system available
# for users.
# fs_free_perc (fs) Free percentage of space on a file
# system available for users.
# fs_size (fs) File system size
# fs_used (fs) File system used space
# hr (height) Horizontal line, height is the height in
# pixels
# i2c (dev), type, n I2C sensor from sysfs (Linux 2.6). dev
# may be omitted if you have only one I2C
# device. type is either in (or vol)
# meaning voltage, fan meaning fan or temp
# meaning temperature. n is number of the
# sensor. See /sys/bus/i2c/devices/ on
# your local computer.
# kernel Kernel version
# loadavg (1), (2), (3) System load average, 1 is for past 1
# minute, 2 for past 5 minutes and 3 for
# past 15 minutes.
# machine Machine, i686 for example
# mails Mail count in mail spool. You can use
# program like fetchmail to get mails from
# some server using your favourite
# protocol. See also new_mails.
# mem Amount of memory in use
# membar (height) Bar that shows amount of memory in use
# memmax Total amount of memory
# memperc Percentage of memory in use
# new_mails Unread mail count in mail spool.
# nodename Hostname
# outlinecolor (color) Change outline color
# pre_exec shell command Executes a shell command one time before
# torsmo displays anything and puts output
# as text.
# processes Total processes (sleeping and running)
# running_processes Running processes (not sleeping),
# requires Linux 2.6
# shadecolor (color) Change shading color
# stippled_hr (space), Stippled (dashed) horizontal line
# (height)
# swapbar (height) Bar that shows amount of swap in use
# swap Amount of swap in use
# swapmax Total amount of swap
# swapperc Percentage of swap in use
# sysname System name, Linux for example
# time (format) Local time, see man strftime to get more
# information about format
# totaldown net Total download, overflows at 4 GB on
# Linux with 32-bit arch and there doesn't
# seem to be a way to know how many times
# it has already done that before torsmo
# has started.
# totalup net Total upload, this one too, may overflow
# updates Number of updates (for debugging)
# upspeed net Upload speed in kilobytes
# upspeedf net Upload speed in kilobytes with one
# decimal
# uptime Uptime
# uptime_short Uptime in a shorter format
#
# seti_prog Seti@home current progress
# seti_progbar (height) Seti@home current progress bar
# seti_credit Seti@hoome total user credit
#variable is given either in format $variable or in ${variable}. Latter
#${color lightgrey}Temperatures:
# CPU:$color ${i2c temp 2}C${color grey} - MB:$color ${i2c temp 1}C
# allows characters right after the variable and must be used in network
# stuff because of an argument
#${font Dungeon:style=Bold:pixelsize=10}I can change the font as well
#${color #ddaa00}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar}
#${font Verdana:size=10}as many times as I choose
#${font Perry:size=10}Including UTF-8,
#${font Luxi Mono:size=10}justo como este texto que o google traduz fêz o português
#${color #ddaa00}${time %a, %d %b}${alignr}${time %k:%M:%S}
# stuff after 'TEXT' will be formatted on screen
# ${color black}${cpugraph 000000 5000a0}
TEXT
${color #ddaa00}${font YaHei Consolas Hybrid:pixelsize=20}${time %Y年 %m月 %d日 星期 %u}${font}
${color #8811ee}${font YaHei Consolas Hybrid:pixelsize=50}${alignr}${time %H:%M}${font}
${color #88aadd}${hr 1}
${color #ddaa00}${font Verdana:size=10}$nodename - $sysname $kernel on $machine
${color #88aadd}${hr 1}
${color #ddaa00}${font Verdana:size=10}Uptime:${goto 85}$color $uptime ${color #ddaa00}${goto 168} Load:$color $loadavg
${color #ddaa00}${font Verdana:size=10}CPU Usage:${goto 85}${color lightgrey} ${cpu}% ${color #5000a0}${cpubar}
${color #ddaa00}${font Verdana:size=10}RAM Usage:${goto 85}$color $mem/$memmax - $memperc% ${color #5000a0}$membar
${color #ddaa00}${font Verdana:size=10}Processes:${goto 85}$color $processes ${color #ddaa00}${goto 168} Running:$color $running_processes
${color #ddaa00}${font Verdana:size=10}File systems:
${color #ddaa00}/${goto 45}$color${fs_used /}/${fs_size /}${goto 165}${color #5000a0}${fs_bar /}
${color #ddaa00}home${goto 45}$color${fs_used /home}/${fs_size /home}${goto 165}${color #5000a0}${fs_bar /home}
${color #ddaa00}${font Verdana:size=10}Disk I/O:
${color green} Read:${color #8844ee} ${diskio_read} ${color green} ${goto 172}Write:${color #22ccff} ${diskio_write}
${color black}${diskiograph_read 20,150 ff0000 0000ff} $alignr${color black}${diskiograph_write 20,150 0000ff ff0000}
${color #88aadd}${hr 1}
${color #ddaa00}${font Verdana:size=10}Networking:
${color green} Down:${color #8844ee} ${downspeed wlan0} k/s${color green} ${goto 172}Up:${color #22ccff} ${upspeed wlan0} k/s
${color black}${downspeedgraph wlan0 20,150 ff0000 0000ff} $alignr${color black}${upspeedgraph wlan0 20,150 0000ff ff0000}
${color #88aadd}${hr 1}
${color #ddaa00}${font Verdana:size=10}Name${goto 128}${font Verdana:size=10}PID${goto 192}${font Verdana:size=10}CPU%${goto 256}${font Verdana:size=10}MEM%
${color #ddaa00}${font Verdana:size=10}Top CPU Usage
${color white}${top name 1}${goto 128}${top pid 1}${goto 192}${top cpu 1}${goto 256}${top mem 1}
${color #c4c4c4}${top name 2}${goto 128}${top pid 2}${goto 192}${top cpu 2}${goto 256}${top mem 2}
${color #a3a3a3}${top name 3}${goto 128}${top pid 3}${goto 192}${top cpu 3}${goto 256}${top mem 3}
${color #ddaa00}${font Verdana:size=10}Top Mem Usage
${color #e5dde5}${top_mem name 1}${goto 128}${top_mem pid 1}${goto 192}${top_mem cpu 1}${goto 256}${top_mem mem 1}
${color #c4c4c4}${top_mem name 2}${goto 128}${top_mem pid 2}${goto 192}${top_mem cpu 2}${goto 256}${top_mem mem 2}
${color #a3a3a3}${top_mem name 3}${goto 128}${top_mem pid 3}${goto 192}${top_mem cpu 3}${goto 256}${top_mem mem 3}
再配置.devilspie/conky.ds為:
(if
(is (window_class) "Conky")
(begin
(pin)
(below)
(wintype "dock")
(undecorate)
(skip_pager)
(skip_tasklist)
)
)
此外,還需要讓conky和devilspie開機即啟動,可以通過系統—>首選項—>會話來設置。
下面再給出一個devilspie應用的例子,可以把啟動的窗口自動分配到第幾個桌面,注意,在ubuntu 9.04以下的版本中,為了讓第幾個桌面被正常的找到,需要將外觀中的特效設置成無的狀態。
./devilspie/workspace.ds:
(begin
(if
(or
(matches (window_class) "OpenOffice.org*")
(matches (application_name) "eclipse")
(is (application_name) "Document Viewer")
)
(begin
(set_workspace 1)
)
)
(if
(or
(is (window_class) "Firefox")
(is (window_class) "Evolution")
)
(begin
(set_workspace 2)
)
)
(if
(or
(is (window_class) "Audacious")
(is (window_class) "Realplay.bin")
(is (window_class) "Smplayer")
(is (window_class) "MPlayer")
(is (window_class) "Totem")
(is (window_class) "Gmlive")
(is (window_class) "Linux-fetion")
)
(begin
(set_workspace 3)
)
)
(if
(or
(is (window_class) "VirtualBox")
(is (window_class) "Vmplayer")
)
(begin
(set_workspace 4)
)
)
)
仿照上述例子,你也可以寫一個屬于自己定制的腳本了,這里再告訴你如何獲取諸如window-class以及application-name之類的東西:
echo 'debug' > ~/.devilspie/debug.ds,然后在命令行啟動devilspie,再打開一個程序,比如QQ,那么你會看到在終端里打印出來了QQ這個程序相關的各種諸如window-class以及name的信息。
xwininfo命令可以查看當前某個窗口程序的幾何參數;xlsclients -l可以查看當前有哪些窗口程序在運行。
$ cat .devilspie/conky.ds
(if
(is (window_class) "Conky")
(begin
(pin)
(below)
(wintype "dock")
(undecorate)
(skip_pager)
(skip_tasklist)
)
)
$ cat .devilspie/Termnial.ds
/* This is the configuration for Terminal */
(if (is (application_name) "Terminal")
(begin
(below)
(undecorate)
(skip_pager)
(skip_tasklist)
(wintype "utility")
(geometry "1057x2000+0+0")
)
)
硬盤安裝ubuntu或者其他操作系統:
在grub的menu.lst文件中加入:
title Ubuntu 9.10
root (hd1,7)
kernel /ubuntu9_10/vmlinuz boot=casper iso-scan/filename=/ubuntu9_10/ubuntu-9.10-desktop-i386.iso quiet splash rw
initrd /ubuntu9_10/initrd.lz
注意grub只能認識fat32以及ext類型的分區,不能識別ntfs,因此上述文件不能放到ntfs分區; vmlinuz和initrd.lz這兩個文件是從iso中提取出來的
如果遇到“不能卸載以下掛載點”之類的問題,那么就用下面的命令搞定:
sudo umount -l /isodevice