Posted by hide1713 on November 30, 2008
We want to bind Ctrl+c m to man-follow. We can use the following 3 steps to generate key binding command just like this:
(global-set-key “^Cm” (quote man-follow))
We can put this command into .emacs file to make our life easier.
1. M-x global-set-key
press Ctrl-c m from keyboard, press return.
enter man-follow return.
2. M-x repeat-complex-command return.
Now (global-set-key “^Cm” (quote man-follow)) is displayed in mini buffer.
3.Ctrl-a Ctrl-k to copy it into kill ring then paste it into .emacs.
Remember! Don’t copy the string by mouse copy or Ctrl+Shift+c if you use emacs-nox because ^C is a single key! Copy it into clipboard will make it into “^ and C” which leads to an error.
Posted in Emacs | Tagged: tips | Leave a Comment »
Posted by hide1713 on November 29, 2008
The default installation of stardict do not support sound and HTML dicts.
you need to install stardict-plugin package and download WyabdcRealPeopleTTS . Put those sound files in /usr/share/WyabdcRealPeopleTTS then chenge stardict sound sitting-> command from play to aplay
Enjoy
Posted in Ubuntu | Tagged: tips | 2 Comments »
Posted by hide1713 on November 29, 2008
First, backup your /etc/X11/xorg.conf
Then, sudo dpkg-reconfigure xserver-xorg This command reconfigures xorg.
Then, reboot the system. Your ubuntu should be able to recognize your monitor but not in right resolution
in system->Administration->Hardware Device. Select ati driver. Reboot again.
Make sure in your xorg.conf contains the following info
Section “Screen”
#add these three lines
SubSection “Display”
Virtual 2640 1568 #2640=1200+1340 1568=800+768 which is my two monitors resolution
EndSubSection
#———————————
Identifier “Default Screen”
Device “Configured Video Device”
Monitor “Configured Monitor”
DefaultDepth 24
EndSection
Reboot again. I spent 2+ hours to make everything right. Here is my xorg.conf file. I use default ubuntu ati driver. It takes time, be patient
Posted in Ubuntu | Tagged: tips | Leave a Comment »
Posted by hide1713 on November 26, 2008
Tar could be one of most powerful and complex command which we need to use every day. Here some tips for tar
Find file and put them in to tar:
find ./ -name “*.jpg” | tar -cvf yourtar.tar -T -
or
tar -cvf yourtar.tar `find *.c -print`
Posted in shell | Tagged: tips | Leave a Comment »
Posted by hide1713 on November 26, 2008
There is a way to embeded a command inside another command by using ` key. This key is on the left of 1 key
Example
tar -cvf aa.tar `find *.c -print`
This command finds all the *.c file and send it to aa.tar
Posted in shell | Tagged: tips | Leave a Comment »
Posted by hide1713 on November 26, 2008
Sometime we want to know the assembly code output for piece of c code. We can use this following command to do this.
gcc -S c_file.c
then it generates a c_file.s which is the assembly code of c_file.c
Read it and have fun.
Posted in C | Tagged: C | Leave a Comment »
Posted by hide1713 on November 21, 2008
First make sure you have installed build-essential packages. Those packets ensure you to have a basic compile environment.
Then:
sudo apt-get install libglut3-dev
Ubuntu 8.04 don’t have man page for opengl. but you can find one here
http://emergent.unpythonic.net/01157053957
download the man page and put it proper directory (/usr/share/man/man3)
Currently, I don’t find any glut man pages available for ubuntu. You can read the online version. If you really need man pages for glut. You can get one from some rpm of gult. Take man page out of rpm and put them in man page directory.
here is the rpm you need
Install alien command first.This command can convert rpm to deb, then
sudo alien glut-devel-3.7-12.i386.rpm
extract the new deb packet(not install) find the manpages in man3 directory. Copy all of them to /usr/share/man/man3 directory.
You installed opengl library, head files and manpages. It’s time to start your journey in opengl programming now!
Posted in opengl | Tagged: opengl | Leave a Comment »
Posted by hide1713 on November 17, 2008
Put:
ifconfig wlan0 down
at the beginning of stop in: /etc/init.d/alsa-utils
Posted in Ubuntu | Tagged: tips | Leave a Comment »
Posted by hide1713 on November 14, 2008
Chmod recursively in directory
remove execute from files under aa directory. This is useful when you copy files from fat or ntfs.
find aa/ -type f -exec chmod -x {} \;
Posted in shell | Tagged: shell, tips | Leave a Comment »
Posted by hide1713 on November 14, 2008
Add this line in your .screenrc Use shift+pageup/pagedown to scroll
termcapinfo xterm* ti@:te@
Posted in screen | Tagged: screen, tips | Leave a Comment »