Varnish http proxy cache plugins for munin.
OpenSSL update breaks Parallels Plesk Panel
Submitted by sandip on Tue, 04/06/2010 - 22:46Latest update of the openssl package from CentOS breaks Parallels Panel 9.x. The following errors are displayed in the /var/log/sw-cp-server/error_log file when Panel is trying to start:
2010-03-29 11:21:22: (log.c.75) server started
2010-03-29 11:21:22: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
...
Resolution: It is necessary to update Parallels Panel web-engine.
get-flash-videos - A command line program to download flash videos
Submitted by david23 on Tue, 04/06/2010 - 08:13Download videos from various Flash-based video hosting sites, without having to use the Flash player. Handy for saving videos for watching offline, and means you don’t have to keep upgrading Flash for sites that insist on a newer version of the player.
How to Set Up a High Performance Cluster (HPC) Using Debian Lenny and Kerrighed
Submitted by david23 on Mon, 03/29/2010 - 09:05There are many guides found on the net describing Kerrighed and how to set it up using Ubuntu and others. However, to the best of my knowledge there isn’t a step by step guide specifically designed for Kerrighed using Debian Lenny.
BAR - Backup archiver program
Submitted by david23 on Tue, 03/23/2010 - 09:03BAR is backup archiver program to create compressed and encrypted archives of files that can be stored on a hard disk, CD, DVD, or directly on a server via FTP, SCP, or SFTP. A server mode and a scheduler are integrated for making automated backups in the background. A graphical front end that can connect to the (remote) server is included.
Search bot report
Submitted by sandip on Mon, 03/22/2010 - 13:41Here is a simple bash script to get a daily report of search bot results of Success (200) and Failed (404) hits:
#!/bin/bash
# bot_report.sh
# usage: ./bot_report.sh [botName] [logPath]
# default: ./bot_report.sh Googlebot /var/log/httpd/access_log
######################################
# Run this in a daily cron #
# 59 23 * * * /path/to/bot_report.sh #
######################################
# Commands
GREP=/bin/grep
DATE=/bin/date
MKDIR=/bin/mkdir
AWK=/bin/awk
SORT=/bin/sort
UNIQ=/usr/bin/uniq
TMPWATCH=/usr/sbin/tmpwatch
CAT=/bin/cat
MAIL=/bin/mail
ECHO=/bin/echo
# Global Variables
DEFAULT_BOT_NAME=Googlebot
DEFAULT_LOG_FILE=/var/log/httpd/access_log
if [ -z "$1" ]; then
BOT_NAME=${DEFAULT_BOT_NAME}
else
BOT_NAME=$1
fi
if [ -z "$2" ]; then
LOG_FILE=${DEFAULT_LOG_FILE}
else
LOG_FILE=$2
fi
PREFIX_LOG=`$ECHO $LOG_FILE | sed 's/\//_/g'`
TMP_LOG_PATH=/tmp/bot_report
TMP_LOG_FILE=${TMP_LOG_PATH}/${PREFIX_LOG}_`${DATE} +%F`.log
TMP_REPORT_FILE=${TMP_LOG_PATH}/${BOT_NAME}_report.txt
EMAIL=user@domain.tld
###########################
# Nothing to change below #
###########################
# Produce a temp file to work with for todays date
tmp_file_out() {
[ -d "${TMP_LOG_PATH}" ] || $MKDIR ${TMP_LOG_PATH}
if [ ! -f "${TMP_LOG_FILE}" ]; then
$GREP `$DATE +%d/%b/%Y` $LOG_FILE > $TMP_LOG_FILE
fi
}
# Clean up temp file older than a day
tmp_file_clean() {
$TMPWATCH 24 $TMP_LOG_PATH
}
# Create report
report_out() {
$ECHO "######## Success Hits ########" > $TMP_REPORT_FILE
$GREP " 200 " $TMP_LOG_FILE | $AWK -v bot="$BOT_NAME" '$0 ~ bot {print $7}' | $SORT | $UNIQ -c | $SORT -rn >> $TMP_REPORT_FILE
$ECHO >> $TMP_REPORT_FILE
$ECHO "######## Failed Hits ########" >> $TMP_REPORT_FILE
$GREP " 404 " $TMP_LOG_FILE | $AWK -v bot="$BOT_NAME" '$0 ~ bot {print $7}' | $SORT | $UNIQ -c | $SORT -rn >> $TMP_REPORT_FILE
}
# Mail report
mail_report() {
$CAT $TMP_REPORT_FILE | $MAIL -s "bot report: ${BOT_NAME}" $EMAIL
}
#
# Main
#
tmp_file_out
report_out
mail_report
tmp_file_clean
exit 0
- sandip's blog
- Login or register to post comments
network programming in bash
Submitted by sandip on Wed, 03/17/2010 - 14:32Discusses the possibilities of using Bash for socket programming using /dev/tcp with file descriptors redirection.
X2go - Open source terminal server project (alternative to FreeNX)
Submitted by david23 on Mon, 03/15/2010 - 10:01x2go is an open source terminal server project offering a comprehensive “server based computing” solution. Combining the advantages of existing systems it features ease of use, performance and scalability.
php with mysqlnd support
Submitted by sandip on Sat, 03/13/2010 - 02:11You can now get the latest PHP with mysqlnd (MySQL Native Driver) support via remis' yum repository as mentioned in PHP-5.3,-zts-and-mysqlnd. The blog mentions that this is enabld in php-zts. However, no php-pecl extension are available and neither are some of the extensions thread safe. So I went about rebuilding php package from source for mysqlnd support.
-
Download the source php rpm from http://rpms.famillecollet.com/SRPMS/ . Note, I have used php-5.3.2 which is the latest as of this writing.
Install and apply the below diff patch to the spec file via `patch -p0 < {new_patch_file}` where "new_patch_file" has the below contents:
--- php-5.3.2-remi.spec.orig 2010-03-11 23:07:04.000000000 -0600
+++ php-5.3.2-remi.spec 2010-03-11 23:36:03.000000000 -0600
@@ -24,6 +24,7 @@
%global phpversion 5.3.2
# Optional components; pass "--with mssql" etc to rpmbuild.
+%define with_mysqlnd %{?_with_mysqlnd:1}%{!?_with_mysqlnd:0}
%define with_oci8 %{?_with_oci8:1}%{!?_with_oci8:0}
%define with_ibase %{?_with_ibase:1}%{!?_with_ibase:0}
%if %{?rhel}%{?fedora} > 4
@@ -677,6 +678,11 @@
%if %{?fedora}%{?rhel:99} >= 10
--with-system-tzdata \
%endif
+%if %{with_mysqlnd}
+ --with-mysql=shared,mysqlnd \
+ --with-mysqli=shared,mysqlnd \
+ --with-pdo-mysql=shared,mysqlnd \
+%endif
$*
if test $? != 0; then
tail -500 config.log
@@ -704,8 +710,13 @@
--enable-dba=shared --with-db4=%{_prefix} \
--with-xmlrpc=shared \
--with-ldap=shared --with-ldap-sasl \
+%if %{with_mysqlnd}
+ --with-mysql=shared,mysqlnd \
+ --with-mysqli=shared,mysqlnd \
+%else
--with-mysql=shared,%{_prefix} \
--with-mysqli=shared,%{_bindir}/mysql_config \
+%endif
%ifarch x86_64
%{?_with_oci8:--with-oci8=shared,instantclient,%{_libdir}/oracle/%{oraclever}/client64/lib,%{oraclever}} \
%else
@@ -725,7 +736,11 @@
--enable-fastcgi \
--enable-pdo=shared \
--with-pdo-odbc=shared,unixODBC,%{_prefix} \
+%if %{with_mysqlnd}
+ --with-pdo-mysql=shared,mysqlnd \
+%else
--with-pdo-mysql=shared,%{_prefix} \
+%endif
--with-pdo-pgsql=shared,%{_prefix} \
--with-pdo-sqlite=shared,%{_prefix} \
--with-pdo-dblib=shared,%{_prefix} \
@@ -756,6 +771,16 @@
--with-recode=shared,%{_prefix}
popd
+%if %{with_mysqlnd}
+without_shared="--without-gd \
+ --disable-dom --disable-dba --without-unixODBC \
+ --disable-xmlreader --disable-xmlwriter \
+ --without-sqlite \
+ --disable-phar --disable-fileinfo \
+ --disable-json --without-pspell --disable-wddx \
+ --without-curl --disable-posix \
+ --disable-sysvmsg --disable-sysvshm --disable-sysvsem"
+%else
without_shared="--without-mysql --without-gd \
--disable-dom --disable-dba --without-unixODBC \
--disable-pdo --disable-xmlreader --disable-xmlwriter \
@@ -764,6 +789,7 @@
--disable-json --without-pspell --disable-wddx \
--without-curl --disable-posix \
--disable-sysvmsg --disable-sysvshm --disable-sysvsem"
+%endif
# Build Apache module, and the CLI SAPI, /usr/bin/php
pushd build-apache
rpmbuild -bb --with mysqlnd --define "rhel 5" SPECS/php-5.3.2-remi.specTo install via yum, change to the directory where rpms are located and recreate the repodata via:
createrepo .
FBReader - e-book reader for Linux desktops
Submitted by david23 on Mon, 03/08/2010 - 03:40FBReader is an e-book reader. It currently works on the Sharp Zaurus, Siemens Simpad with Opensimpad ROM, Nokia
Internet Tablet (Maemo platform), Archos PMA430, Motorola E680i/A780/A1200 smartphones, PepperPad 3, Asus Eee PC, IRex iLiad, UMPC, and desktop computers running Linux, Windows XP/Vista, or FreeBSD. It supports several e-book formats: epub, plucker, palmdoc, zTXT, HTML, CHM, fb2, TCR (psion text), OEB, OpenReader, RTF, non-DRM'ed Mobipocket, and plain text.
Recent comments
7 years 22 weeks ago
7 years 22 weeks ago
7 years 22 weeks ago
7 years 22 weeks ago
8 years 2 weeks ago
8 years 4 weeks ago
8 years 27 weeks ago
8 years 33 weeks ago
8 years 33 weeks ago
8 years 42 weeks ago