Time pass by

Sunshine and rain of a developer

Posts Tagged ‘tips’

Quick Generate Key-Binding Command in Emacs

Posted by vanguard33 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: | Leave a Comment »

Ubuntu Stardict With Sound And HTML Parser

Posted by vanguard33 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: | 2 Comments »

Ubuntu Samsung 933SN Dual Monitor Vartual Desktop ATI Configration

Posted by vanguard33 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: | Leave a Comment »

How much do you know about tar?

Posted by vanguard33 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: | Leave a Comment »

Bash Tip: Execute Command Inside Another Command

Posted by vanguard33 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: | Leave a Comment »

Ubuntu 8.10 can not shutdown, freeze in alsa

Posted by vanguard33 on November 17, 2008

Put:

ifconfig wlan0 down

at the beginning of stop in: /etc/init.d/alsa-utils

Posted in Ubuntu | Tagged: | Leave a Comment »

Chmod recursively in directory

Posted by vanguard33 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: , | Leave a Comment »

GNU screen scroll by PageUp and PageDown

Posted by vanguard33 on November 14, 2008

Add this line in your .screenrc  Use shift+pageup/pagedown to scroll

termcapinfo xterm* ti@:te@

Posted in screen | Tagged: , | Leave a Comment »

Befor Clear the MBR, Think Twice!!

Posted by vanguard33 on November 13, 2008

Before you use dd to clear the MBR, You’d better make sure what you want to do.

Clear 512 bit MBR not only removes the boot loader, but also removes the partition table !!

Do not use dd command unless you know what you are doing.

Posted in Uncategorized | Tagged: | Leave a Comment »

screen tip: How to send Ctrl a to application

Posted by vanguard33 on November 9, 2008

screen is a powerful window management tool under linux

All it’s command starts with ctrl+a ,so If you want to send ctrl+a to an application (like emacs), you can type

ctrl+a a

This tip is hard to find, so I post it.

Posted in screen | Tagged: , | 3 Comments »

 
Follow

Get every new post delivered to your Inbox.