Unix: Find strings inside files and folders

Monday, June 4th, 2007

The easyiest way is this:

find {path} -type f -exec grep -l {string_to_search} {} \;

in which you only replace {path} with the path you want to search , and {string_to_search} with the string you are looking for inside the files.

Checking if a server is under ddos attack

Monday, June 4th, 2007

A quick and usefull command for checking if a server is under ddos is:

netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

(more…)

Smtp Connections list

Monday, June 4th, 2007

You can check what connection you have via smtp protocol with the simple command:

netstat -a | grep smtp

(more…)

301 Page Redirects using PHP and .htaccess

Monday, June 4th, 2007

During the life of a website, its quite common for pages to move around or to ‘re-structure’ your site’s files and folders. However, you can come across issues when people linking to your page go to their ‘stale’ bookmark of your site, and find that page is missing – in fact, they’ll get a ‘404 Page Not Found‘. The same will go for search engines like google and yahoo, and will adversely affect your rankings within their results.

(more…)

HOW TO Autostart Programs in Linux

Monday, June 4th, 2007

Introduction

This HOWTO explains how to get programs to launch when you login into your WM (Window Manager) and/or DE (Desktop Environment).

(more…)

Protecting Linux against automated attackers

Thursday, May 31st, 2007

Read the fine article here.