Identifying PHP Spam

To identify PHP Spam when running PHP 5.3 or higher: (Please note the variables below are not enabled by default in php.ini) utilize the following php.ini variable to narrow down the offending script. If you suspect there is a PHP script sending out email (and it is still doing so) try adding these two lines:…


check-httpd.sh

Here is a quick little bash script to let you know if apache is up and running or not and will email a specific user with details. cd /root/bin/ touch check-httpd.sh vim check-httpd.sh add script below to check-httpd.sh file #!/bin/bash FILE=apache-snapshot.txt DIR=/root #set this and then uncomment the mail command on 38 [email protected] SUBJECT=”APACHE_DOWN-host.mydomain.com” LOAD=`cat…


CIDR Notation

CIDR stands for Classless Inter-Domain Routing. CIDR was developed in the 1990s as a standard scheme for routing network traffic across the Internet. /27      1/8th of a Class C     32 hosts /26      1/4th of a Class C     64 hosts /25      1/2 of a Class C       128 hosts /24      1 Class C              256 hosts /23      2…


Setup bash_eternal_history

In order to setup eternal bash history for all users: vim /etc/bashrc insert if [ “$BASH” ]; then export HISTTIMEFORMAT=”%Y-%m-%d_%H:%M:%S ” export PROMPT_COMMAND=”${PROMPT_COMMAND:+$PROMPT_COMMAND ; }”‘echo “`date +’%y.%m.%d-%H:%M:%S:’`” $USER “(“$ORIGINAL_USER”)” “COMMAND: ” “$(history 1 | cut -c8-)” >> /var/log/bash_eternal_history’ alias ehistory=’cat /var/log/bash_eternal_history’ readonly PROMPT_COMMAND readonly HISTSIZE readonly HISTFILE readonly HOME readonly HISTIGNORE readonly HISTCONTROL fi Then…


darkstat

http://unix4lyfe.org/darkstat/ darkstat is an ntop-workalike network statistics gatherer. It runs as a background process on a cable or DSL router, uses libpcap to capture network traffic, and has a Web interface that serves up reports of statistics such as data transferred by host, port, and protocol. It also has a neat bandwidth usage graph….


The ‘at’ command

The “at” command lets you execute a command or script at a later time, you can set the time in many different ways and even have the result mailed to you after the command has been executed. Here are some examples:…


Install node.js

Here’s how to install node.js on your cPanel server yum install openssl-devel cd /usr/local/src wget http://nodejs.org/dist/v0.6.8/node-v0.6.8.tar.gz tar zxvf node-v0.6.8.tar.gz cd node-v0.6.8 ./configure make make install If you get the error: File “./configure”, line 433 fpu = ‘vfpv3’ if armv7 else ‘vfpv2’ ^ SyntaxError: invalid syntax the python script may be attempting to run the configure…


prettyping.sh

From CrazyTerabyte Blog prettyping.sh – A better UI for watching ping responses Do you run ping tool very often? Do you find yourself squeezing your eyes to see if a packet has been lost? Do you want to have a better view of the latency and of the lost packets over time? Then you need…


Cpanel / SuPHP fix permissions

Here are a few one liners to change the perms needed when switching to suphp. The following commands will look in every user’s html folder and make the appropriate chmod to allow php to properly execute under SuPHP. * For Directories find /home/*/public_html/ -type d -print0 | xargs -0 chmod 0755 * For Files find…


CoVim

From fredkschott.com Today we’re announcing CoVim, a plugin that adds multi-user, real-time collaboration to your favorite (or least favorite) text editor. CoVim allows you to remotely code, write, edit, and collaborate, all within your custom Vim configuration. Originally started as a senior capstone project for Tufts University, we’re now open-sourcing it to give the world…