Automated web page loading speed testing using Python and Selenium

in Programming

Recently search engines start to pay more and more attention to behavioral factors. While searching additional information on this topic in western websites I have found article posted in 2010 declaring that decreasing website load speed by 1-2 seconds dramatically decreased search enggine rangkings. I have no clue how to check if this information is relevant or not but I suppose that there is some truth in it since Google officially declaring that site speed will be one for the factors in search results ranking.

Average salary for web applications developer in Thailand

in Thailand

This week I searched information about average salary for PHP web developer in some major city in Thailand. There was just a few job offers available in public with exact wage. Most of the companies were looking for a Thai person who able to speak English, with average skills in PHP, MySQL and JavaScript. Salary was about 30-40k baht. I visited websites of this companies, most of them seems to be some farang companies that made simple websites. By simple websites I mean that they make website with total quantity of pages about 10-50, custom graphic design and maybe some little custom features such as contact form or payment page for some services. I noticed a difference between western and Russian web development companies. In small Russian company you can find average prices for a website. For example you need small basic website for your company with contact information, some information about your products. It will cost about 20-40k Rubles (1 RUB = 1.07642 THB). Companies established by US/UK citizens, Australians don't post any info about price, they just add contact form or something like that where customers describe what they need, then company gives them a quote.

How to show current category for node and rewrite taxonomy path with Pathauto in Drupal

in Programming

For a long period of time in each my blog post, below the post title there was date, who posted information, and there should be categories. But this string look like this: "Posted on 09. Jun, 2011 by boris in". Then there was an empty string after 'in'. In a 'blogbuzz' template there was this piece of code:


<?php if ($terms): ?>
<span class="terms"><?php print t(' in '$node_terms?></span>
?>

Nginx configuration file for Jira

in Administration

Maybe this nginx config template for Jira will save some time for someone.

server {
    listen   80; 
    server_name  jira.domain.com;

    access_log /var/log/nginx/jira-domain-com--access.log;
    error_log   /var/log/nginx/jira-domain-com--error.log;
    location / { 
        proxy_pass http://localhost:8080;
        proxy_set_header    Host            $host;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-for $remote_addr;
        port_in_redirect off;
        proxy_redirect   http://jira.domain.com:8080/    /;  
        proxy_connect_timeout 300;
    }   

    # redirect server error pages to the static page /50x.html
    #   
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /var/www/nginx-default;
    }   

}

Automated awstats config creation

in Administration

When amount of your websites become more and more, you will finally become tired to create new awstats config file for each new website. If you don't know what is awstats, it is a log analysis tool which helps you to know, how often your website visited by search engine bots. Google Analytics can not provide such information for you.
I have all my websites located at /home/#username#/webapps/#somefolder#, where #somefolder# is specified by myself. For example this blog is located at /home/#username#/webapps/mindinmotion/, logs for this blog are located at /home/#username#/logs/apache/access_mindinmotion.log*
So after I have created one more new website I decided to create a script which will create new config for awstats for my websites.

How to fix Django FastCGI Internal Server Error (500)

in Programming

You can mention this error in log files as follows:

[Fri Sep 28 00:43:49 2007] [error] [client 85.141.235.249] FastCGI: comm with (dynamic) server "/storage/home/username/domain.ru/dispatch.fcgi" aborted: (first read) idle timeout (30 sec)
[Fri Sep 28 00:43:49 2007] [error] [client 85.141.235.249] FastCGI: incomplete headers (0 bytes) received from server "/storage/home/username/domain.ru/dispatch.fcgi"

One of the reason of such error is incorrect path to Python. You can find a correct path to Python using command 'whereis':

$ whereis python
python: /usr/local/bin/python /usr/local/man/man1/python.1.gz /usr/ports/lang/python

Then you should check contents of the file ~/domain.ru/dispath.fcgi, the first string should look like this #!/usr/local/bin/python