June 2010 Archives

Wed Jun 30 12:50:09 EEST 2010

How to configure ProFTPD to chroot users to /home directory or any other selected directory

If you're using ProFTPD user on a Linux server you most certainly has wondered how you can configure the FTP server to chroot (or jail) it's users to a particular directory of choice.

By the default the behaviour of ProFPTD is not to use any chrooting, I believe because chrooting is not yet a mass well accepted standard, so you will have to do a minor modifications to proftpd.conf file.
Actually it's a way easier than it sounds to configure the ProFTPD to chroot / jail it's users.

To configure ProFTPD to chroot it's users to the /home directory all you have to do is edit your proftpd.conf
On Debian Linux and many other Linux distributions the proftpd.conf is located in /etc/proftpd/proftpd.conf

root@linux-server:~# vim /etc/proftpd/proftpd.conf


Therein uncomment the line # DefaultRoot ~


to read

DefaultRoot ~


If you further need to chroot proftpd users to be jailed to let's say their public_html file for security reasons you can just change the up-mentioned proftpd DocumentRoot directive to:

DefaultRoot ~/public_html


Hopefully partaking this steps will be a step further to make your Linux server a bit more secure.

Posted by hip0 | Permanent link

Tue Jun 29 18:12:22 EEST 2010

Quick way to add user to another user group in Linux

Here is how to add user to be a member of another user's group in GNU/Linux.
Everytime I have to add user to a group I always try to remember for a few seconds how I did it last time.
Therefore I finally decided to blog it here that I possibly help to somebody out there and help myself easily look for it among the posts in case I forget sometime in the future:
There are two ways to add an user to a group.

1. Add user to a group directly editting /etc/groups

Let's assume you are in need to add user test to the www-data group Here is how:

linux-server:~# vim /etc/groups
Put in the file
www-data:x:33:test
Save the file and that should be enough, in the next login with user test you can observe the user is added to the www-data group
By typing the id command in the command line.


linux-server:~$ id
id=1000(test) gid=1000(test) groups=1125(test),1124(www-data)


2. Add user to another user group using the useradd and usermod commands

If you're creating a brand new user to be membering a group use:

linux-server:~# useradd -G
linux-server:~# useradd -G www-data test
linux-server:~# passwd test


If for clarity you'd like to add an already existing user using a linux command consider using usermod

linux-server:~# usermod -a -G www-data test



Posted by hip0 | Permanent link

Tue Jun 29 17:48:22 EEST 2010

How to get full url to accessed controller action in Zend php framework

I've recently wondered how I can get the full url address of a requested controller/action in Zend php framework.
After some tries I finally did it:

Here is how to achieve it:

$fullUrl = "http://". $this->getRequest()->getHttpHost() . $this->view->url();


Posted by hip0 | Permanent link

Mon Jun 28 14:06:46 EEST 2010

How to permanently Disable Firefox from storing web caches and how to delete a web cache for a particular web page

If you're a web developed you probably have experience "the curse of the developer" (the web browser caching).
Web caching is really annoying if you have to test your scripts via a browser.
Therefore completely disabling the Firefox cache on firefox is a definite prerequirement before you can start serious web development.

Here is few steps through which you can disable Firefox caching:
1. Launch your firefox browser

2. Type about:config in your browser address bar

3. Type 'cache' in the Filter search bar and look for the variable network.http.use-cache
Double click the network.http.use-cache variable and set it to false.
If you further want to further enable / disable the Firefox / Iceweasel web cache simply click the same variable twice and the browser web caching will be enabled once again.

Disabling the network.http.use-cache should be also beneficial if you're accessing the internet or any domain via a Squid or other kinds of web proxys.

Disable firefox cache

Another handy "feature" embedded into Firefox is the reload of a page and it's dependencies without quering the browser cache (that in case if the browser cache is enabled).
So if you want to temporary disable the web browser from using cache for a cetrain web page hold the SHIFT key and then press the browser reload button or holding the CTRL button + the browser reload button a quick shortcut is also available through pressing CTRL + R
This kind of temporary disable cache for a webpage goody is also available in Internet Explorer (IE) 6 and 7 as well as the MacOS X Safari and possibly other brothers too.

If it's necessary for you to delete the web cache stored just for a particular web page then in = >Firefox 3.0.x and consider using Firefox's Cookie Editor to start using it navigate to:

Tools -- > Cookie Editor
The Cookie Editor is also available in Debian's Iceweasel, so the explained ways to clear up cache should be also available in Linux.

Posted by hip0 | Permanent link

Sun Jun 27 14:21:17 EEST 2010

Installing lm-sensors (hardware sensors) support on Intel(R) Core(TM) i7 CPU on Debian Lenny Linux to track your system hardware temperature

In this topic I'll explain you step by step the exact steps I took to install lm-sensors (sensors) support on Debian Lenny GNU/Linux to work with a Quad Core Intel(R) Core(TM) i7 CPU
Normally in most hardware installing lm-sensors and running and completing a simple sensors-detect would be sufficient for lm-sensors to detect most of the system hardwares,
however since Intel i7 architecture is rather new and on the other hand Debian Lenny's sensors kernel module and lm-sensors packages are comparatively old as Debian's stable version releases are officially released with the approximately 2 years release cycle.
Thus albeit the usual simple way to detect with the command:

debian-server:~# sensors-detect


wasn't able to detect any matching lm-sensors supported sensors hardware to track.

A quick google search revealed that other people are experiencing problems with configuring lm-sensors to work on Linux with the i7 intel CPU architecture and luckily some of them even succeeded.

A good forum discussions on the topic that I found were the Ubuntu forums:

lm-sensors and P6T6 WS Revolution mobo with i7 920 CPU as well as the debian.net forum thread:
Where is coretemp module?

Therefore I used the information of both of the aforementioned locations and was able to succesfully install and run the i7 Intel CPU architecture support with lm-sensors in a quick and simple way on a Debian kernel returning an uname of:
Linux debian-server 2.6.26-2-amd64 #1 SMP Tue Jan 12 22:12:20 UTC 2010 x86_64 GNU/Linux using the following steps:

1. Download, Compile and install a patched source of the kernel coretemp.ko module - This is an absolute requirement except which you won't never ever be able to make the sensors work on Debian Lenny.
By the default the coretemp.ko kernel module provided with Debian Lenny prepackaged in the 64 bit kernel image in linux-image-2.6.26-2-amd64 doesn't have an included support for the i7 intel architecture.
So procceed with downloading:
debian-server:~# wget http://pc-freak.net/files/coretemp.zip


2. Install necessary packages which will be required for a succesful compile and install of the patched coretemp.ko kernel module

debian-server:~# apt-get install build-essential gcc linux-headers-`uname -r` module-assistant lm-sensors


If you already have the lm-sensors - 1:3.0.2-1+b2 utilities to read temperature/voltage/fan sensors already installed you can remove the lm-sensors string from the up-mentioned apt-get command line.

3. Configure and Install the new patched version of coretemp.ko which will support the I7 Intel CPU architecture on Debian

debian-server:~# cd coretemp/
debian-server:/root/coretemp# m-a update
debian-server:/root/coretemp# m-a prepare
debian-server:/root/coretemp# make
debian-server:/root/coretemp# make install


You should see an output similar to if the new coretemp.ko is properly installed:

mv /lib/modules/2.6.26-2-amd64/kernel/drivers/hwmon/coretemp.ko /lib/modules/2.6.26-2-amd64/kernel/drivers/hwmon/coretemp.ko.old
cp coretemp.ko /lib/modules/2.6.26-2-amd64/kernel/drivers/hwmon/
depmod -a


4. Load the intel i7 lm-sensors necessary kernel modules and configure the modules to be loaded on Linux System Boot

First we load the necessary modules into the kernel:

debian-server:~# modprobe coretemp
debian-server:~# modprobe w83627ehf force_id=0x8860


Next we schedule the modules to automatically load in debian boot time:

debian-server:~# echo "w83627ehf force_id=0x8860" >> /etc/modules
debian-server:~# echo "coretemp" >> /etc/modules


Now you could try out the sensors if they already report properly the CPU and system temperatures and statuses using:

