December 19th, 2012 | Tags: , ,

With current version of rp-pppoe 3.11 and kernel version 3.5.x can’t compile kernel module of PPPoE.

./configure --enable-plugin
checking for Linux 2.4.X kernel-mode PPPoE support... no
On this platform, the following targets will be built:
pppoe pppoe-server pppoe-sniff pppoe-relay

Find in source “linux/in.h” and replace with “netinet/in.h”

cd rp-pppoe-3.11/src/
grep -R "linux/in.h" *
configure:#include <linux/in.h><linux/in.h> <linux/in.h>

After that:

./configure --enable-plugin
checking for Linux 2.4.X kernel-mode PPPoE support... yes
On this platform, the following targets will be built:
pppoe pppoe-server pppoe-sniff pppoe-relay
November 12th, 2012 | Tags: ,

What we have is a table table with checkboxes, and need to:
- check/uncheck all checkboxes
- select checkbox clicking on table row and changing background ot row

$(document).ready(function() {
    // if user clicks on checkbox with id="checkall" - all checkboxes are selected
    // and table row background is highlighted
        if ($(this).is(':checked') == true) {
        } else  {
    // if user clicks on checkbox, diffrent than checkbox with id="checkall" , 
    // then checkbox is checked/unchecked
    $('input:checkbox:not(#checkall)').on('click',function(event) {
        if($("#checkall").is(':checked') == true && this.checked == false) {
        if(this.checked == true) {
            // function to check/uncheck checkbox with id="checkbox"
        if(this.checked == false)  {
    // if user clicks, someware on table row, checkbox is checked/unchecked
    // and table row background is highlighted or not
    $('#tblDisplay tbody tr').on('click',function(event) {
        var this_row = $(this);
        var checkbox = this_row.find('');
        if ( !== 'checkbox') {    
            if (':checked') == false ) {
                checkbox.prop('checked', true);
            } else {
                checkbox.prop('checked', false);
    // if checkbox is checked on page load, highlight table background
    $('#tblDisplay tbody tr').filter(':has(:checkbox:checked)').css("background-color","#FC9A01").end();    

function CheckSelectAll() {
    var flag = true;
    $('input:checkbox:not(#checkall)').each(function() {
        if(this.checked == false)
        flag = false;

Require jquery 1.7.x
Working demo:

October 29th, 2012 | Tags: , ,

ZyXEL CPU Temperature: .
ZyXEL MAC Temperature: .
ZyXEL PHY Temperature: .


Zyzel ES-3124F MIB Download

Zyzel ES-3124F CACTI Host Template

May 10th, 2012 | Tags: , , ,

From Google Webmaster Tools:

lang=>HTTP/1.1 404 Not Found
Date: Thu, 10 May 2012 06:43:57 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.10
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 5626
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="bg-bg" lang="bg-bg">
<title>Страница грешка - 404, 404 Error page</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 

The PHP code

       header('HTTP/1.1 404 Not Found');        
May 10th, 2012 | Tags: , , ,

To achieve permanent URL redirect 301 as shown from Google Webmaster Tools:

Old URL is ….. ,  new URL is SEO friendly

This is how Googlebot fetched the page.
Date: Thursday, May 10, 2012 12:10:50 AM PDT
Googlebot Type: Web
Download Time (in milliseconds): 343
HTTP/1.1 301 Moved Permanently
Date: Thu, 10 May 2012 07:07:52 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.10
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 20
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

PHP Code:

    header('HTTP/1.1 301 Moved Permanently');
    $location = "";
    header("Location: $location",true,301);
October 13th, 2011 | Tags: ,

XCache is a fast, stable  PHP opcode cacher that has been tested and is now running on production servers under high load. Install php5-xcache:

apt-get install php5-xcache

Configuration file is /etc/php5/conf.d/xcache.ini . Some of major config options:

extension=/usr/lib/php5/20090626/ - load xcache
xcache.admin.enable_auth = On - enable auth of admin page
xcache.admin.user = "UserName" - username
xcache.admin.pass = "ca34ew" - password, must be md5(password)
xcache.size = 256M - memory used for xcache
xcache.coverager = On - to enamble coverage
xcache.coveragedump_directory = /tmp

To enable xcache admin page, create file /etc/apache2/conf.d/xcache.conf

Read more…

September 21st, 2011 | Tags: , ,

Refreshing iframe using jQuery.

    var auto_refresh = setInterval(function(event)
     {$('#load_events').load('events.php');}, 2000);  


<div id="load_events"> </div>


September 21st, 2011 | Tags: , ,

Apache config: (you need to set AllowOverride all)

<Directory /var/www/>
                Options FollowSymLinks MultiViews
                AllowOverride all
                Order allow,deny
                Allow from all

Create .htaccess file in document root ( /var/www/.htaccess ) and set

AddHandler application/x-httpd-php js
August 3rd, 2011 | Tags:

If you are using to view the speed your site, some of most common suggestions for improvement is Leverage browser caching

To set up caching you need to edit apache configuration (This code uses the FilesMatch directive and the Header directive to add Cache-Control Headers to certain files):

                <IfModule mod_expires.c>
                        ExpiresActive On
                        <FilesMatch "\.(js|jpg|jpeg|png|gif|swf|css|js)$">
                                ExpiresDefault "access plus 7 days"
June 8th, 2011 | Tags: , , , , ,

Ubuntu 10.04 configuration:

Install ifenslave — Attach and detach slave network devices to a bonding device.

apt-get install  ifenslave

Ubuntu 10.04 introduce a new way of configuring bond interface ( you don’t need to use /etc/modprobe.d/aliases.conf ).
Open and edit /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

auto bond0
iface bond0 inet static
        bond-slaves eth0 eth1
        bond_mode 802.3ad
        bond_miimon 100
        bond_xmit_hash_policy 1
        bond_lacp_rate 1

bond-mode 802.3ad - use 802.3ad protocol. You can read supported modes in kernel’s documentation bonding.txt
bond_xmit_hash_policy 1 – default value is 0

  • 0 (layer 2) - Uses XOR of hardware MAC addresses to generate the hash.
  • 1 (layer3+4) - This policy uses upper layer protocol information, when available, to generate the hash. This allows for traffic to a particular network peer to span multiple slaves, although a single connection will not span multiple slaves.

bond_lacp_rate 1 - default 0