MXcode » linux http://mxcode.com All about coding Wed, 23 Jun 2010 09:30:25 +0000 http://wordpress.org/?v=2.7.1 en hourly 1 how to install squid-2.5.STABLE13 on linux http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/ http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/#comments Tue, 09 Mar 2010 03:12:20 +0000 MXcode http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/ To build and install the Squid Cache, type:

% ./configure –prefix=/usr/local/squid
% make all
% make install

To run a Cache, you will need to:

1. customize the squid.conf configuration file:
% vi /usr/local/squid/etc/squid.conf

2. start the cache:
% /usr/local/squid/sbin/squid

If you want to use the WWW interface to the Cache Manager, copy the cachemgr.cgi program into your httpd server’s cgi-bin directory.

]]>
http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/feed/
open a port on linux server http://mxcode.com/2010/01/open-a-port-on-linux-server/ http://mxcode.com/2010/01/open-a-port-on-linux-server/#comments Wed, 13 Jan 2010 14:39:47 +0000 MXcode http://mxcode.com/2010/01/open-a-port-on-linux-server/ =========================================
iptables -A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 3690 -j ACCEPT
=========================================
RH-Firewall-1-INPUT is the name of the chain, and change 3690 to the port number you expect.

You must restart the service to make it effective:
[root@localhost ~]# service iptables restart

]]>
http://mxcode.com/2010/01/open-a-port-on-linux-server/feed/
use kill with awk http://mxcode.com/2009/08/use-kill-with-awk/ http://mxcode.com/2009/08/use-kill-with-awk/#comments Thu, 27 Aug 2009 06:40:51 +0000 MXcode http://mxcode.com/2009/08/use-kill-with-awk/ kill `ps -ef | awk ‘{if($11~/WorkOrderProcessor/) print$2}’`

]]>
http://mxcode.com/2009/08/use-kill-with-awk/feed/
VI command - D & x http://mxcode.com/2009/08/vi-command-d-x/ http://mxcode.com/2009/08/vi-command-d-x/#comments Mon, 10 Aug 2009 03:16:45 +0000 MXcode http://mxcode.com/2009/08/vi-command-d-x/ D

The D command deletes from the cursor position to the end of the line. (D is a shortcut for d$.)

x

Often you want to delete only one or two characters. Just as r is a special change command to replace a single character, x is a special delete command to delete a single character. x deletes only the character the cursor is on.

]]>
http://mxcode.com/2009/08/vi-command-d-x/feed/
VI command - dw&dd http://mxcode.com/2009/08/vi-command-dw-dd/ http://mxcode.com/2009/08/vi-command-dw-dd/#comments Sun, 09 Aug 2009 09:35:08 +0000 MXcode http://mxcode.com/2009/08/vi-command-dwdd/ dw

dw deletes a word beginning where the cursor is positioned. Notice that the space following the word is deleted.

dd

The dd command deletes the entire line that the cursor is on. dd will not delete part of a line. Like its complement, cc, dd is a special command.

]]>
http://mxcode.com/2009/08/vi-command-dw-dd/feed/
VI command - (~) http://mxcode.com/2009/08/vi-command/ http://mxcode.com/2009/08/vi-command/#comments Wed, 05 Aug 2009 03:04:32 +0000 MXcode http://mxcode.com/2009/08/vi-command/ ~

Changing the case of a letter is a special form of replacement. The tilde (~) command will change a lowercase letter to uppercase or an uppercase letter to lowercase. Position the cursor on the letter whose case you want to change, and type a ~. The case of the letter will change, and the cursor will move to the next character.

]]>
http://mxcode.com/2009/08/vi-command/feed/
VI command - r & s http://mxcode.com/2009/08/vi-command-r-s/ http://mxcode.com/2009/08/vi-command-r-s/#comments Tue, 04 Aug 2009 02:11:53 +0000 MXcode http://mxcode.com/2009/08/vi-command-r-s/ r

One other replacement edit is given by the r command. r replaces a single character with another single character. You do not have to press ESC to return to command mode after making the edit.

s

The S command, as is usually the case with uppercase commands, lets you change whole lines. In contrast to the C command, which changes the rest of the line from the current cursor position, the S command deletes the entire line, no matter where the cursor is. vi puts you in insert mode at the beginning of the line. A preceding count replaces that many lines.

Both s and S put you in insert mode; when you are finished entering new text, press ESC.

]]>
http://mxcode.com/2009/08/vi-command-r-s/feed/
VI command - cw&cc http://mxcode.com/2009/08/vi-command-cw-cc/ http://mxcode.com/2009/08/vi-command-cw-cc/#comments Mon, 03 Aug 2009 08:22:35 +0000 MXcode http://mxcode.com/2009/08/vi-command-cw/ cw

To change a word, combine the c (change) command with w for word. You can replace a word (cw) with a longer or shorter word (or any amount of text). cw can be thought of as “delete the word marked and insert new text until ESC is pressed.”

cc

To replace the entire current line, use the special change command, cc. cc changes an entire line, replacing that line with any amount of text entered before pressing ESC . It doesn’t matter where the cursor is located on the line; cc replaces the entire line of text.

]]>
http://mxcode.com/2009/08/vi-command-cw-cc/feed/
print diff result http://mxcode.com/2009/07/print-diff-result/ http://mxcode.com/2009/07/print-diff-result/#comments Wed, 15 Jul 2009 05:30:15 +0000 MXcode http://mxcode.com/2009/07/print-diff-result/ find src|awk ‘{print “diff “$0″ bak/” $0 “>diff/”$0}’|less

]]>
http://mxcode.com/2009/07/print-diff-result/feed/