debian-server:~# sensors
w83627ehf-isa-0ca0
Adapter: ISA adapter
VCore: +0.99 V (min = +0.00 V, max = +1.74 V)
in1: +6.34 V (min = +4.59 V, max = +7.66 V)
AVCC: +3.34 V (min = +3.12 V, max = +0.03 V) ALARM
3VCC: +3.34 V (min = +2.05 V, max = +2.78 V) ALARM
in4: +1.22 V (min = +0.08 V, max = +1.94 V)
in5: +0.97 V (min = +0.87 V, max = +0.35 V) ALARM
in6: +3.07 V (min = +2.71 V, max = +2.87 V) ALARM
VSB: +3.33 V (min = +2.53 V, max = +3.49 V)
VBAT: +3.28 V (min = +3.36 V, max = +2.51 V) ALARM
in9: +0.00 V (min = +0.70 V, max = +0.82 V) ALARM
Case Fan: 0 RPM (min = 1506 RPM, div = 128) ALARM
CPU Fan: 0 RPM (min = 703 RPM, div = 128) ALARM
Aux Fan: 0 RPM (min = 2636 RPM, div = 128) ALARM
fan4: 0 RPM (min = 3515 RPM, div = 128) ALARM
fan5: 0 RPM (min = 703 RPM, div = 128) ALARM
Sys Temp: +32.0°C (high = +72.0°C, hyst = -34.0°C) sensor = thermistor
CPU Temp: -31.5°C (high = +80.0°C, hyst = +75.0°C) sensor = thermis
AUX Temp: +29.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermis
cpu0_vid: +3.500 V

