Linux

PHP 5.3.6 Upgrade - ClearOS

Instructions below to upgrade PHP to 5.3.6

Please note these are not the official packages, and have been put together by http://rpms.famillecollet.com/ for RHEL5 distributions (thank you!). I have rebuilt these so they install for ClearOS with the addition of two RPM's (libedit and sqlite2).

Thefore please consider these as beta / testing quality

1. SETUP THE REPO

PHP 5.2.17 for ClearOS5.2

You can now also get PHP5.2.17 for ClearOS5.2.

You can now get the PHP rpm's from ftp://www.timburgess.net/repo/clearos/5.2/os/

Note these are compiled from the REMI repo (http://blog.famillecollet.com/), and are pretty much untested however they do work on my VM, so use at your own risk.

To install from the command line

Realtek Drivers - Compiled for CC5.0, Kernel 2.6.18-128.2.16v5-i686

UPDATE!: You can now get hold of these drivers via RPM if you wish, they are recompiled from the elrepo sources.
ftp://starlane.gotdns.org/elrepo-kmod/

Below are the latest Realtek drivers compiled for ClarkConnect5.0 - and all the chipsets outlined for each driver. See README files for instruction on installation

Getting the most out of Grub

The grub bootloader is particularly useful, especially when upgrading and testing new kernels. I recently found a way to modifiy the default boot config to make it useful when you wish to remotely upgrade a kernel and boot into it once only without being at the console to change the default back.

My current grub config:-

Iptables fun! Firewall rule examples

Some examples of the power of iptables..the ip is defined as 123.123.123.123, substitute with your own. You can find out more by looking at the iptables manpage. Depending on your firewall configuration, not all setups have an explicit 'drop' at the end of the chain, therefore you maybe able to append the rules rather than insert using -A

Block single external host (change ethX for your WAN interface)

iptables -I INPUT -s 123.123.123.123 -i ethX -j DROP

Automatically add snortsam text to new snort rules

So we have oinkmaster - a script that will update all your snort rules for you very conveniently. We also have snortsam blocking IP's on custom rules which have fwsam:src 1day;) added to the end...the thing is the new rules don't so how do we update the new rules with the following text so that all our intrusion protection system stays up to date?

Script setup - getting the basics in place

Ok well, in my (many) google searches for bash scripting I stumbled across a site over here, that hosts several samples of text manipulation scripts amongst others. The reason for posting this up is the excellent templates the author uses for setting up a script, which includes simple help description, author, and usage information.

I've pasted a sample below for info: Credit of which is due to Dawid Michalczyk

Snort Performance Statistics

NOTE: This was written for use on the Smoothwall firewall, however it will work well on any other distro - just ignore the sections about amendements to the webconfig interface. (Step H)

BASH commands

Ok - needed somewhere to write down a few of the more useful bash commands i've discovered before I forget them!

Stripping fields from within lines of text

So my excursion into bash scripting continues, the following line will extract fields from text(whilst a little specific to its task maybe useful for others)

I can only recommend a good read up of how to use sed, which is a powerful (and seemingly quite complicated) text editor that will remove / add / replace text on the fly. The notation is probably the biggest hurdle but its worth the effort!

Stripping config files

A lot of config files for linux are usefully commented to describe each function, particularly apache, squid etc...Hoever sometimes this can cloud the actual configuration being used. The following line will strip all lines beginning with #, (i.e. commented) and all blank lines to leave you with a stripped out config file!


grep -v "^#" /etc/squid/squid.conf | grep -v "^$"

Block whole country IP's from your firewall - Iptables / Linux

This following small script will automatically read the lines in Country IP range files from http://www.ipdeny.com and add them to your firewall

Create a file called zoneblock using the following text, then 'chmod +x zoneblock' to make it executable

Just download the zone file you want for the country you want (you can do this using wget), then run Code:


System Information Script - Linux

I've had a bit of time on my hands recently, so I've put together a little script which compiles all the Clarkconnect system setup information, and then creates an html output file which can then be copied / pasted into the forum or for your own information. Saves having to remember all those funny commands to generate the output! It also parses the config files to remove commented lines and spaces giving you the real config parameters.

I would be pleased to know of any feedback / comments etc.

It summarises the following info:

Installing a wireless USB dongle in linux (Zydas zd1211)

How to install a Zydas USB 802.11b/g Dongle on ClarkConnect (Home 3.2) and act as an Access Point. The following is how I managed to install wireless drivers in linux, most of the principles will apply to other distros. (but specifically Clarkconnect which is based on Redhat / Centos)

Install the devel and wireless packages required to build the module
Code:

User login

Navigation

Poll

What wireless chipset do you use in Linux?: