Thursday, January 29, 2009

Freebsd php-fpm fastcgi server init script


#!/bin/sh

# PROVIDE: phpfpm
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable php-fpm:
#
#phpfpm_enable="YES"
#
#

. /etc/rc.subr

name=phpfpm
rcvar=`set_rcvar`

command="/usr/local/sbin/php-fpm"
command_args=""
pidfile=/usr/local/logs/php-fpm.pid
required_files=/usr/local/etc/php-fpm.conf

# set defaults

phpfpm_enable=${phpfpm_enable:-"NO"}

start_cmd="phpfpm_start"
stop_cmd="phpfpm_stop"
restart_cmd="phpfpm_restart"

phpfpm_start()
{
if [ -f ${pidfile} ]
then
echo "php-fpm already running!"
exit 1;
fi
echo "Starting php-fpm server..."
/usr/local/bin/php-cgi --fpm
}
phpfpm_stop()
{
if [ ! -f ${pidfile} ]
then
echo "${name} is not running or pidfile not found!";
exit 1;
fi
echo "stopping ${name}..."
kill -SIGQUIT `cat ${pidfile}`
}
phpfpm_restart()
{
if [ ! -f ${pidfile} ]
then
echo "${name} is not running or pidfile not found!";
exit 1;
fi
echo "sending SIGUSR2 to php-fpm master"
kill -SIGUSR2 `cat ${pidfile}`
}

load_rc_config ${name}
run_rc_command "$1"

Wednesday, January 21, 2009

How to check SpamAssassin version

Quick one-liner for checking spamassassin version:
[root@server ~]# perl -MMail::SpamAssassin -e 'print $Mail::SpamAssassin::VERSION;'
3.002004

Tuesday, January 13, 2009

OpenSUSE developers announced csync

Andreas Schneider has unleashed the first public release candidate of csync 0.42, which is now available as source from the csync Web site, or via one-click for openSUSE 11.0 and 11.1.

Project homepage: http://www.csync.org/

This tool looks like a promising alternative to unison, which was written in ocaml, while csync is written in C

Did not have time to test it yet, but as soon as it proves that is working ok - i plan to replace unison with it.

RDP through a ssh tunnel

How to access RDP if firewall is closed down, and access to server is restricted to a few ips:

ssh user@allowed.server.com -L 3389:windows.server.com:3389
rdesktop -uadministrator -pp455w0rd localhost


That's it! Secure encrypted rdesktop session :)

Thursday, January 1, 2009

Parallels decided to drop qmail?

While installing latest Parallels Plesk version (9.0), noticed an unusual option :) :
  Different mailservers
16. (*) Qmail mailserver
17. ( ) Postfix mailserver


Could this be true, that Parallels finally decided to drop Qmail?
Now don't get me wrong, but qmail wasn't updated for 10 years already, and any additional feature requires a patch...
And.. did you ever try to read qmail's logs? :)

2009 will be a second longer | Happy new year!

Found a confirmation of this in my system logs:
Jan  1 01:59:59 (none) kernel: Clock: inserting leap second 23:59:60 UTC

:)

Btw,

_________________
( Happy new Year! )
-----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||