coretemp-isa-0000
Adapter: ISA adapter
Core 0: +55.0°C (high = +80.0°C, crit = +100.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1: +53.0°C (high = +80.0°C, crit = +100.0)

coretemp-isa-0002
Adapter: ISA adapter
Core 2: +53.0°C (high = +80.0°C, crit = +100)

coretemp-isa-0003
Adapter: ISA adapter
Core 3: +52.0°C (high = +80.0°C, crit = +100)

coretemp-isa-0004
Adapter: ISA adapter
Core 4: +55.0°C (high = +80.0°C, crit = +100.0)

coretemp-isa-0005
Adapter: ISA adapter
Core 5: +53.0°C (high = +80.0°C, crit = +100)

coretemp-isa-0006
Adapter: ISA adapter
Core 6: +53.0°C (high = +80.0°C, crit = +100)

coretemp-isa-0007
Adapter: ISA adapter
Core 7: +52.0°C (high = +80.0°C, crit = +100)


Yeah! It's pretty handsome that lm-sensors reports the CPU system statuses for each of the Intel i7 cores :)
debian-server:~# unzip coretemp.zip
debian-server:~# cd coretemp/



Posted by hip0 | Permanent link

Sat Jun 26 12:00:39 EEST 2010

Influence of Rock, Hard Rock, Metal, Punk and Alternative on the human mood (my personal experience in it)

I myself used to be a metal head for more about 10 years. During the years the amount of music swallowed varied, however there was a certain tendency that I listen more and more metal. I even had a period in my life where I cannot live without metal.
The metal and alternative music slowly became my second nature. I started listening to Heavy metal and Rock music when I was 14 years old, I started with the bands: Metallica, Iron Maiden, Manowar, Motorhead, AC/DC, DIO then when some time passed I progressed further with Sepultura, Pantera, Kreator, Death etc.
Few years later my primary metal style of choice was Death metal with bands like: Morbid Angel, Cannibal Corpse, Benediction, Six Feet Under, Bolt Thrower etc. My death metal period in my life lasted for like a year and a half, then I switched to even heavier types of Metal music like Black Metal, Doom Metal etc.. I was into the darkest metal of metals for about 3 or 4 years bands like Dimmu Borgir, Venom, Bathory, Immortal, Satyricon, Darkthrone, Dark Funeral were my idols for this phase of my life.

My last phase of a "development" as a metal head was when I switched my favour metal style of choice to Gothic and Industrial metal & rock music in that times of gothic I was completely after bands like Lacrimosa, London After Midnight, Sopor Aeternus & The Ensembe of Shadows, The Cure, Crematory almost paralelly I slipped into listening to Nine Inch Nails, Front Line Assymbly, Front 242, Ministry etc.
With the years I noticed that I started getting more and more aggressive and more and more negatively pitched towards life in general (which I nowdays relate more or less with my metal background).
Probably as an effect of listening to metal, I started being more sarcastic, I started spending more time thinking of death, even at periods some suicidal thoughts started emerging.
This kind of music make me more or less apathic towards life and at the same time triggered hyper sensuality in me, which if probably analyzed by a psychologist would be ranked as a mental disored.
It was the major part of my life because all my life started turning around the music I started looking for other metal heads I started going to places where other people who are into metal gather (metal pubs, metal bars, metal clubs).
At times almost all my contacts with people were also with individuals from metal backgrounds, I started despising people with other music preferences (judging people), I also started thinking of people which are not into metal most of the time as inferior, I considered non-metal heads like a un-elightened or something.
You can imagine how insane this kind of perception of life is and how much the metal music was involved with this wrong understanding of human genesis.

With the time I realized that listening to metal music consitutes a major "disease" like condition and has a negative influence over my general life, so I decided to limit my relations with people who are into the deep metal underground and started changing my life for good when I substituted my extraordinary passion for metal for a passion for Orthodox Christian Church music and Classical Music - mostly from the Baroque Classics era.
Nowadays I do listen mostly to classical composers like J.S. Bach, Buxtehude, Antonio Vivaldi, Claudio Monteverdi and many many more

My wrong perception for the world and my behaviour alterations, my empathy towards life and people which I think were directly influenced by listening to metal music is almost gone, though the old wrong (mind and spirit) pattern remains are silently sleeping somewhere in me and looking for a ways to feed it up and to rise again.
Another negative consequence of listening to metal music was the increase in my criticism. Here I should note that my by nature I'm a critical person, however listening to metal make me even more critical and judgemental and rebellious.
As metal music in most of it's conceptual imaginary drawings speaks about rebelion, I think it's worthy to mention it here as one of metal's wicked stimulus over the general metal fan.
I have to admit that it was metal music that partly kindled my interest towards religion and laters by God's mercy led me to find the truth in the Orthodox Christian Church
Metal teaches people to leave the old ways and live a wild life without any constraints it teaches the man to turn it's back to the old ways and look for a new order of things.
I think metal teaches man to rebel against any set government authorities and life order.
This kind of music preaches complete freedom from any normal habits, it pushes the fan to live on the edge, get the best of life, rarely talking about the consequences on the person who grasps this abnormal ways (ideas).

However like everything listening doesn't have a 100% percents negative impact, but also has some benefits even though the benefits on the personality are quite less notable than the negative influence.
One of the major benefits of metal on man is it's charge to sometimes show off people the real sight of things in life, it cuts the veil every now and then and does try to look for a truth, so metal could make you a truth seeker.
Another positive benefit is that many metal bands deal with a deep manners and problems the humanity faces, so listening to metal could stimulate your psyche to be think more deeply.
Last but not least is that metal deals with occult, myths and religion with that in mind, metal could trigger the listener interest into religion or occult.
It is also a music which exposes the human need for spirituality and is a good mirror of todays people corrupted spirituality.
Talking about faith, metal is about faith just like any other religion like christianity, islam or buddhism. So most people who are into metal does believe in it like into an idol that could advance them in a way.
I personally previously believed that listening to metal music, improves my thinking process and makes me smarter in a way (of course this is a delusion).
However according to modern research in certain cases it is possible that certain kind of metal has a positive impact on mind development.
Of course things aren't so black and white, because talking about the metal genre and it's influence I should take in mind, the music versatility.
There is a Christian Rock and Christian Metal as well as the so called White Metal which claim they do good since they preach Christianity and the "good news" of the Saviour Jesus Christ who has saved humanity from death and hell
Since the music also incorporates the good old metal riffs, my personal experience shows me that the influence of the so-called Christian Rock and Metal Music is not that beneficial as they claim, but it can easily even spread false ideas related to Christianity and implant false or heretic beliefs in Humans.

It's an interesting fact that some of my personal experiences with metal and rock and it's influence on my life and person does co-incide with some Research Results on the topic of metal listening.
For instance there is a quite a research on the topic of mood swings and listening to metal music, the mood swing problem should be a well known problem to many people who have been into gothic metal or alternative like Pearl Jam, Alice in Chans etc.
If you want to see some researches data results from experiments related to the effect of Metal on Human Psyche I kindly urge you to further see the below articles containing research results:
Psychology of Heavy Metal Music: Effects on Mood, Aggression, Suicide, Drug Use and Intelligence
The Effects of Heavy Metal Music on Attitude

Posted by hip0 | Permanent link

Fri Jun 25 13:06:52 EEST 2010

How to Benchmark your Apache Website with siege and Apache Benchmark (ab) on Linux and FreeBSD

I've recently had to benchmark a website thus I decided to share a quick way on how you can achieve a general way to benchmark your webserver configuration and your website responce times while under heavy loads.

The first and very classical way is to use ab - the Apache HTTP server benchmarking tool

To install AB (Apache Benchmark on Debian GNU/Linux it's rather easy), invoke:

debian-server:~# apt-get install apache2-utils


On FreeBSD ab is part of the apache port so you don't need to install anything extra to start using is.
Further on a very basic way to test your Apache performance would be:

debian-server:~# ab -n 1000 -c 100 http://yourwebsite.com

The above command would instruct apache benchmark to make 1000 connections to http://yourwebsite.com where the connection concurrency would be of 100 parallel connections
Another possible use of the Apache Benchmark tool could be for instance:

debian-server:~# ab -kc 20 -t 30 http://yourwebsite.com/


This would instruct apache benchmark to open 20 connections and keep alive the connecitons sending requests to the Webserver for 30 seconds.

Though using AB is not a bad way to make a performance measurement under a certain loads, the results in many cases won't be completely accurate.

For a bit more accurate performance check results I advice you to check out Siege the HTTP performance stress tester

On FreeBSD - the siege webserver benchmark tool is available via the ports tree. So the install on FreeBSD is pretty straight forward with:

freebsd-box# /usr/ports/benchmarks/siege
freebsd-box# make install cleam


Luckily the siege apache stress tester has a package available for Debian Linux, so installing if you're following this article would come to the trivial apt-get install:

debian-server:~# apt-get install siege


On other Linux / Unix platforms you would have to download the latest siege source release and compile it via the instructions in the source archive README file.

Assuming that you succeed in installing siege, next to start using it in a very simple way to check your Website of Webserver for performance as well as get some Benchmarking on how it operates under different amount of user connections you can execute something like:

debian-server:~# siege -b -c 100 -r 10 http://yourwebsite.com


This will benchmark the http://yourwebsite.com website running on top of your webserver of choice, running with 100 concurrent connections to the website, running the test in a loop 10 times.

By default all output from the siege Apache benchmarking tests would be logged in the ouput file /var/siege.log
Another handy opportunity siege provides is the ability to check a number of provided website url address via the -f option.

There possibly a number of other valuable tools to benchmark your Webserver (Apache or the webserver type you use), however I belive this twos should be enough for most benchmarkers out there.


Posted by hip0 | Permanent link

Thu Jun 24 13:15:55 EEST 2010

How to auto load kernel module on system boot in CentOS 5

If you're in need to auto load a kernel module during boot time on CentOS 5 Linux, but you want to do it in the "proper way" instead o f placing it directly into the good old /etc/rc.local .
Then it might be a good idea to know that CentOS is loading it's kernel modules using the wrapper script /etc/rc.sysinit
In that script there is a small for loop which instructs the system to load all scripts located in the /etc/sysconfig/modules/ directory.
Thereafter a quick way to include a new kernel module to auto boot up on startup could be accomplished through:

echo "modprobe somemodulename" > /etc/sysconfig/modules/somemodulename.modules
chmod +x /etc/sysconfig/modules/somemodulename.modules


Here I'll illustrate with a real life example, let's say you're in need to auto lood during server boot process the kernel module softdog which is a must have in most Linux hardwares since they don't include a hardware watchdog equipped with it.

Execute the commands below to instruct your CentOS to autoload the softdog kernel module next time on boot:
[hipo@centos-server ~]# echo -e '#!/bin/sh\nMODULES="softdog' > /etc/sysconfig/modules/softdog.modules
[hipo@centos-server ~]# echo -e "for i in $MODULES ; do\nmodprobe $i >/dev/null 2>&1; done" >> /etc/sysconfig/modules/softdog.modules
[hipo@centos-server ~]# echo "modprobe watchdog" >> /etc/sysconfig/modules/softdog.modules
[hipo@centos-server ~]# chmod +x /etc/sysconfig/modules/softdog.modules


To also load the same module immediately use modprobe

[hipo@centos-server ~]# /sbin/modprobe softdog


This kind of approach to the problem should also work in other Redhat based Linux distributions like Redhat, Fedora, RHEL etc.
A similar article to this could be seen on The really right, modern and clean way to load modules in CentOS 5

Posted by hip0 | Permanent link

Wed Jun 23 13:57:13 EEST 2010

Vpopmail Virtualdomain post installation config and tuning of quotas and domain aliases

Many qmail+vpopmail install tutorials online give a good insight on how to install vpopmail on top of a qmail mail server.
However very few of them explain on how to setup and configure the basic vpopmail policy concerning new user creations.
For instance have you ever wondered how can you configure your vpopmail to create all new users by default with a quota limitation of 500MB?
I bet you have.

In this small post I'll discuss on how to setup (configure) the default policy concerning user creation of new virtual domain users in vpopmail.

1. In order to configure the maximum amount of new created users quota and the maximum number of messages a user mailbox may hold in vpopmail you should edit ~vpopmail/etc/vlimits.default

debian-server:~# vim ~vpopmail/etc/vlimits.default
Then put in the vlimits.default file:


# 500MB
default_quota 524288000
# maximum number of messages in a mailbox
default_maxmsgcount 10000


The above two vpopmail vlimits.default configuration directives are to set your new usernames user@yourvirtualdomain.com to default_quota of 500 MB, which I suppose in most cases would be enough for most users, it will also set the maximum numbers in a mailbox to be equal to 10000 mail messages

2. Furthermore it's necessary that we create .over-quota.msg and the .quotawarn.msg

debian-server:~# touch /var/vpopmail/domains/.quotawarn.msg
debian-server:~# touch /var/vpopmail/domains/.over-quota.msg


Put in .quotawarn.msg something similar to the text:

From: Postmaster <postmaster@mydomain.org>
Reply-To: postmaster@mydomain.org
Organization: My Organization
To: User:;
Subject: Mail quota exceeding
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1251
Content-Transfer-Encoding: 8bit

Dear User,

The size of your mailbox has exceeded a warning threshold,
that is set by the system administrator.

Please contact our IT Department:

email:me@mydomain.org
Tel.: +359 (42) 601694


Thereafter, it's a necessity to put in the .ovar-quota.msg the text

Message rejected. Not enough storage space in user's mailbox to accept message.


Having done that we need to set the proper permissions for the newly created files:
debian-server:~# chown vpopmail.vchkpw /var/vpopmail/domains/.*msg


Note that if your vpopmail is installed in a different location than the default one /var/vpopmail it will be required that you set the proper location in the touch and chown commands foreshown above.

Then it's probably idea to add a mail alias if your mail server domain is mail.example.net and your primary mail vpopuser domain is example.net issue the command:

debian-server:~# /var/vpopmail/bin/vaddaliasdomain mail.example.net example.net


Tt's an interesting fact that I mistakenly did the domain alias the other way around with a command: debian-server:~# /var/vpopmail/bin/vaddaliasdomain example.net mail.example.net

instead of

debian-server:~# /var/vpopmail/bin/vaddaliasdomain mail.example.net example.net


I therefore wanted to reverse the alias in order to instruct vpopmail's virtualdomain alias to be from mail.example.net to point to example.net.
Fortunately I found out that actually the domain alias though my wrongly inverted syntax has added itself the domain alias in a correct way, I got that by checking the domain information with /var/vpopmail/bin/vdominfo

Posted by hip0 | Permanent link

Tue Jun 22 13:41:56 EEST 2010

Problems during installation of OpenX on Debian Lenny Linux and their solutions

If you're installing openx on a Debian Linux, you will most probably be forced to note/change few things before the openx installation launches correctly:

Here are a list of things to check and assure are properly configured before you procceed 1. If you use the disable_functions, it's recommended to comment it out during the openx installation:
#disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source


2. Increase memory_limit to at least 128MB this is a minimum requirement for openx to run properly:
Edit your /etc/php5/apache2/php.ini and set memory_limit to:
memory_limit = 192M


3. Set the date.timezone in your /etc/php.ini

You need to properly set the date.timezone function in Apache's php.ini othewise the OpenX installation will refuse to continue with a warning:

timezone OpenX has detected that your PHP installation is returning 'System/Localtime' as the timezone of your server. This is because of a patch to PHP applied by some Linux distributions. Unfortunately, this is not a valid PHP timezone. Please edit your php.ini file and set the 'date.timezone' property to the correct value for your server.


It took me a while until I found the proper way to set the date.timezone php variable, below is a correct way to set the date.timezone in php.ini:

echo 'date.timezone = Europe/London' >> /etc/php5/apache2/php.ini


Note that many people has provided a misinformation concerning the setup of date.timezone on php version 5.2 or 5.3.
Many posts online claim that the date.timezone should be set with date.timezone = "Europe/London" having the quotation marks is variable syntax error so if you enter it that way in your php.ini the date.timezone variable won't be set correctly.
Some people on the net has also suggested that date.timezone variable format is in the form date.timezone = "US/Central" which I suspect is again erroneous.

Actually the Openx system requirements has a nice explanation on how to properly set the date.timezone in order to fix any emerging issues with the OpenX install, so I suggest you take 5 minutes time and read thoroughly before you start with the OpenX installation.


Posted by hip0 | Permanent link

Mon Jun 21 13:45:33 EEST 2010

rewrite_subject and subject_tag has been substituted for spamassassin version 3.x to rewrite_header Subject

While I was checking one of the spamassassin daemon that I have installed in the past for configuration errors in loca.cf and the other loaded spamassassin conf rules file, I have faced the following error:

This warnings appeared when I was checking my spamassassin configuration using the command:

debian-server:~# spamassassin --lint


Issuing the up-mentioned command returned the following warnings:

[18056] warn: config: failed to parse line, skipping, in "/etc/spamassassin/local.cf": rewrite_subject 1 [18056] warn: config: failed to parse line, skipping, in "/etc/spamassassin/local.cf": subject_tag [SPAM found in message] [18056] warn: lint: 2 issues detected, please rerun with debug enabled for more information

A quick search in google for the error opened my eyes that actually I'm using old and obsolete spamassassin directives in my /etc/mail/spamassassin/local.cf

Starting with version 3.x of spamassassin different syntax is used to tag cought spam messages and substitute them for a different custom selected header.

1. To solve the issue all I had to edit my /etc/mail/spamassassin/local.cf

2. Comment out or delete in the local.cf file:

rewrite_subject 1
subject_tag [SPAM found in message]


So after the change the two directives should be with the shebang shebang, e.g.:

#rewrite_subject 1
#subject_tag [SPAM found in message]


3. Now include the spamassassin substitute for rewrite_subject and subject_tag rewrite_header Subject

For instance put in local.cf something like:

rewrite_header Subject *****SPAM*****

Now restart your spamassassin either by invoking /etc/init.d/spamassassin restart if it's running as a stand alone daemon or if it's ran through daemontools my will have to restart it with svc, like for instance:

debian-server:~# svc -d /service/spamd
debian-server:~# svc -t /service/spamd
debian-server:~# svc -u /service/spamd

The warning messages:

[18056] warn: config: failed to parse line, skipping, in "/etc/spamassassin/local.cf": rewrite_subject 1 [18056] warn: config: failed to parse line, skipping, in "/etc/spamassassin/local.cf": subject_tag [SPAM found in message] [18056] warn: lint: 2 issues detected, please rerun with debug enabled for more information should no longer appear whilst you check your spamassassin configuration :)

Posted by hip0 | Permanent link

Sun Jun 20 23:12:06 EEST 2010

How to automatically reboot (restart) Debian GNU Lenny Linux on kernel panic, some general CPU overload or system crash

If you are a system administrator, you have probably wondered at least once ohw to configure your Linux server to automatically reboot itself if it crashes, is going through a mass CPU overload, e.g. the server load average "hits the sky".
I just learned from a nice article found here that there is a kernel variable which when enabled takes care to automatically restart a crashed server with the terrible Kernel Panic message we all know.

The variable I'm taking about is kernel.panic for instance kernel.panic = 20 would instruct your GNU Linux kernel to automatically reboot if it experiences a kernel panic system crash within a time limit of 20 seconds.

To start using the auto-reboot linux capabilities on a kernel panic occurance just set the variable to /etc/sysctl.conf

debian-server:~# echo 'kernel.panic = 20' >> /etc/sysctl.conf


Now we will also have to enable the variable to start being use on the system, so execute:

debian-server:~# sysctl -p
There you go automatic system reboots on kernel panics is now on.
Now to further assure yourself the linux server you're responsible of will automatically restart itself on a emergency situation like a system overload I suggest you check Watchdog

You might consider checking out this auto reboot tutorial which explains in simple words how watchdog is installed and configured.
On Debian installing and maintaining watchdog is really simple and comes to installing and enabling the watchdog system service, right afteryou made two changes in it's configuration file /etc/watchdog.conf

To do so execute:

debian-server:~# apt-get install watchdog
debian-server:~# echo "file = /var/log/messages" >> /etc/watchdog.conf
debian-server:~# echo "watchdog-device = /dev/watchdog" >> /etc/watchdog.conf


Well that should be it, you might also need to load some kernel module to monitor your watchdog.
On my system the kernel modules related to watchdog are located in:

/lib/modules/2.6.26-2-amd64/kernel/drivers/watchdog/ Check the right module for yourself and load it if your server system is equipped with a hardware watchdog support.

If not then you should certainly try the software watchdog linux kernel module called softdog , to do so issue:
debian-server:~# /sbin/modprobe softdog


It's best if you load the module while the softdog daemon is disabled.
If you consider auto loadig the softdog software watchdog kernel driver you should exec:

debian-server:~# echo 'softdog' >> /etc/modules


That should be all your automatic system reboots should be now on! :)

