≡ Menu


Sed: Find and Replace The Whole Line [ Regex ]

I have a line as follows in squid.conf file. My sever is hosted in a cloud:

acl verizonfios src

My ISP will force an IP address change every week or two. I would like to replace them with a new IP

acl verizonfios src

How do I replace the line starting with "acl verizonfios" with new IP address using sed and ssh?
[click to continue…]

Linux: Rename Expression To Remove First Character From a File Name

I've over 1000's of files starting with _ character as follows:


How do I remove the first character from a file name:


[click to continue…]

Postfix Hide Client (MUA) System IP Address / Hostname

I've central mail server gateway. All of our internal systems through this box. How do I remove or hide the hostnames and IP addresses of our internal systems from the messages headers before they go out to other users for security purpose?
[click to continue…]

Lighttpd as you compiled without pcre support error and solution

Q. I'm using lighttpd under CentOS 5 and getting the following error:
...can't handle '$HTTP[url] =~ …' as you compiled without pcre support.

My question is What is pcre support, and how do I solve this problem?

A. Pcre is nothing but Perl-compatible regular expression library. PCRE has its own native API, but a set of "wrapper" functions that are based on
the POSIX API are also supplied in the library libpcreposix. You must compile lighttpd with pcre to support lighttpd regex style config option. pcre-devel package provides the development files (Headers, libraries for static linking, etc) for pcre. Install the following package and rebuild your lighttpd:
# yum install glib2-devel openssl-devel pcre-devel bzip2-devel gzip-devel

Now change directory to lighttpd source code and recompile Lighttpd with pcre option:
# make clean
# ./configure
# make
# make install

Now restart lighttpd and it should support pcre style config options.