regex

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

acl verizonfios src 1.2.3.4

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 4.5.6.7

How do I replace the line starting with “acl verizonfios” with new IP address using sed and ssh?

{ 1 comment }

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

_file1.txt
_foo1.txt
_2424.txt
_bar10000.txt

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

file1.txt
foo1.txt
2424.txt
bar10000.txt

{ 13 comments }

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?

{ 3 comments }

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 […]

{ 0 comments }