Posted by hip0 | Permanent link

Fri Jun 18 22:04:39 EEST 2010

How to disable directory listing to /icons/ directory on Debian Lenny Linux

I've recently configured a new server running Debian Lenny Linux. It really irritated me that by default an Alias existed to the /icons/ directory.
It took me a while to get through the configured Virtualhosts in /etc/apache2/sites-enabled/ , the /etc/apache2/apache2.conf and check among the enabled Apache modueles existing in /etc/apache2/mods-avaiable/

I finally got that the Alias to the directory was because of a configuration directives in /etc/apache2/mods-available/alias.conf

To disable the Alias you'll have to:

debian-server:~# vim /etc/apache2/mods-available/alias.conf


Then Change in the /etc/apache2/mods-available/alias.conf : <Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>


Allow from all to to Deny from all in order to forbid access to the /icons/ directory.
If you want to completely wipe out the Alias comment out the line:

Alias /icons/ "/usr/share/apache2/icons/"


Now restart Apache and the access to the /icons directory enabled by default on Debian would be no more :)
debian-server:~# /etc/init.d/apache2 restart
Cheers :)

Posted by hip0 | Permanent link

Fri Jun 18 11:35:08 EEST 2010

Fix to error qmail-smtpd: error while loading shared libraries: libresolv.so.2: failed to map segment from shared object: Cannot allocate memory

Whilst installing a new qmail installation following instructions from www.shupp.org/toaster I have faced the error:

/var/qmail/bin/qmail-smtpd: error while loading shared libraries: libresolv.so.2: failed to map segment from shared object: Cannot allocate memory

This error is caused by a softlimit memory limitation in qmail svc's initialization respawn script, e.g. a line in /service/qmail-smtpd/run by default equals to:

exec /usr/bin/softlimit -m 8000000


To solve the issue with /var/qmail/bin/qmail-smtpd: error while loading shared libraries: libresolv.so.2: failed to map segment from shared object: Cannot allocate memory appearing in /var/log/qmail/smtpd/current it's necessary to increase the soflimit value on a machine with 8GB of memory to:
exec /usr/bin/softlimit -m 64000000

For servers with 4GB ram the proper soft limit would be about 64000000 divided by 2, or 32000000. Following that login you can determine what kind of softlimit limitation would be most probably for your server in accordance to the server amount of ram memory.

Posted by hip0 | Permanent link

Thu Jun 17 13:57:34 EEST 2010

How to solve: "LibClamAV Warning: Cannot dlopen: file not found - unrar support unavailable" error

Whilst installing clamav 0.96.1 stable from source I came across the error LibClamAV Warning: Cannot dlopen: file not found - unrar support unavailable
I then realized my clamav is compiled without unrar support in it:
So afterwards I had to recompile clamav after installing:

debian-server:~# apt-get install unrar-free
debian-server:~# apt-get install libncurses5-dev
debian-server:~# apt-get install libbz2-dev


Above libncurses5-dev and libbz2-dev doesn't have a direct relation to the missing unrar compiled in clamav, however when I was debugging, if unrar is installed I have realized support for ncurses and bzip2 was disabled in the newly clamav built from the source.
Therefore I decided to install this two as well and recompile to have the aforementioned two included in my clamav antivirus binaries.

But guess what this doesn't at all solved the LibClamAV Warning: Cannot dlopen: file not found - unrar support unavailable and the error reoccured during freshclam's initialization with /etc/init.d/freshclam .
To finallysolve that warning and properly start up clamav it was necessary to:
link /usr/local/lib/libclamunrar_iface.so.6 to /usr/lib and right after that to execute ldconfig

debian-server:~# ln -sf /usr/local/lib/libclamunrar_iface.so.6 /usr/lib/
debian-server:~# ldconfig


And Voila!
debian-server:~# /etc/init.d/freshclam stop
debian-server:~# /etc/init.d/freshclam start
Starting freshclam daemon ... done.
!
Warning Solved!
In solving the riddle The following bug report and suggestion to solve the warning helped me a bit
So if my way doesn't works for you you might considering checking it out.

Posted by hip0 | Permanent link

Wed Jun 16 09:35:38 EEST 2010

How to install djbdns local caching DNS server on Debian Lenny Linux

