Dec 27 2012

php trash day script

Category: phperm @ 10:25 pm

Trash days on Monday suck.
I constantly forget to take out the trash on Saturday when there is a holiday on Monday. I dusted off the old trash-day-php script and installed it.

Installation is pretty simple.
Edit the script with the values you want.
place it in /etc/cron.daily/trash-day-php
chmod +x /etc/cron.daily/trash-day-php

cron doesn’t like . in filenames. Thats why I named the file trash-day-php not trash-day.php.

To test your email just run /etc/cron.daily/trash-day-php –test

Continue reading “php trash day script”

Aug 30 2012

php command line bandwidth monitor

Category: phperm @ 10:55 am

I wrote this quick & dirty bandwidth monitor for use with htop. It also displays the average bandwidth for the last 10 seconds.

It displays a line similar to this at the top of the screen:
eth0:RX:600b TX:944b Avg:77b eth2:RX:0b TX:0b Avg:0b

Usage is simple:
$ ./bw.monitor.php & htop
Continue reading “php command line bandwidth monitor”

Feb 18 2007

The most useful php functions EVER!

Category: php,Tutorialserm @ 6:56 pm

Many times when you’re writing a php script, you need to put things in arrays.

You might be thinking to yourself why doesn’t this section of code work?
Continue reading “The most useful php functions EVER!”

Jan 08 2007

My calendar class

After several hours of playing with php I think I’ve finally developed a stable calendar class.
Continue reading “My calendar class”