current apache connections

how to check current apache connections

Since apache will spawn a new process for each new connection you need to determine how many httpd processes are currently running

I would recommend checking the count from this command against the MaxClients setting in apache’s httpd.conf:

ps aux | grep -c httpd

To show the number of . . . → Read More: current apache connections

convert ascii mysql db to utf8

how to convert ascii mysql db to utf8 ?

I had a MyISAM mediawiki 1.11.0 database that needed to be utf8 to upgrade to the latest version. Before I could upgrade it I had to convert it to utf8.

Here’s the steps on FreeBSD:

mysqldump -u root -p –default-character-set=latin1 -c –insert-ignore –skip-set-charset -r wikidb_latin1a.sql wikidb . . . → Read More: convert ascii mysql db to utf8

undefined function session_name()

undefined function session_name()

to fix this on freebsd:

you must install: /usr/ports/www/php5-session

Linux one liners

Linux one liners Diff two directories diff -rq /dir1 /dir2 Set suid

File: File executes as the user that owns the file, not the user that ran the file

chmod u+s Set sgid File: File executes as the group that owns the file Dir: Files newly created in the directory have their group owner set . . . → Read More: Linux one liners

grep ifconfig list ips

Linux ifconfig Example

Type the following command:

ifconfig | grep ‘inet addr:’| grep -v ’127.0.0.1′ | cut -d: -f2 | awk ‘{ print $1}’ FreeBSD/OpenBSD ifconfig Example

Type the following command:

ifconfig | grep -E ‘inet.[0-9]‘ | grep -v ’127.0.0.1′ | awk ‘{ print $2}’ Sun / Oracle Solaris Unix Example:

Type the following command:

. . . → Read More: grep ifconfig list ips

open source network monitoring tools

OpenNMS

www.opennms.org

Features Event Management and Notifications Discovery and Provisioning Service Monitoring Data Collection Additional Features

I checked out the demo it looks pretty decent

Hyperic

Hyperic’s web infrastructure monitoring and management software automates and streamlines data center operations. HQ helps you reduce operations workload, increase your company’s IT management maturity level, . . . → Read More: open source network monitoring tools

du total size all sub directories

Let’s say we wanted to list the total size of each directory on a freebsd, unix, or linux box.

Here’s how to do it

# du -sk /usr/local/svn/* | sort -n -r

find files modified in last five days unix linux

How do we find files modified in last five days unix linux?

To find all files modified within the last 5 days:

find / -mtime -5 -print

The – in front of the 5 modifies the meaning of the time as “less than five days.” The command

find / -mtime +5 -print

displays files . . . → Read More: find files modified in last five days unix linux

alternative svn backup method

alternative svn backup method. Sometimes svnsync, hotcopy, etc just won’t work for you. Here’s the solution!

1. Create a user with same name and password on each of your servers, example: host1_live_svn_server – backup_usr host2_backup_server – backup_usr 2. Setup SSH with no password for each user that will be involved in syning your svn 3. . . . → Read More: alternative svn backup method

freebsd set bash default shell

freebsd set bash default shell First you need to figure out where bash was installed: $ which bash

/usr/local/bin/bash Now use chsh as show below

$chsh -s /usr/local/bin/bash Password: chsh: user information updated