You might wonder why somebody would choose to install http://cr.yp.to/djbdns.html djbdns in favour of the much more popular and established bind name server.
Well I personally have the following major concernes, when I do the conscious choice to install djbdns.

- DjbDNS is fast caching DNS, according to some online tests it is sometimes at least twice faster in resolving addresses compared to bind.
- Djbdns caching server is easy to set up
- DjbDNS is Secure. It's notable that Dan Bernstein the author of djbdns is one of the most honoured security specialists and hackers out there. Dan Bernstein is also the author of the qmail email server which is currently considered the most secure MTA in the world.
- DjbDNS is small in size compared to bind, takes less system resources (though this is not a crucial difference).
- DjbDNS occupies less system memory than bind

1. Install DjbDNS via apt-get

debian-server:~# apt-get install djbdns


This will also install daemontools - which will instlal daemontools and the daemontools-run package which will add necessery entries to /etc/inittab in order to enable service supervision through daemontools.

2. Add Necessery users for the djbdns local caching server to be ready to launch

debian-server:~# groupadd dnscache
debian-server:~# useradd -g dnscache dnscache
debian-server:~# useradd -g dnscache dnslog
debian-server:~# dnscache-conf dnscache dnslog /var/dnscache


3. Configure and install djbdns local caching server files instance

debian-server:~# dnscache-conf dnscache dnslog /var/dnscache


4. Last but not least it's necessery to setup dnscache to start up automatically via daemontools's svscanboot program

debian-server:~# ln -s /var/dnscache /etc/service


If you want to further dig into the nice djbdns caching linux/bsd server then be sure to checkout djbdnksrocks's website
Now to start using the newly configured DNS caching server on localhost add to your /etc/resolv.conf

echo 'nameserver 127.0.0.1' >> /etc/resolv.conf


Posted by hip0 | Permanent link

Tue Jun 15 15:18:53 EEST 2010

vsftp 421 Service not available, remote server has closed connection with vsftp and its solution

I've spend almost an hour trying to isolate a problem that persisted with slow ftp transfers .
First I thought the slowness is because of some kind of firewall rules, anyways I've tested disabling the iptables firewall rules and the effect was absolutely the same.
I was able to login normally to the newly configured vsftp server on Debian installed through:

debian-server:~# apt-get install vsftpd
The vsftp is configured to run as a stand alone service and not via inetd. A copy from the non-working vsftpd.conf can be obtained from here
I couldn't find any fault or misconfigured variable in the above mentioned ftp configuration file.
The file doesn't contain neither a syntax nor logical errors. The Vsftpd service was running as a daemon perfectly fine.
I read online about some suggestions that something could be wrong with my /etc/hosts.allow or /etc/hosts.deny files but neither of them doesn't contained any deny rules.
Though I tried entering the following line to /etc/hosts.allow:

vsftpd: ALL: ALLOW


Guess what nothing changed, the uploading slowness and the error message:

421 Service not available, remote server timed out. Connection closed

was at hand.

I tried even transffering data files on localhost whilest the firewall was disabled using:

debian-server:~# ftp 0
Connected to 0 (0.0.0.0).
user: hipo
pass: *********
ftp>put file.tar.gz
229 Entering Extended Passive Mode
150 Ok to send data.

421 Service not available, remote server timed out. Connection closed


I also tried raising up the data_connection_timeout which by default was equal to 120 secs to data_connection_timeout=720

This doesn't help as well. Lest that I tried also to fix the issue through changes in the following vsftp variables:
connect_from_port_20=NO
xferlog_enable=NO
local_max_rate=50 max_per_ip=40
max_clients=50


Nomatter what I tried the shitty transfer timeout error was determined to reappear:
421 Service not available, remote server timed out. Connection closed


Pretty much like problems passing through an arcade game super-boss ! ghh ..
Following some forum suggestions that might help resolving the error I tried also the vsftpd conf variables:

pasv_enable=YES
pasv_min_port=11000
pasv_max_port=11010


Again the 421 Service not available, remote server timed out. Connection closed during a file transfer occured!

That completely pissed me off, so I did a radical decision. Just wipe out vsftpd and exchange it for the easier to implement and less problematic good old PROFTPD
My experience with proftpd as a server ftp daemon was most of times positive. It was luckily like this also this time!

The swith to proftpd on the server was a piece of a sweety cake:

debian-server:~# apt-get install proftpd


There you go now transfer works and the 421 Service not available, remote server timed out. Connection closed is solved in a radical and very easy manner!

Yet if you continue experiencing some kind of data transfer errors or ftp login errors I recommend you load the nf_conntrack_ftp if you're running linux kernel > 2.19, if you're using an older kernel version then you should load the ip_conntrack_ftp kernel module.
To make kernel loadable during system boot time do execute:
debian-server:~# echo nf_conntrack_ftp >> /etc/modules


To prevent FTP data transactions caused by iptables firewall rules I suggest you also check my article Iptables Open FTP Port 21 and 20 to enable your Linux firewall in and out FTP server data transfer to flow

Posted by hip0 | Permanent link

Mon Jun 14 11:19:45 EEST 2010

Iptables Open FTP Port 21 and 20 to enable your Linux firewall in and out FTP server data transfer to flow

I've recently build a firewall on a Linux server and I have encountered some issues with the FTP traffic motion whenever, an authenticated user to the FTP server tries to launch a data file transfer.
This issue is quite normal since, my Iptables firewall is restrictive and is of the type: deny everything by default except the allowed
It's pretty normal that this kind of restrictive firewall does create problems for transfers intiated to the FTP server configured, since it drops out traffic to a cetrain ports requested by the FTP client to be spawned on therefore get opened on the server.
The FTP protocol is historically famous for this kind of problems since quite a long, most of the people who had already some experience with FTP know that FTP clients and servers support two general types of FTP data transfers: Active and Passive .
It's less likely that an user has problems whilst transferring data in Passive FTP mode, however it's a common problem that Active FTP transfers gives problems with transfers.
For more information on the exact way an FTP transfer works and passive and active mode please read here .
In order to prevent problems with your FTP server Active transfer it's recommendable that a few iptables firewall rules as well as kernel modules are present amongst your firewall definitions.

So whenever you intend to include an FTP server with your newly configured server for the end customers be sure to have the following kernel modules loaded:

linux-server:~# modprobe ip_conntrack
linux-server:~# modprobe ip_conntrack_ftp


Next we have to add the proper iptables rules to properly manage incoming requests on port 21 to your firewall script file:

iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 1.2.3.4 --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s 1.2.3.4 --sport 21 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 1.2.3.4 --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp -s 1.2.3.4 --sport 1024:65535 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s 1.2.3.4 --sport 20 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 1.2.3.4 --dport 20 -m state --state ESTABLISHED -j ACCEPT


In the above firewall rules it's necessery to change the 1.2.3.4 ip address with your FTP server public accessible ipv4 address.
In preparing this article I used as a basis iptables open FTP port 21 article which is a nice reading and sheds some good light on how to fix the FTP transfer issues discussed above.
That should be enough now reload your firewall rules flushing off the old firewall rules and loading the new ones and hopefully all should be done, your FTP transfers should start flowing fine.

Posted by hip0 | Permanent link

Sat Jun 12 13:31:01 EEST 2010

Orhotox Christian notable Elders of our times (Elder Paisios & St. Nectarios)

If you're a Christian and you are not well familiar with Orthodox Christian. You most probably wonder what is eldership (elders) in orthodoxy.
That's okay and is quite normal. I remember the first time I heard about the so-called elders, it was completely incomprehensible term.
Laters when I was more and more getting to know orthodox christianity I started understanding the term, so I'll try to explain it to you in a few words.
Elders are an old monks or old holy man, who stife after a really holy and ascetic life. The Church Elders used to be present even in the ancient Church as they were the ones who does annoyinted the sick as it's written in the New Testament in The Holy Bible.
Later centuries elders used to be usually the spiritual guides of monasteries or other ascetic christian communities. Many elders used to be Hesychasts .
Many of the Elders has been blessed by God with many spiritual extraordinary gifts like clairvoyance, strong prayers that could work out miracles, peaceful spirit, phrophetic gifts etc.
In the middle centuries like the 16-nth to the 19-th century. Eldership and it's number started to decline. There was even a times in Russia Eldership almost ceased.
However in the Holy Mount Athos, elders tradition has continued until this very day.
Since we're living in a really mixed age, in which true christian spirituality has so largely declined, it's a real blessing that yet we have some elders that could almost be called contemporary.
One really important and very blessed elder who lived in the 20-th century is elder Paisios

While looking for some Orthodox Songs and Chants I found a really interesting video that presented some of Elder Paisios and St. Nectarios who is also one of the notable saints of our times.
There is an innumerous number of Elders that lived and tough the true way of salvation, anyways since I'm not educated enough to talk about them I'll just stop here and present you with a video showing some pictures and teachings of Elder Paisios and St. Nactarios.




