nav HOME » Archive by category 'Programming'

Starting new project with yiiframework

This is the procedure I use for creating new projects with yiiframework: Download latest code from http://www.yiiframework.com cd ~/tmp wget http://yii.googlecode.com/files/yii-1.1.5.r2654.tar.gz tar xzvf yii-1.1.5.r2654.tar.gz Create a new directory for the project: mkdir ~/workspace/www/myproject cp -R ~/tmp/yii-1.1.5.r2654/framework/ ~/workspace/www/myproject Create an initial application skeleton: cd ~/workspace/www/myproject framework/yiic webapp public Move application directory outside from webroot (for security [...]

Posted in Programming
Tags: ,

Vertical centering with CSS

One of the biggest weaknesses of CSS is lack of support for vertical centering. There are many tricks to achieve this and each of them has advantages and disadvantages. The method I use is based on method from jakpsatweb’s web site and this webmasterworld’s forum post, with slight modifications. It works fine in all popular [...]

Posted in Programming
Tags: ,

Protecting PHP scripts from Cross-site scripting (XSS) attacks

Cross-site scripting (XSS) attacks are one of the biggest threats to dynamic web pages. Up to 80 percent of all web sites are vulnerable to some type of this attack. Yet, many programmers and site owners are simply not aware of this problem. So, how it works? Generally, you have some web site which doesn’t [...]

Posted in Programming
Tags: , ,

HOWTO: Remote Java JMX monitoring

Java JMX provides an easy way to monitor your java application. Here are the steps to enable simple, non-ssl monitoring solution with authentication: Use the following switches to start your java application: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/full_path_to/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/full_path_to/jmxremote.access (port 9001 is just an example here, you can use any port) Create /full_path_to/jmxremote.password file with content [...]

Posted in Programming
Tags: ,