本来希望能通过google notebook的share功能来分享的,不知什么原因无法使用该功能。
所以只能这样了,内容比较杂
|
https://help.ubuntu.com/community/Grub2
http://iitdu.forumsmotion.com/t699-changing-the-ubuntu-boot-splash-screen
Changing the Ubuntu boot splash screen
by BIT0103-Ovid on Sat Jun 19, 2010 1:12 am
Ubuntu uses the Plymouth theme for the boot up splash screen. In order to get a new look you need to install some new themes.
1. Go to synaptic package manager.
2. Search by typing plymouth and you will find some new themes . Install some of those.
3. Now open the terminal and paste the following:
-
Code: Select All
-
sudo update-alternatives --config default.plymouth
4. Choose your theme and then restart the PC.
5. Have fun [You must be registered and logged in to see this image.]
http://opensuse.swerdna.org/susentfs.html
Permissions and Ownership on NTFS Partitions
The NTFS filesystem does not support Linux permissions or ownership per se. You can't successfully change ownership with the Linux command chown and you can't successfully change permissions with the Linux command chmod. Ownership and permissions are set only in the mount command.
The permissions and ownership properties that are available for NTFS under Linux are not written into the individual files to be retained when the filesystem is unmounted or the computer is turned off. Permissions and ownership obtained under Linux are temporary artifices imposed via the mount command and maintained temporarily by the operating system. They are transient properties that last only until the NTFS partition is unmounted.
http://www.tonyspencer.com/2007/03/02/setup-a-subversion-server-in-4-minutes/
1. Create a Repository
svnadmin create /svnrepos
2. Create a SVN User
vi /svnrepos/conf/svnserve.conf
In that file add these three lines:
anon-access = none auth-access = write password-db = passwd
Create a password file:
vi /svnrepos/conf/passwd
In that file add a line for your user:
# add users in the format : user = password tony = mypassword
3. Import Your Project
(assuming you’ve put your project files in /projects/myrailsproject)
svn import /projects/myrailsproject file:///svnrepos/myrailsproject
4. Start the SVN Server as Daemon
svnserve -d
Done! You should now have a svn server running with one project named myrailsproject.
Try checking it out of the repository:
svn co svn://192.168.0.2/svnrepos/myyrailsproject
the import step is not really necessary
http://www.uml.org.cn/pzgl/200910239.asp
client&server, linux&windows
http://www.cyberciti.biz/faq/linux-partition-howto-set-labels/
Display current label
If the optional argument new-label is not present, e2label will simply display the current filesystem label.$ sudo e2label /dev/sda1
or# e2label /dev/sda1
Sample output:
/boot
Set a new label
If the optional argument new-label is present, then e2label will set the filesystem label to be new-label. Ext2 filesystem labels can be at most 16 characters long; if new-label is longer than 16 characters, e2label will truncate it and print a warning message. To set a new label, enter:# e2label /dev/sdb2 usbstroage
It is also possible to set the filesystem label using the -L option of tune2fs, enter:# tune2fs -L usbstroage /dev/sdb2
http://apps.hi.baidu.com/share/detail/32415223
支持 7Z,ZIP,Zip64,CAB,RAR,ARJ,GZIP,BZIP2,TAR,CPIO,RPM,ISO,DEB 压缩文件格式
安装: sudo apt-get install p7zip p7zip-full p7zip-rar
http://bbs.chromi.org/thread-6829-1-1.html
sudo gedit /etc/bash.bashrc
在此文件末尾添加
PATH=/usr/local/texlive/2010/bin/i386-linux:$PATH; export PATH
MANPATH=/usr/local/texlive/2010/texmf/doc/man:$MANPATH; export MANPATH
INFOPATH=/usr/local/texlive/2010/texmf/doc/info:$INFOPATH; export INFOPATH
在 /etc/manpath.config 文件的
# set up PATH to MANPATH mapping
这行下面的列表后增加一条:
MANPATH_MAP /usr/local/texlive/2010/bin/i386-linux /usr/local/texlive/2010/texmf/doc/man
至此安装过程结束。
5. 配置中文
Run fc-cache -fsv.
b. 获取中文字体:simfang.ttf simhei.ttf simkai.ttf simli.ttf simsun.ttc simyou.ttf
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\begin{document}
你好,TeX Live 2009!
\end{document}
\begin{document}
你好,TeX Live 2010!\\
{\songti 这是宋体}\\
{\heiti 这是黑体}\\
{\fangsong 这是仿宋}\\
{\kaishu 这是楷书}\\
{\lishu 这是隶书}\\
{\youyuan 这是幼圆}\\
\end{document}
http://www.linuxidc.com/Linux/2010-05/25875.htm
1、在Windows7中下载并安装EasyBCD_1.7.2
2、将 Ubuntu-10.04-desktop-i386.iso文件复制到C盘根目录,用压缩软件打开,再打开casper目录,把initrd.lz、 vmlinuz二个文件解压到C盘根目录下。
3、运行EasyBCD_1.7.2进入操作窗口后,
点Add/Remove Entries
再点右下边的NeoGrub
再点Install NeoGrub
再点Save
选中NeoGrub Bootloader,再点Configure
4、在出现menu.lst记事本窗口中输入以下内容并保存:
kernel /vmlinuz iso-scan/filename=/ Ubuntu-10.04-desktop-i386.iso boot=casper splash
initrd /initrd.lz
boot
5、电脑重启后,就会发现启动菜单会多了一项NeoGrub Bootloader,选择后会进入Ubuntu 10.04光盘系统。按快捷键运行(Alt+F2),在运行框内输入:
最后点桌面上的Ubuntu安装图标及可开始正常安装
http://hi.baidu.com/xlf5563/blog/item/c26748d90820216dd1164ef3.html
|
http://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/
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 |
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 |
Ctrl + R | Let’s you search through previously used commands |
Ctrl + C | Kill whatever you are running |
Ctrl + D | Exit the current 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 |
Tab | Auto-complete files and folder names |
http://blog.csdn.net/sibylle/archive/2008/01/05/2026915.aspx
数组可以用一个列值来初始化,例如
int v1[] ={1,2,3,4};
char v2[]={'a','b','c',0};
当数组定义时没有指定大小,当初始化采用列表初始化了,那么数组的大小由初始化时列表元素个数决定。所以v1和v2分别为 int[4] 和char[4]类型。如果明确指定了数组大小,当在初始化时指定的元素个数超过这个大小就会产生错误。例如:
char v3[2] ={'a','b',0}; //错误:太多的初始化值了
char v3[3] ={'a','b',0}; //正确
如果初始化时指定的的元素个数比数组大小少, 剩下的元素都回被初始化为 0。例如
int v5[8]={1,2,3,4};
等价于
int v5[8]={1,2,3,4,0,0,0,0};
http://blog.csdn.net/chaiqi/archive/2007/03/05/1521276.aspx
内容查找(递归)
grep /etc/httpd/modules/ -lr '51ditu' *
文件名查找(递归,不适合查找modules)
find /etc/httpd/ -name httpd.conf
http://harddisc.bokee.com/5277954.html
在LaTex中的注释有3种:
1. 用%注释一行文字, 在%后的文字都不予编译;
2. 用\iffalse .... \fi 包含一段文字, 被包含的文字被注释掉了;
3. 用\begin{comment} ... \end{comment} 包含被注释的文字, 但是需要在引言区包括相应的宏包, 即 \usepackage{verbatim}.
http://www.ai7.org/wp/html/24.html
LaTeX中注释大块代码的方法
with 3 comments
在LaTeX中,因为只有行注释符“%”,所以,当有大块代码需要注释时,就比较麻烦。可以采用如下的方法:
\iffalse %注释开始
%需要注释掉的内容
……..
\fi %注释结束
其实是条件语句,只不过把条件设置成总是假,当然就等于注释掉了。
http://www.linuxdiyf.com/viewarticle.php?id=55053
dvipdfm-cjk-cmap dvipdfm-cjk dvipdfm texmf-zh gbkfonts gs-cjk-resource,最好还有texlive的那一部分,反正我是装了的。
二、然后是那几个sim的字体,最好把它安装在你的Debian里面(我的Debian安了好几个漂亮的字体,当然包括这几个基本的sim字体)。
接下来,去王垠那下载gbkfonts,主要是那个静态链接文件,直接把它放在/usr/bin里面,然后你就可以生成字体了:
$mkdir texmf-local
$cd texmf-local
$gbkfonts /usr/share/fonts/truetype/microsoft/simsun.ttf song
$gbkfonts /usr/share/fonts/truetype/microsoft/simhei.ttf hei
...
那几个sim字体都这样处理,这个过程最好是普通用户的权限来执行。
三、下面为dvips设置字体
$mkdir dvips/config
$mv cjk.map dvips/
$cp /usr/share/texmf/dvips/config/config.* dvips/config/
添加一个文件config.cjk,内容是p +cjk.map
四、pdftex设置字体
这时,我的pdftex字体已经可以了,如果你的还不行的话,按下面的做:
$cp /usr/share/texmf/pdftex/config/pdftex.cfg pdftex/config/
$cat pdftex.cfg >> pdftex/config/pdftex.cfg
五、更新字体数据库
换root来做:
#cp -r texmf-local /usr/local/share/texmf
#mkdir /usr/local/share/texmf/fonts/truetype
#cd /usr/local/share/texmf/fonts/truetype
#cp /usr/share/fonts/truetype/microsoft/sim* ./
当然,这里的最后一步,你也可以用软链接来做,ln -s 。
这时我的字体已经解决了,如果你还没有解决,那么继续:
把刚才产生的字体目录移动到配置文件(/etc/texmf/texmf.cnf)指定的字体目录下,如果需要放在别的路径下,也可以修改配置文件。另一个默认的路径是 $HOME/texmf。
最后,这一步是必须的,用root执行mktexlsr,更新字体数据库。
六、开始测试吧。
http://wiki.ubuntu.org.cn/index.php?title=%E6%8C%82%E8%BD%BDWindows%E5%88%86%E5%8C%BA&variant=zh-hant
- 創建一個掛載點(目錄),你將通過這個掛載點訪問windows分區。Ubuntu缺省在/media目錄下創建所有文件系統的掛在點。
mkdir /media/partitionname
- 掛載相應的分區到這個掛載點。所有的分區可以在/dev下查看, 每一個分區都有一個唯一的標號,普通硬盤以"hd"開頭,SCSI或SATA硬盤以"sd"開頭,後面跟着字母a,b等標示該分區位於第幾個硬盤上,最後面是數字1,2等表示該分區是第幾個分區。 (例如:第一個IDE接口的主硬盤表示為hda,它的第一個分區表示為hda1;第一個IDE口的從盤表示為hdb)。在多重啟動的系統里,windows的C分區一般為/dev/hda1。
- FAT 分區可以像下面一樣掛載
sudo mount /dev/hda1 /media/partitionname -t vfat -o iocharset=utf8,umask=000
-
- NTFS 分區可以像下面一樣掛載
sudo mount /dev/hda1 /media/partitionname -t ntfs -o nls=utf8,umask=0222
-
-
- 注意:你只能從NTFS分區上讀數據,不能進行寫操作。
- 若要在系統啟動的時候自動掛載分區,可以編輯文件/etc/fstab,為你想掛載的分區添加一行代碼,內容如下:
- FAT 分區:
-
/dev/hda1 /media/partitionname vfat iocharset=utf8,umask=000 0 0
-
- NTFS 分區:
/dev/hda1 /media/partitionname ntfs nls=utf8,umask=0222 0 0
安装Fcitx输入法
sudo apt-get remove ibus
sudo add-apt-repository ppa:wengxt/fcitx-nightly
sudo apt-get update
sudo apt-get install fcitx
im-switch -s fcitx -z default
使用软件管理安装的是3.6版本,有些问题,这里安装的是4.0版本,五笔输入法可以用软件管理安装相应table,新手可以选wbpy,熟练者可以选wubi
http://www.novell.com/coolsolutions/tip/2289.html
FOR GNOME:
General Shortcut Keys
Alt + F1 |
Opens the Applicantions Menu . |
Alt + F2 |
Displays the Run Application dialog. |
Print Screen |
Takes a screenshot. |
Alt + Print Screen |
Takes a screenshot of the window that has focus. |
Ctrl + Alt + right arrow |
Switches to the workspace to the right of the current workspace. |
Ctrl + Alt + left arrow |
Switches to the workspace to the left of the current workspace. |
Ctrl + Alt + up arrow |
Switches to the workspace above the current workspace. |
Ctrl + Alt + down arrow |
Switches to the workspace below the current workspace. |
Ctrl + Alt + d |
Minimizes all windows, and gives focus to the desktop. |
F1 |
Starts the online help browser, and displays appropriate online Help. |
Window Shortcut Keys
Alt + Tab |
Switches between windows. When you use these shortcut keys, a list of windows that you can select is displayed. Release the keys to select a window. |
Alt + Esc |
Switches between windows in reverse order. Release the keys to select a window. |
F10 |
Opens the first menu on the left side of the menubar. |
Alt + spacebar |
Opens the Window Menu . |
Arrow keys |
Moves the focus between items in a menu. |
Return |
Chooses a menu item. |
Esc |
Closes an open menu. |
Ctrl + Alt + right arrow |
Switches to the workspace to the right of the current workspace. |
Ctrl + Alt + left arrow |
Switches to the workspace to the left of the current workspace. |
Ctrl + Alt + up arrow |
Switches to the workspace above the current workspace. |
Ctrl + Alt + down arrow |
Switches to the workspace below the current workspace. |
Ctrl + Alt + d |
Minimizes all windows, and gives focus to the desktop. |
Panel Shortcut Keys
Ctrl + Alt + Tab |
Switches the focus between the panels and the desktop. When you use these shortcut keys, a list of items that you can select is displayed. Release the keys to select an item. |
Ctrl + Alt + Esc |
Switches the focus between the panels and the desktop. Release the keys to select an item. |
Ctrl + F10 |
Opens the popup menu for the selected panel. |
Tab |
Switches the focus between objects on a panel. |
Return |
Chooses the selected panel object or menu item. |
Shift + F10 |
Opens the popup menu for the selected panel object. |
Arrow keys |
Moves the focus between items in a menu. Moves the focus between interface items in an applet also. |
Esc |
Closes an open menu. |
F10 |
Opens the Applications menu from the Menu Bar , if the Menu Bar is in a panel. |
Application Shortcut Keys
Shortcut Keys |
Command |
---|---|
Ctrl + N |
New |
Ctrl + X |
Cut |
Ctrl + C |
Copy |
Ctrl + V |
Paste |
Ctrl + Z |
Undo |
Ctrl + S |
Save |
Ctrl + Q |
Quit |
FOR KDE:
Alt-F2 |
Execute Command |
Ctrl - B |
Add Bookmark |
Ctrl-Esc |
List of running applications. |
Ctrl - W |
Close |
Alt-Tab |
Switch forward among windows |
Ctrl - C |
Copy |
Alt-Shift-Tab |
Switch backward among windows |
Ctrl - End |
End |
Ctrl - F1 to F12 |
Switch to Desktop 1 - 12 |
Ctrl - F |
Find |
Shift-Ctrl-F1 to F4 |
Switch to Desktop 13 to 16 |
F3 |
Find Next |
Ctrl-Alt-Esc |
Kill Window (Click on the window to action the kill.) |
Ctrl - F3 |
Find Prev |
Ctrl-Alt-Delete |
Logout (To complete logout process, Tab & Enter) |
F1 |
Help |
F12 |
Toggle cursor key mouse emulation |
Ctrl - Home |
Home |
Alt - F1 |
Popup KDE launch menu |
Ctrl - Insert |
Insert |
Ctrl-Tab |
Switch forward one desktop |
Ctrl - N |
New |
Ctrl-Shift-Tab |
Switch back one desktop |
Ctrl - Down |
Next Complete Match |
Alt - F4 |
Window close |
Down |
Next Item in List |
Alt - F3 |
Window open menu |
Ctrl - O |
Open |
Ctrl - V |
Paste |
"Windows" Menu |
Popup Menu Context |
Ctrl - Up |
Previous Complete Match |
Up |
Previous Item in list |
Ctrl - P |
|
Page Up |
Prior |
Ctrl - Q |
Quit |
Ctrl-Shift-Z |
Redo |
F5 |
Reload |
Ctrl - R |
Replace |
Ctrl - S |
Save |
Ctrl - A |
Select All |
Ctrl - E |
Text Completion |
Ctrl - Z |
Undo |
Shift - F1 |
What's this |
Ctrl - Plus (+) |
Zoom In |
Ctrl - Minus (-) |
Zoom Out |
http://www.cxybase.com/201011/vim%E4%B8%AD%E6%B3%A8%E9%87%8A%E6%8F%92%E4%BB%B6%EF%BC%9Athe-nerd-commenter/
http://www.cnblogs.com/jianyungsun/archive/2011/02/14/1954033.html
http://blog.csdn.net/wooin/archive/2007/10/31/1858917.aspx
http://blogold.chinaunix.net/u2/80377/showart_2235899.html
rename 的典型应用:
0. 批量更改文件扩展名
$ rename ’s/\.txt/\.ext/’ *
1. 批量删除文件扩展名
$ rename ’s/\.txt//’ *
2. 批量添加文件扩展名
$ rename ’s/$/\.txt/’ *
3. 按自己的方式批量重命名文件
$ rename ’s/(\d)/第$1 章/’ *
$ rename s/_/-/ *.jpg #修改所有的包含_的.jpg文件中的_为-
http://ubuntuforums.org/showthread.php?t=62687
gnome-keybinding-properties
http://blog.csdn.net/omohe/archive/2007/11/23/1899910.aspx
http://ubuntuforums.org/showthread.php?t=218626
Anyway, due to specialization rules, the compiler can't actually assume that any inherited memebers exist in a templated base class.
I could do something like this:
templateclass Base { public: bool isFoo() const { // something about foo } bool isBar() const { // something about bar } }; template<> class Base { public: // don't define isFoo bool isBar() const { // something about bar } };
templateclass Child : public Base { public: bool doTest() const { isFoo(); } }
As such, all names in a templatized base class are hidden. There are three solutions:
- Use this-> to implicitly note that the member is inherited
- Use a using declaration to import the function from the base class scope
- Use an explict scope declaration. This is undesirible for virtuals because it kills dynamic binding but is mandatory in a few situations, mainly accessing the base constructor in an initialization list.
http://blog.csdn.net/fox000002/archive/2008/04/08/2260949.aspx
(1) 下载 glut 库。
http://www.xmission.com/~nate/glut.html
(2) 将 glut.h 添加到 /path/to/mingw/inclu de/GL/ 目录下。
这里使用 mingw 自带的 libglut32.a,所以只需要添加头文件就可以了。
(3) 设定编译选项。
a 连接到需要的库文件
-lopengl32 -lglu32 -lglut32
b 修正 undefined reference 错误
错误提示为:
... ...解决方法:
xxx: undefined reference to `__glutInitWithExit@12'
xxx: undefined reference to `__glutCreateWindowWithExit@8'
xxx: undefined reference to `__glutCreateMenuWithExit@8'
... ...
完整的编译命令如下:
-DGLUT_DISABLE_ATEXIT_HACK -lopengl32 -lglu32 -lglut32
命令太长,写成 Makefile 就可以方便很多了。
当然,你也可以在源代码中添加
#define _M_IX86
#define GLUT_DISABLE_ATEXIT_HACK
http://vim.wikia.com/wiki/Converting_tabs_to_spaces
To insert space characters whenever the tab key is pressed, set the 'expandtab' option:
:set expandtab
With this option set, if you want to enter a real tab character use Ctrl-V
To control the number of space characters that will be inserted when the tab key is pressed, set the 'tabstop' option. For example, to insert 4 spaces for a tab, use:
:set tabstop=4
After the 'expandtab' option is set, all the new tab characters entered will be changed to spaces. This will not affect the existing tab characters. To change all the existing tab characters to match the current tab settings, use:
:retab
To change the number of space characters inserted for indentation, use the 'shiftwidth' option:
:set shiftwidth=4
For example, to get the following coding style,
- No tabs in the source file.
- All tab characters are 4 space characters.
use the following set of options:
:set tabstop=4 :set shiftwidth=4 :set expandtab
Add the above settings to your vimrc.
http://www.linuxidc.com/Linux/2007-12/9522.htm
Unix/Linux下一般比如想让某个程序在后台运行,很多都是使用 & 在程序结尾来让程序自动运行。比如我们要运行mysql在后台:
/usr/local/mysql/bin/mysqld_safe --user=mysql &
但是加入我们很多程序并不象mysqld一样做成守护进程,可能我们的程序只是普通程序而已,一般这种程序使用 & 结尾,
但是如果终端关闭,那么程序也会被关闭。
但是为了能够后台运行,那么我们就可以使用nohup这个命令,比如我们有个test.php需要在后台运行,并且希望在后台能够定期运行,
那么就使用nohup:
nohup /root/test.php &
提示:
[1] 54470
[~]$ appending output to nohup.out
嗯,证明运行成功,同时把程序运行的输出信息放到当前目录的 nohup.out 文件中去。
http://www.xker.com/page/e2007/1018/36318.html
在 fstab 中用 UUID 挂载分区,看起来向这样:
UUID=1234-5678 /mnt/usb vfat utf8,umask=0 0 0
在 UUID= 后面填入分区相应的 UUID 值,就可以正确挂载分区了。
那么,我们如何知道一个分区的 UUID 呢?
有 3 种方法:
1. 通过浏览 /dev/disk/by-uuid/ 下的设备文件信息。
# ls -l /dev/disk/by-uuid/
------
lrwxrwxrwx 1 root root 10 10-13 09:14 0909-090B -> http://www.cnblogs.com/sdb5
lrwxrwxrwx 1 root root 10 10-13 09:13 7c627a81-7a6b-4806-987b-b5a8a0a93645 -> http://www.cnblogs.com/sda4
.....
2. 通过 vol_id 命令。
# vol_id /dev/sdb5
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT32
ID_FS_UUID=0909-090B
ID_FS_UUID_ENC=0909-090B
ID_FS_LABEL=SWAP
ID_FS_LABEL_ENC=SWAP
ID_FS_LABEL_SAFE=SWAP
3. 通过 blkid 命令
# blkid /dev/sdb5
/dev/sdb5: LABEL="SWAP" UUID="0909-090B" TYPE="vfat"
通过这三种方法都可以获得分区的 UUID,UUID 依据分区不同,长度和格式都不相同。
http://www.cyberciti.biz/faq/howto-change-my-hostname-machine-name/
Linux change my hostname / computer system name
by Vivek Gite on July 26, 2007 · 2 comments
Q. I’m using Ubuntu Linux. How do I change my hostname or the machine name?
A.. You need to use hostname command, which is used to either set or display the current host or domain name of the system. This name is used by many of the networking programs to identify the machine.
Following instructions should work on both Debian and Ubuntu Linux systems.
Task: Display current hostname
Just type hostname command print the name of the system:$ hostname
Output:
vivek-desktop.gite.in
Task: Change hostname
Set hostname to desktop.nixcraft.com:# hostname desktop.nixcraft.com
# hostname
Output:
desktop.nixcraft.com
Task: Change hostname permanently
You need to edit a file called /etc/hostname:# vi /etc/hostname
Set new hostname:
desktop.nixcraft.com
Save and close the file.
http://hi.baidu.com/%D0%C7%D3%B0%D7%AF%B5%FB/blog/item/e70fc355a6cf9b58574e0072.html
短信注销:
1、注销指定账户短信服务:编辑短信”QXZH#账户后四位“发送到95533;
2、注销本手机所有账户短信服务:编辑短信”QXFW“发送到95533;
http://www.lslnet.com/linux/books/resource/gdb.html
命 令 | 描 述 |
file | 装入想要调试的可执行文件. |
kill | 终止正在调试的程序. |
list | 列出产生执行文件的源代码的一部分. |
next | 执行一行源代码但不进入函数内部. |
step | 执行一行源代码而且进入函数内部. |
run | 执行当前被调试的程序 |
quit | 终止 gdb |
watch | 使你能监视一个变量的值而不管它何时被改变. |
break | 在代码里设置断点, 这将使程序执行到这里时被挂起. |
make | 使你能不退出 gdb 就可以重新产生可执行文件. |
shell | 使你能不离开 gdb 就执行 UNIX shell 命令. |
http://www.linuxquestions.org/questions/linux-server-73/svn-error-692173/
http://www.cnblogs.com/feisky/archive/2009/11/26/1611341.html
在linux中,最简单的截屏工具莫过于import了。
几个常用的import命令介绍给大家:
1 import mypicture.jpg
然后可以使用鼠标选择的范围
2 sleep 5; import mypicture.jpg
等待5秒钟后,截取鼠标选择的范围
3 import -frame mypicture.jpg
截取鼠标所点击的窗口
4 import -window root mypicture.jpg
截取整个屏幕,作用相当于Print Screen键
5 import -frame -window 0xe00003 mypicture.jpg
用于截取window ID为0xe00003的窗口。
你可以使用xwininfo命令获取到特定窗口的window ID
ps:截取完成的图片,如果你想了解它的各项参数,可以使用identify命令加图片文件名称就可以了。
http://leenmax.blogbus.com/logs/10652724.html
通用快捷键
Alt + F1 类似Windows下的Win键,在GNOME中打开"应用程序"菜单(Applications)
Alt + F2 类似Windows下的Win + R组合键,在GNOME中运行应用程序
Ctrl + Alt + D 类似Windows下的Win + D组合键,显示桌面
Ctrl + Alt + L 启动屏幕保护程序
Alt + Tab 同Windows下的Alt + Tab组合键,在不同程序窗口间切换
PrintScreen 全屏抓图
Alt + PrintScreen 当前窗口抓图
Ctrl + Alt + → / ← 在不同工作台间切换
Ctrl + Alt + Shift + → / ← 移动当前窗口到不同工作台
窗口操作快捷键
Alt + F4 关闭窗口
Alt + F5 取消最大化窗口 (恢复窗口原来的大小)
Alt + F7 移动窗口 (注: 在窗口最大化的状态下无效)
Alt + F8 改变窗口大小 (注: 在窗口最大化的状态下无效)
Alt + F9 最小化窗口
Alt + F10 最大化窗口
Alt + Space 打开窗口的控制菜单 (点击窗口左上角图标出现的菜单)
http://blogold.chinaunix.net/u/30699/showart_1970102.html
Subversion常用命令指南
Svn在实际操作时非常简单,结合图形化客户端工具(如:TortoiseSVN),为我们的工作带来了很多方便。下面介绍Svn常用命令及简单用法,使你更加地喜欢上Subversion。
1、将文件Checkout到本地目录
例如:svn checkout svn: // 10.123.456.789 / test /DEMO
简写:svn co
2、往版本库中添加新的文件
例如:svn add test.java(添加test.java)
svn add * .java(添加当前目录下所有的java文件)
3、将改动的文件提交到版本库
svn commit -m "LogMessage" [-N] [--no-unlock] PATH(如果选择了保持锁,就使用--no-unlock开关)
例如:svn commit -m "add test file for my test" test.java
简写:svn ci
4、加锁/解锁
例如:svn lock -m " lock test file " test.java
svn unlock PATH
5、更新到某个版本
例如:svn update如果后面没有目录,默认将当前目录以及子目录下的所有文件都更新到最新版本。
svn update -r 200 test.java(将版本库中的文件test.java还原到版本200)
svn update test.java(更新,于版本库同步。如果在提交的时候提示过期的话,是因为冲突,需要先update,修改文件,然后清除svn resolved,最后再提交commit)
简写:svn up
6、查看文件或者目录状态
【?:不在svn的控制中;M:内容被修改;C:发生冲突;A:预定加入到版本库;K:被锁定】
2)svn status -v PATH (显示文件和子目录状态)
第一列保持相同,第二列显示工作版本号,第三和第四列显示最后一次修改的版本号和修改人。
注:svn status、svn diff和 svn revert这三条命令在没有网络的情况下也可以执行的,原因是svn在本地的.svn中保留了本地版本的原始拷贝。
简写:svn st
7、删除文件
例如:svn delete svn://10.123.456.789 /test/DEMO/test.java -m " delete test file"
或者直接svn delete test.java 然后再svn ci -m 'delete test file‘,推荐使用这种
简写:svn (del, remove, rm)
8、查看日志
例如:svn log test.java 显示这个文件的所有修改记录,及其版本号的变化
9、查看文件详细信息
例如:svn info test.java
10、比较差异
例如:svn diff test.java
svn diff -r m:n PATH(对版本m和版本n比较差异)
例如:svn diff -r 200:201 test.java
简写:svn di
11、将两个版本之间的差异合并到当前文件
例如:svn merge -r 200 : 205 test.java(将版本200与205之间的差异合并到当前文件,但是一般都会产生冲突,需要处理一下)
12、SVN 帮助
svn help ci
http://www.cnblogs.com/zhouxiuquan/archive/2010/04/22/1912373.html
6、常见问题解决:
svnsync init file:///data/svnroot/repository/products http://10.10.10.150/svn/products
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
从目标版本库获得锁失败,当前被“rhel500:284ff204-e16b-457f-933c-03d1c26c314b”持有
svnsync: Couldn't get lock on destination repos after 10 attempts
解决方法,执行以下命令:
svn propdel svn:sync-lock --revprop -r 0 http://10.10.10.130/svn/products
删除属性 “svn:sync-lock” 于版本库版本 0
http://www.cnblogs.com/xbsoft/archive/2010/04/14/1711809.html
http://bjxagu.javaeye.com/blog/400003
http://bianku.javaeye.com/blog/401495
http://neosmart.net/forums/showthread.php?t=5073
http://hi.baidu.com/ctralt/blog/item/2aae98ef7e3bd11bfdfa3cf2.html
#include "windows.h" using namespace std; //用来存储信息 void ExeCPUID(DWORD veax)//初始化CPU long GetCPUFreq()//获取CPU频率,单位: MHZ string GetManID()//获取制造商信息 string GetCPUType() for(DWORD t = 0 ; t < 3 ; t++ ) return string(CPUType); void main() } |
http://pubs.opengroup.org/onlinepubs/009695399/functions/gettimeofday.html
http://blog.csdn.net/daoyuly/archive/2009/03/01/3947918.aspx
ueryPerformanceCounter 收藏
精确的时间计时,有时候是非常必要的。比如播放多媒体时视频与音频的时间同步,还有在测试代码的性能时,也需要使用到非常精确的时间计时。还有测试硬件的性能时,也需要精确的时间计时。这时就需要使用QueryPerformanceCounter来查询定时器的计数值,如果硬件里有定时器,它就会启动这个定时器,并且不断获取定时器的值,这样的定时器精度,就跟硬件时钟的晶振一样精确的。
QueryPerformanceCounter 查询性能计数器
http://www.lijs.net/show-149-1.html
C/C++利用CPU时钟计数器精确计时
Submitted by lijs on 2008, September 30, 10:23 PM. 芳草天涯
- __inline unsigned __int64 GetCycleCount()
- {
- __asm _emit 0x0F
- __asm _emit 0x31
- }
经测试,C/C++都可用。
似乎只有intel的CPU可以。
使用
unsigned __int64 mytime=GetCycleCount();
即可获得CPU至加电以来的时钟周期数,除以CPU时钟频率即可得时间。
小技巧:
1.CPU时钟频率通常很大,所以除以(CPU时钟频率/1000000)得到微秒级时间,以此类推。
2.如果要想转为double做除法运算,先要转为signed __int64。
for linux:
static inline unsigned long long int GetCycleCount(){
unsigned long long int res = 0;
// Use the assembly instruction rdtsc, which gets the current
// cycle count (since the process started) and puts it in edx:eax.
asm volatile ("rdtsc" : "=A" (res));
return res;
}
__int64 is actually long long
void CWatch::init()
{
INT64 start = GetCycleCount();
Sleep(1000); //等待1秒钟,提高等待的时间,可以提高标定的精度
INT64 end = GetCycleCount();
count_per_second = end - start;
double currTime = (double)GetCycleCount() / count_per_second;
time_t realTime = time( NULL ); //当前时间,精度只有1s
startTime = realTime - currTime; //CPU上电时的时间
}
http://software.intel.com/en-us/articles/intel-c-compiler-for-windows-fatal-link-error-lnk1104-when-using-intel-c-compiler-with-boost-libraries/
When building an application that uses the Boost Libraries with the Intel® C++ Compiler, you may get linker errors like the ones shown below due to incorrect libraries being linked to the application:
fatal error LNK1104: cannot open file 'libboost_thread-iw-mt-1_33_1.lib'
or
fatal error LNK1104: cannot open file 'libboost_thread-iw-1_33_1.lib'
Perform the following steps to correct the problem:
- Open " boostconfigauto_link.hpp."
- Search for " __ICL" to find the following entries:
#elif defined(__ICL)
// Intel C++, no version number:
# define BOOST_LIB_TOOLSET "iw" - Change " iw" to:
" vc7" - if you are using Microsoft* Visual Studio* .NET
" vc71" - if you are using Microsoft Visual Studio .NET 2003
" vc80" - if you are using Microsoft Visual Studio 2005
" vc90" - if you are using Microsoft Visual Studio 2008. - Rebuild your application to resolve the link errors.
http://topic.csdn.net/t/20020117/01/482547.html
http://sheng.javaeye.com/blog/716921
SCIM输入启动遭遇“Failed to load x11 FrontEnd module. ”错误
文章分类:操作系统今天把我的一个Linux系统重启了一下,想输入中文,却发现中文输入法打不开,应该是SCIM没启动,于是
# scim -d
启动之,却发现报错如下:
- [root@sheng ~]# scim -d
- Smart Common Input Method 1.4.4
- Launching a SCIM process with x11...
- Loading socket Config module ...
- Creating backend ...
- Loading x11 FrontEnd module ...
- Failed to load x11 FrontEnd module.
- Failed to launch SCIM.
- [root@sheng ~]#
[root@sheng ~]# scim -d Smart Common Input Method 1.4.4 Launching a SCIM process with x11... Loading socket Config module ... Creating backend ... Loading x11 FrontEnd module ... Failed to load x11 FrontEnd module. Failed to launch SCIM. [root@sheng ~]#
很自然地上网去搜一下“Failed to load x11 FrontEnd module.”,发现有很多人遇到这个问题,但没找到有效的解决办法。用
# ps -ef | grep scim
看了一下,发现有四个scim相关的进程在运行:
- [root@sheng ~]# ps -ef | grep scim
- root 4706 1 0 13:59 ? 00:00:00 /usr/lib/scim-1.0/scim-launcher -d -c simple -e all -f socket --no-stay
- root 4710 1 0 13:59 ? 00:00:00 /usr/lib/scim-1.0/scim-helper-manager
- root 4711 1 0 13:59 ? 00:00:01 /usr/lib/scim-1.0/scim-panel-gtk --display :0.0 -c socket -d --no-stay
- root 4713 1 0 13:59 ? 00:00:00 /usr/lib/scim-1.0/scim-launcher -d -c socket -e socket -f x11
- root 4779 1 0 14:01 ? 00:00:00 scim-bridge
- root 5349 5275 0 14:10 pts/2 00:00:00 grep scim
[root@sheng ~]# ps -ef | grep scim root 4706 1 0 13:59 ? 00:00:00 /usr/lib/scim-1.0/scim-launcher -d -c simple -e all -f socket --no-stay root 4710 1 0 13:59 ? 00:00:00 /usr/lib/scim-1.0/scim-helper-manager root 4711 1 0 13:59 ? 00:00:01 /usr/lib/scim-1.0/scim-panel-gtk --display :0.0 -c socket -d --no-stay root 4713 1 0 13:59 ? 00:00:00 /usr/lib/scim-1.0/scim-launcher -d -c socket -e socket -f x11 root 4779 1 0 14:01 ? 00:00:00 scim-bridge root 5349 5275 0 14:10 pts/2 00:00:00 grep scim
于是把这四个进程全部杀掉,然后再重启scim:
- [root@sheng ~]# scim -d
- Smart Common Input Method 1.4.4
- Launching a SCIM daemon with Socket FrontEnd...
- Loading simple Config module ...
- Creating backend ...
- Reading pinyin phrase lib failed
- Loading socket FrontEnd module ...
- Starting SCIM as daemon ...
- Launching a SCIM process with x11...
- Loading socket Config module ...
- Creating backend ...
- Loading x11 FrontEnd module ...
- GTK Panel of SCIM 1.4.4
- Starting SCIM as daemon ...
- SCIM has been successfully launched.
- [root@sheng ~]#
[root@sheng ~]# scim -d Smart Common Input Method 1.4.4 Launching a SCIM daemon with Socket FrontEnd... Loading simple Config module ... Creating backend ... Reading pinyin phrase lib failed Loading socket FrontEnd module ... Starting SCIM as daemon ... Launching a SCIM process with x11... Loading socket Config module ... Creating backend ... Loading x11 FrontEnd module ... GTK Panel of SCIM 1.4.4 Starting SCIM as daemon ... SCIM has been successfully launched. [root@sheng ~]#
启动正常了,原来刚开始启动不了是因为SCIM已经启动了,才报那个错。可是为什么无法调出输入法呢?打开SCIM配置界面一看,原来我为了在我的WinXP上的XServer上使用SCIM时,避免打开输入法的快捷方式与WinXP的的快捷方式冲突,把启动快捷键改成了“Shift+Ctrl+Z”,难怪无法调出输入法。
在此留个记号,免得下次再在这个坑上摔跟斗。
http://hi.baidu.com/bellgrade/blog/item/4cceff5975d19089800a18a1.html
$yum install mesa*
Glut有很多种实现,在这里我用的是freeglut $yum install freeglut* 编译 $gcc -lglut -o test test.c |
http://zhidao.baidu.com/question/115962897.html
http://hunan.javaeye.com/blog/741119
1.安装一个包
# rpm -ivh
2.升级一个包
# rpm -Uvh
3.移走一个包
# rpm -e
4.安装参数
--force 即使覆盖属于其它包的文件也强迫安装
--nodeps 如果该RPM包的安装依赖其它包,即使其它包没装,也强迫安装或卸载。
5.查询一个包是否被安装
# rpm -q
6.得到被安装的包的信息
# rpm -qi
7.列出该包中有哪些文件
# rpm -ql
8.列出服务器上的一个文件属于哪一个RPM包
# rpm -qf
9.可综合好几个参数一起用
# rpm -qil
10.列出所有被安装的rpm package
# rpm -qa
11.列出一个未被安装进系统的RPM包文件中包含有哪些文件?
# rpm -qilp
http://bbs.chinaunix.net/viewthread.php?tid=313251
用什么命令可以查看文件夹大小?
du -sh dirname |
http://www.cnblogs.com/yanzisoft/archive/2010/07/25/1784573.html
opensuse 下设置opengl环境
http://ocaoimh.ie/how-to-umount-when-the-device-is-busy/
/dev/sdc1: 538
# ps auxw|grep 538
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox
http://cn.opensuse.org/OpenSUSE_11_0_NTFS%E5%88%86%E5%8C%BA%E7%A1%AC%E7%9B%98%E5%AE%89%E8%A3%85
http://www.forzw.com/archives/189
#mount /dev/sdb1 /home/soft
之后想卸载掉,但在输入:
#umount /home/soft
提示device is busy,无法卸载,在网上查找,方法如下
#fuser -m /home/soft
提示出进程号码 4573,之后执行如下命令:
#kill -9 4573 成功后就可以卸载掉了
http://blogold.chinaunix.net/u3/109488/showart_2222797.html
http://www.cyberciti.biz/tips/how-to-mount-iso-image-under-linux.html
Procedure to mount ISO images under Linux
1) You must login as a root user, if not root user then switch to root user using following command:$ su -
2) Create the directory i.e. mount point:# mkdir -p /mnt/disk
3) Use mount command as follows to mount iso file called disk1.iso:# mount -o loop disk1.iso /mnt/disk
4) Change directory to list files stored inside an ISO image:# cd /mnt/disk
# ls -l
http://bothlog.com/2010/08/ibus-can-not-input-when-pressed-backspace-in-chrome/
$
sudo
add-apt-repository ppa:shawn-p-huang
/ppa
$
sudo
apt-get update
$
sudo
apt-get dist-upgrade
http://mail.google.com/support/bin/answer.py?hl=cn&answer=7190
http://blogold.chinaunix.net/u3/104108/showart_2075589.html
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041
下载boost_1_39_0.tar.gz
tar -zxvf boost_1_39_0.tar.gz
然后进入解压缩后的文件夹编译boost的编译器jam
cd boost_1_39_0\tools\jam
./build_dist.sh
编译完后在这个目录下有编译出的bjam文件
boost_1_39_0\tools\jam\stage\bin.linuxx86
把它copy到boost_1_39_0 然后在这个目录下运行命令编译:
./bjam "-sTOOLS=gcc" "--includedir=/usr/include" "--libdir=/usr/lib/boost" install
开始编译,等待编译完成,需很长时间。
关于bjam的后面的参数的设置:
-sTOOLS=gcc 指定编译器为GCC
--includedir=/usr/include/ 指定头文件的安装目录,我安装在/usr/include下。如果安装成功,将在/usr/include/生成目录boost_1_33,该目录下就是boost的头文件目录
--libdir=/usr/lib/boost 指定boost的库文件的存放位置, 生成的 .a .so 文件将放在该目录下
install 编译并安装boost
#include
using namespace std;
using boost::unit_test::test_suite;
{
BOOST_CHECKPOINT("About to force division by zero");
int i =1, j = 0;
i = i / j;
}
void infinite_loop()
{
#ifdef __unix
BOOST_CHECKPOINT("About to enter infinite loop");
while(1);
#else
BOOST_MESSAGE("Timeout support is not implemented on your platform");
#endif
}
{
test_suite* test = BOOST_TEST_SUITE("unit test example");
test->add(BOOST_TEST_CASE(&force_division_by_zero));
test->add(BOOST_TEST_CASE(&infinite_loop),0,2);
return test;
}
编译:
http://wamp.blog.hexun.com/35196077_d.html
可以在终端顺利启动Eclipse,但是鼠标双击,或者用起动器启动就会出现如下的内容:
A Java RunTime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No java virtual machine was found after searching the following locations:…
解决办法是在终端进入你的eclipse目录,然后输入:
mkdir jre
cd jre
ln -s 你的JDK目录/bin
http://zhidao.baidu.com/question/19422643.html
http://hi.baidu.com/mudgao/blog/item/20f5d46332f15b6c0d33fabb.html/cmtid/43a8e94e77b9bd07b2de0589