Posted by hip0 | Permanent link

Fri Jun 11 17:28:33 EEST 2010

How to properly control your Lenovo Thinkpad R61 fan rotation cycles on Linux with ThinkFan

Since quite a long I'm issuing issues with my fan rotation controlling software on Linux.
That is really annoying since every now and then I experience problems with overheats when my system is under heavy loads.
That would interrupt my proper work with my notebook every now and then and had became a real pain in the ass with time.
I spend a lot time looking for a solution in the meantime trying all kind of scripts which mentioned on thi nkwiki.org
I've had an unpleasent experiences with tpfand , tp-fancontrol as well as with the automated process to control fan through some kern el module options like:

options thinkpad_acpi fan_control=1


To solve my overheating issues when the temperature shown by lm-sensors was reaching 60 degrees and above I had to manually change the fan rotation level with the command :

# increase thinkpad fan speed to max
root@noah:~# echo level 7 > /proc/acpi/ibm/fan


The manual way to increase fan rotation when my CPU was under a high load caused by the automated thinkpad_acpi kernel module wrongly controlling the fan speed was really irritating, therefore I looked for something online to manage the fan rotation to cool my cpu in a proper way, after the many failed attems to use some of the forementioned softwares as well as other techniques I found to be explained as a workarounds to tune the automated fan rotation speed.
I finally found Thinkfan . The wonderful guys from Debian has even prepared a packaged deb package of thinkfan, so as a debian user the whole thinkfan installation was as easy as:

root@noah:~# apt-get install thinkfan


Though thinkfan worked just fine most of the time and was able to control my fan speed automatically quite properly most of the time, it failed to do so every now and then.
Since failures to adjust properly the fan rotation speed on my Debian Linux when the system was under a stress was rare, I was quite happy with thinkfan as a fan manager for my desktop linux system most of the time.
The most often cases in which thinkfan failed to properly adjust my fan speed to cool my cpu properly was after system sleeps or hibernate
To work around this issue I have created a crontab which would periodically restart the thinkfan daemon, the crontab I used is as follows:

# restart thinkfan on every 30 minutes to prevent issues with thinkfan after hibernate and sleep on Debian Linux
0,30 * * * * /etc/init.d/thinkfan restart >/dev/null 2>&1


This kind of solution worked until recently when I have used apt-get to upgrade my system software to the latest versions, ever since then thinkfan misbehaving unabling to properly control my notebook lenovo thinkpad r61 fan speed.

The failure to control properly the fan speed was accompanied by the following thinkfan warning messages in /var/log/messages :

Jun 7 15:30:02 noah thinkfan: WARNING: Using default temperature inputs in /proc/acpi/ibm/thermal.
Jun 7 15:30:02 noah thinkfan: WARNING: You have not provided any correction values for any sensor, and your fan will only start at 55 °C. This can be dangerous for your hard drive.


I spend almost two hours Googling for the error and possible articles on how to configure my thinkfan /etc/thinkfan.conf to match my thinkpad r61 fan control but I couldn't find anything meaningful in Google.

Thus I started experimenting changing values in my /etc/thinkfan.conf until I reached a moment the fan is properly controlled by thinkfan.

I thought this values could be of a great benefit to other Thinkpad R61 Linux users I decided to blog about my issues and my solution to fan control issues.
So if you are also in the same struggles with properly configuring the fan speed for thinkfan to match Thinkpad model R61, you will have to download my thinkpad r61 Correction values thinkfan.conf file
Our you can either just copy paste the following in your /etc/thinkfan.conf configuration file on your system:

(0, 38, 40)
(1, 42, 44)
(2, 46, 48)
(3, 50, 52)
(4, 54, 56)
(5, 58, 60)
(6, 62, 64)
(7, 66, 32767)


For other Lenovo / IBM Thinkpad model types the correction values might be close or even it's possible that the same configuration to control your fan with thinkfan might be compatible with other Thinkpads.
If you test it on another thinkpad and you find it working or some tweakenings to the up-mentioned correction values help in tuning thinkfan on other Thinkpads, please post here!
Thanks God, now after simply restarting my thinkfan, my notebook fan is automatically properly set to rotate!

Posted by hip0 | Permanent link

Thu Jun 10 17:14:32 EEST 2010

Alert Notification script to warn you about low disk server space left on Linux / (Low Disk Space Notification via SMS and E-mail)

Once again I've encountered a problem with a non operational website on a CentOS Linux caused by a depleted disk space on the server.
The disk has been full with data to it's maximum capacity because the last website SQL and file data backup.
To prevent future unexpected server outages caused by a filled up disk I've decided to implement a quick script to warn me when there is a low disk space left on the server system. I was lazy to write a disk monitoring script from scratch so I used the one present on Send an Email Alert When Your Disk Space Gets Low nice article.
I've done minor modifications to the script present on the article shown above to make it report on an email the exact system hostname from where it originates (helpful if you intend to run the script on more than one linux servers).
The script is also accustomed to send an SMS message to your mobile phone warning about the possible emerging disk full issues.

If you want to use my monitor_disk_space.sh script after the minor modifiations done to it to report server host and send sms to your mobile check here

Actually it seems too many old backups were just hanging there so I installed a tiny script on a crontab to periodically clear up the old backups.
Here is the script itself:

You can download the clear_old_log_backups.sh script here

Both the monitor_disk_space.sh and clear_old_backups scripts should be prepared to run on a crontab.
In case if you intend to run the aforementioned two scripts you would have to prepare a crontab records similar to the following:

# clear old data backups
30 2 2,20 * * /usr/sbin/clear_old_log_backups.sh
# monitor and report if disk space is low
05,30,59 4 * * * /usr/sbin/monitor_disk_space.sh

That two works fine for me hopefully they would be of use to somebody out there. Feel free to contact me here if you experience some problems in setting up the scripts.

Posted by hip0 | Permanent link

Tue Jun 8 14:40:34 EEST 2010

Agni Parthene (Virgin Pure) a majestic and Truly notable Orthodox Christian song

St. Nectarius (Wonderworker) has composed in the 19th century a truly God inspired and majestic Orthodox Song. In my opinion it's one of the best composed Orthodox Songs ever.
The song is called Agni Parthene (Pure Virgin) and is a honoration song dedicated to the Theotokos (The Mother of God - Virgin Mary).
Enjoy this wonderful piece of pure and holy music!:



Posted by hip0 | Permanent link

Mon Jun 7 15:59:53 EEST 2010

How to enable Godaddy Total DNS for a recent transferred domain to Godaddy from another registrar / Solve Godaddy "Total DNS (Not Hosted Here)"

I've recently transferred a domain from servage.net to Godaddy. As usual when I had to deal with a tech supports they were lazy and unhelpful. I had to first request an authorization code for the transferred domain. Since some of the WHOIS domain information set for the transferred domain included the domains@servage.net email I have to contact servage for the authorization code. Servage's tech support first tried to convince me it is not possible to provide me such a code because I have to receive it on my mail specified in the administrative data for the transferred domain, ofcourse that was a light lie. And it was necessary to contact them once again and request to send me the auth info for the domain the day after I received the domain and was able to complete the domain transfer. Anyways since I wanted to switch from Servage's web DNS manager and use Godaddy's total DNS control it was necessery that I enable Godaddy's Total DNS which was disabled for some reason with a message Total DNS (Not Hosted Here)
Luckily the solution is really simple and the whole issue is well documented on here

In short to solve the issue all necessery I have to do was simply:

1. Under Nameservers, click the "Manage" link.

2 You will see that the "I host my domains with another provider" radio button is checked.
You will need to, instead, click on "I want to park my domain" and then click OK.

Now wait few minutes and then Total DNS Control will appear as a mean of domain management.
By the way it's maybe worthy to mention that Servage's web DNS doesn't support the "TXT" DNS records, neither they allow a custom created SPF TXT records this is really ridiculous for a large scale domain registrar and hosting company ..

Posted by hip0 | Permanent link

Sun Jun 6 19:07:02 EEST 2010

The Celebration of the day of All Bulgarian Church in the Bulgarian Orthodox Church


All Bulgarian Saints Icon

Today it's the Sunday in which we the Bulgarian Orthodox Christians celebrate The Day of All the Bulgarian Saints
We have plenty of saints in our Bulgarian Christian history, many known and even more unknown ones. That feast is actually one of the greatest local church commemoration of the Christian saints who gave their life for the building, growing and preventing of the orthodox bulgarian church and the orthodox christian faith througout Bulgaria's lands.
An almost complete list of the orthodox bulgarian saints can be seen here
However many are not mentioned since there are no historical documents about the countless victims (martyrs) of Ottoman muslics who were beheaded or violently killed because of his refusal to accept the Islam.
Here I will just mention few of the saints that are mostly venerated in the realm of the bulgarian orthodox christian faith:

1. st. Enravota (Prince Boyan)
is considered the first Bulgarian Saint martyr who gave his life to show hthe truthfulness of the Christian Orthodox faith.
His most notable speak is also a prophecy concerning the bulgarian orthodox church which was made before his martyrdom for Christ.
The prophecy saint Enravota has made about the Christianity establishment in Bulgaria is as follows:

This faith, which I now die for, will spread and increase across the whole Bulgarian land, although you may wish to oppress it with my death. In any case, the Sign of Christ will establish itself and churches of God will be built everywhere and pure priests will serve the pure God and will deliver "sacrifice of praise and confession" to the invigorating Trinity. Idols, and priests as well, and their ungodly temples, will crumble and will turn into nothing, as if they had not existed. Besides, you alone (to Malamir), after many years, will cast away your ungodly soul without receiving anything in reward for your cruelty.

2. St. Jonh of Rila (wonderworker) was a hermit in the Rila mountain who is a patron saint of the Bulgarian Orthodox Church. He is notable for his great spiritual purity achievement in his anchoretic life. Many miracles and healing has been received by people who has prayed and asked the saint to intercede in their behalf to God. He is known as the first bulgarian monk, and as an initiator of the first bulgarian orthodox christian monastery.
His uncorruptable body is found for pilgrimage until this very day in the monastery he became a founder of Rila Monastery .

2. St. Brothers Cyril and Methodius Who were the saint brothers who venerated for enlightening the slavonic nations with writting letters. They're actually the inventors of the old Bulgarian also known as Old Church Slavonic. They and their followers were the first to translate the holy bible into the newly created language - the Old Bulgarian.

3. st. Knyaz (King) Boris-Mihail (Boris-Michael) . He is known for his baptism of the Bulgarian Nation and the initiator of the creation of the Bulgarian Orthodox Church as well as a brilliant statesman.
After baptising most of the bulgarian intelligentia and rooting up the Orthodox Christian faith in Bulgaria, he abdicted voluntery from his throne, leaving his son (Vladimir) to rule Bulgaria and started a voluntery monastic life in poverty.
When his governing son tried to reinforce back the old pagan bulgarian Tengriism belief (e.g. the belief in Tangra (Tengri) he left the monastery took back the power (defeating his son) and blinded Vladimir.
Then he returned back to the monastery and spend his remaining life as a monk.

4. st. Clement of Ohrid was one of the Seven Bulgarian Apostles
Born in 840, a Slav from southern Macedonia, he established a monastery at Okhrida and a bishopric at Velica not far away. He is regarded as the founder of this primatial see and the first Slav to become a bishop.
His extensive apostolate took the form of education of the clergy and of the laity, to whom he preached a series of sermons in Slavonic, suitable for neophytes and explaining the principal feasts of the liturgical year. Clement died at Okhrida on 27 July 916.
5. St. Nahum ucceeded St. Clement of Ohrid as bishop. Converted in Moravia by Cyril and Methodius, he journeyed with them to Rome and helped them with their translations into the vernacular: he is venerated in Russia as well as Bulgaria. Other companions of Clement called Sava and Angelar are also venerated with him. In different times and different places they all contributed to the fulfilment of the missionary plans of Cyril and Methodius.
6. Saint Zlata of Meglen has endured a martyrdom for Christ. She refused to accept muslim faith and has firmly confessed her Orhtodox Christian faith.
She was given many chances to accept muslim faith by some Turks and therefore save her life but she refused and was cast into a prison for 3 months flogging until her blood soacked the ground.
Finally, they suspended her upside down and lit a fire, to suffocate her with the smoke; but God was with Zlata, and gave her strength in suffering.
At last they hanged her from a tree and cut her into small pieces. Thus, this brave virgin gave her soul up to God, and went to dwell in Paradise on October 13, 1796. Pieces of her relics were taken by Christians to their homes for a blessing.

7. 26 Martyrs of the Zographou Monastery on Mt. Athos at the hands of the Crusaders they have endured martyrdom for Christ, from the Roman Catholic Crusaders. Though the were warned that the enemies of Christ are coming to the Zograph Monastery they refused to leave the place and was burned alive by the unpious Crusaders.
There is many others to be mentioned but I neither have the knowledge nor I'm worthy to speak about them.
All Bulgarian Saints new icon representation

Let by their Holy Prayers God have mercy on us the sinners.

Posted by hip0 | Permanent link

Sat Jun 5 16:04:07 EEST 2010

Substitute for the Gnome bluetooth / Or how to properly manage your bluetooth (obex) connections in Gnome

I connect my Nokia 9300i mobile phone over bluetooth every now and then. In that connection, every often I do experience problems with properly connecting the device to my notebook running Debian Squeeze/Sid Unstable on it's Desktop.
Until recently it really annoyed me that I had to loose time restring the Linux system sometimes when an access to the mobile device was failing, without any good trackable error message.
The connection error I have experienced quite often when I was trying to browse my Nokia 9300i cellphone using the bluetooth protocol on Linux was:
"the name org.openobex.client was not provided"
You can read about a similar error to the one encountered by me when using bluetooth on my Debian Linux in debian bugs mailing list on osdir
The way I solved the issues with connecting over bluetooth on Linux until recently was by rebooting the whole Linux system (dumb)!.
Some other things I try to get arround the bluetooth connection errors was by trying to re-enable my bluetooth notebook embedded device on my Lenovo Thinkpad with command:

root@noah:~# echo disable > /proc/acpi/ibm/bluetooth
root@noah:~# echo enable > /proc/acpi/ibm/bluetooth

I alsy tried to physically remove the bluetooth module, rfcomm and a few other modules which were preventing the removal with rmmod of the bluetooth module.
However this solution did't help either .. To solve the issues I tried few other stuff one of which was installing libobexftp0 and obexftp since my Nokia 9300i uses the obex protocol to communicate with the computer through bluetooth

I have to note that so far I have used the embedded general gnome application
Gnome Bluetooth by using the bluetooth-applet .

Well all my worries came to end finally by simply using another piece of bluetooth communication software callde blueman
Since I have installed that handy software bluetooth is working perfectly fine everytime with my mobile. I warmly recommend to everybody out there to switch to the blueman which is a substitute for the old crappy gnome-bluetooth pack
check out the up-mentioned provided website.
It's probably also worthy to say that the blueman app is written in python.
Well I'm pretty happy now whilst using blueman, hopefully you'll enjoy it too as well as solve your bluetooth issues ! :)

Posted by hip0 | Permanent link

Fri Jun 4 12:36:32 EEST 2010

check your food content additives on your Mobile Phone with e-additives (Etata)

E-Additives J2ME application check your food contamination

In the present age it's really modern for companies to cut costs and increase a food product durabity and endurance using addition of specially crafted chemical compontents.
Most of which are starting with E and followed by a number for example E328 .
Though this is generally profitable for companies and is prolonging the food durability it's making the food less nourishing and more harmful or even sometimes toxic for us humans.
A good friend of mine Necroleak or as earlier known Pro-XeX has created a nice J2ME application for mobiles that has a database of most groups of E food chemical additives and is able to tell you if a certain E type like E329 for instance is belonging to which chemical additive group.
This is quite handy especially when you go for grocery to the city market and you have to buy a can of milk or some type of canned food.
In the european Union as well as in America, New Zealand, Australia and Israel the E number of the additives are encountered on every non-biological food label.
Hence it's really helpful when you launch the E-additives application while you're selecting your food and check the food additives E E labelling and therefore know what type of chemical you might swallow while eating the purchased food.
This type of behaviour is really smart and could have a positive impact on your physical health in a long term and help you select a food which is less chemical contaminated. More about the ETATA / E-Additives can be read on it's official page
Some of the benefits of E-Additives as an application that it is really multi-platform oriented and is supposed to run on most mobile phones which include the J2ME Java Virtual machine
I decided to try the e-additives mobile software on my Nokia 9300i and I have to share the program installed and runs on the mobile quite nice, though the J2ME included with Nokia 9300i is currently quite outdated.

Here are some pictures of e-additives running my Nokia 9300i mobile:

E-additives logo screen Nokia 9300i
E-additives logo screen Nokia 9300i
The only downside of th e-additives on my nokia is that some pictures shown on the e-additives website are not appearing on my phone.
However since I can search in E-additives - E database the application is performing it's original intention through enabling me to check how actually contaminated with chemical additives (preservative food additions) are my daily meals.

Posted by hip0 | Permanent link

Thu Jun 3 14:45:28 EEST 2010

History of Christianity - Which is the True Holy Apostolic Church?

I have many friends who are protestant evangelical Christians. I really feel sorry about them since, I myself had a period of confusion of which and where is the true Christian Church in the present age.
It took me few years and by God's mercy I came home in the mother Church the (Orthodox Church).
I truly hope that videos on this post would help to somebody out there looking for the true Church of Christ, to find Orthodoxy and return to the Holy Apostolic Faith.
Here are a few videos that will give you some insight on Church History, what is the Orthodox Church, Where is it, Who created it and why it's currently the only Church that teaches people on true Christianity.


History of Christianity: 1


History of Christianity 2


History of Christianity 3


What is the Orthodox Church? (Short Overview)


The Orthodox Church - A visual journey

Anyways there is much much more to be seen said and red on the subject. But my intention was just to give a general direction.

Posted by hip0 | Permanent link

Wed Jun 2 17:30:07 EEST 2010

What is the Old Cyrillic / Church Slavonic / Old Bulgarian - large fonts pack to enable writting in Old Cyrillic

Since some time. I've been interested into Bulgarian history as our history is mostly related to the Slavnic Church history. The Old Bulgarian letters (Old Slavonic) as Russians prefer to call it nowadays is a real interesting and unique type of letter system that our ancient ancestors used.
This typing letter and it's books is still in use in Bulgarian, Serbia, Russia, Macedonia mostly in
the Monasteries or on places that has to do with old Slavonic history.
The Old Church Slavonic (Glagolhic Alphabet) as it's also called by historians is actually a dead language in a sense that it's no longer used for everyday communication among anyone.
However it's Church significance is enormous, every Slavonic monastery's in morning and evening services as well as in the Divine Liturgy has a extensive readings from the old liturgical books which are written in Church Slavonic.
The Church Slavonic (Old Cyrillic language) is considered a God inspired language. The language was created by the Saint brothers Cyril and Methodius
This days this two saints are as a patron saints of most of the Slavonic nationalities in the world, they're also highly venerated in Bulgaria, Serbia, Macedonia, Russia, Ukraine etc. as enlighteners of the slavonic nations.
What is really interesting about Church Slavonic is that it's maybe the only language in the world that doesn't have any profane word in it. This is truly absolutely unique about the Old Cyrillic language.

Here you can see how the original Glagholic alphabet looks like:

Old Church Slavonic alphabet, Glagolhic alphabet, Old bulgarian alphabet, old cyrillic alphabet

At the present days the old cyrllic is of interest mostly to religious Eastern Orthodox Christian people with a known slavonic lineageor to history researchers and anthropologists.

When I was in Pomorie's Monastery I tried reading from the liturgical books but I was having serious difficulties, making mistakes while reading on almost every word. So I have to tell you Old Bulgarian is not easy to be red or pronounce.
Some Christian Orthodox believers say that praying in Church Slavonic language has a higher prayer power since it is a language which was not touched by modern human profanity. This people claim that reading religious texts or the Holy Bible in Church Slavonic grants a person more grace than usually received by reading the Holy Scriptures, the Saint Livings or the Liturgical texts in modern languages like for instance modern bulgarian.
Many time among the clergy in the Bulgarian Orthodox Church Holy Synod disputes has emerged concerning the topic of language reformation in the Bulgarian Orthodox Church.
The risen dispute which is still pendant questions should the Bulgarian Orthodox Church keep part of it's reading of the old slavonic book texts in the Churches or monasteries or the Old Church Slavonic should be completely abandoned and the Divine Liturgy service and the holy book readings in the church be in modern Bulgarian language.
My personal opinion is that part of the Church Slavonic readings should be kept as they're are the present moment in the Church, since they have a direct relation to our history and traditions as a Bulgarian nation.
If the topic has already become interesting to you I advice you read a bit further About Old Church Slavonic here

Some of the prepared electronic documents like pdf or doc with a sacred old bulgarian texts are still in Church slavonic, some doesn't have a complete translation in modern bulgarian. So every now and then I believe Orthodox Priests, clergy men layman as well as history researches need to open documents written in Church slavonic on their Personal Computers.
Since normally most of the operating systems like MS Windows and Linux, Mac OS X etc. doesn't support Church Slavonic it's really important that the necessery fonts are installed the respective computer architecture OS.
In my attempt to simplify the installation of the necessery FONT files for opening Church Slavonic (Old Cyrillic) documents I've looked online and downloaded a number of freeware .TTF as well as other fonts that allows visualization of Church Slavonic letters on your PC.
The old cyrillic fonts for your PC can be obtained font by font from here .
An archive of the Complete Large Old Cyrillic / Church Slavonic fonts can be obtained from here
To compile the above old cyrillic fonts pack I have used mostly the following online source:

irmologion.ru - here you can download many old slavonic fonts .
U+fonts Cyrillic OCS on (WAZU JAPAN's Gallery of Unicode Fonts) .
David Zbiral's free Old Cyrillic font for Windows and Mac Cyrillic page

You can find a complete list of the old church slavonic cyrillic fonts included with the up-mentioned pack here

I hope this fonts pack would be helpful to somebody out there. Any feedback suggestions for future improve of the pack are very welcome.

Posted by hip0 | Permanent link

Tue Jun 1 14:09:02 EEST 2010

Tracking PHP Scripts execution time with (apd and xdebug) to tackle bottlenecks in website performance

Yesterday while reading a book on PHP 5 I found a chapter which was talking about scripts performance.
The book included quite a lot information on tracking performance, however what was personally interesting for me was two of the suggested ways to track performance through APD (Advanced PHP Debugger) or alternatively using the xdebug .
Herein I include little information about apd:

APD is a full-featured PHP profiler/debugger that is loaded as a zend_extension. It aims to be an analog of C's gprof or Perl's Devel::DProf.
More information on how to install configure and use the advanced php debugger can be found here

Anyways for the impatient and lazy to read the apd docs, here is a few steps that would install and enable APD on your Linux or BSD powered system.

1. Install the apd using pecl (php extension community library)
debian:~# pecl install apd
you should see some debug here ....
Build process completed successfully
Installing '/usr/lib/php5/20060613/apd.so'


2. Edit your php.ini to include the newly installed apd.so library:
- In debian the php.ini would be located in /etc/php5/apache2/php.ini, so you will need to edit /etc/php5/apache2/php.ini , add in it:

zend_extension = "/usr/lib/php5/20060613/apd.so"
apd.dumpdir="/var/tmp/apd"


Afterwards execute the following commands:

debian:~# mkdir /var/tmp/apd
debian:~# chmod 1777 /var/tmp/apd
debian:~# /usr/sbin/apache2ctl restart


To enable a profile of the time required for a certain php script to execute, you will have to:

- include apd_set_pprof_trace(); in the beginning of the questionable script.

If you would like to enable the apd system wide you will have to put the apd_set_pprof_trace(); function into a new file and include in your php.ini the auto_prepend_file directive pointing to the newly created file containing the apd_set_pprof_trace()

To see some statistics concerning apd execution times execute the command:

debian:~# pprofp -O 9 -u /var/tmp/apd/pprof.25515


The above command is about to show you which php fucntions has consumed the maximum amount of server CPU time, so havind that in mind laters you can substitute the cpu heavy php functions with a less cpu intensive ones.
Note that the pprof.25515 is an example file you should check in your /var/tmp/apd/ to find out the pprof name that apd has created.

APD has plenty of other good function trace and general php time debug functions so for more check the manuals.

An alternative way to track your php functions cpu usage and execution times is using xdebug . Xdebug is available for both Linux and Windows OS platforms.
On Debian Linux xdebug is even available as a php 5 module in deb package.
The install of xdebug on Debian is directly through apt-get package manager:

debian:~# apt-get install php5-xdebug


If you're not on Debian you can use the pecl system to install xdebug:
Issue:

shell:# pecl install xdebug

Next to the pecl install you will find some futher instructions on how to enable the newly installed xdebug module with the zend_extension variable

Note: You should ignore any prompts to add "extension=xdebug.so" to php.ini - this will cause problems.

Complete xdebug installation instructions are available on xdebug's are here

To enable php scripts profiling with xdebug you will need to add in your php.ini:

xdebug.profiler_enable = 1
xdebug.profiler_output_dir=/var/log/php-profiler


Make sure your xdebug.profiler_output_dir is an existing directory, if you want to use the one shown in the example above, create the dir with command:

shell:# mkdir /var/log/php-profiler
shell:# chown www-data:www-data /var/log/php-profiler


Here I use the www-data user and group which are the user and group used on Debian Linux, if your apache user is different change it to the appropriate user.

Here I want get into details on more about xdebug php code profiling check here

Xdebug profile dumps can even be nicely analysed and visualized in X with Kcachegrind .

Probably there is much, much more left unsaid on the topic of php execution code profiling however I'll stop here and leave the topic article for discussion and suggestions by my dear readers :)

Posted by hip0 | Permanent link