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: ,

Xmarks replacement

I’ve used Xmarks for bookmarks synchronization between multiple computers, but sadly, they are shutting down their service. Since I use Firefox as my main browser, I decided to switch to Firefox Sync, which in addition to bookmarks, allows synchronization of preferences, passwords, history and tabs. It will be integrated into Firefox 4, for versions 3.5 [...]

Posted in Web
Tags: , ,

How-to: AWstats installation and configuration on Debian

This is a simple tutorial on how to install AWstats on Debian and configure it for displaying web statistics. I’ve tried this on lenny, but it should also work on other versions with small or no modifications. First, make sure your web server is configured to write access logs to combined format. This is default [...]

Posted in System administration
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: ,

Reducing reserved blocks percentage to free disk space

ext2, ext3 and ext4 filesystems by default reserves 5% of filesystem blocks for use by privileged processes. On modern drives with a lot of space, that can result in much lost space. Fortunately, that behavior can be easily changed with command tune2fs. For example, partition /dev/sdb5 have 384MB and default reserved blocks: nevermind1:/# df -h [...]

Posted in Linux
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: , ,

MySQL backup and point in time recovery with binary logs

Backing up MySQL data is very important if you run MySQL on any kind of production server. We’ll explore some basic concepts which allows you to do that. We’re interested in two types of backup: full and incremental. Full backup can be saved as a collection of queries which can restore a database (logical), or [...]

Posted in System administration
Tags: , ,

apt-get fopen permission denied

Today I got some interesting errors when running “apt-get install” command on one debian lenny server. srv1:~# apt-get install host Reading package lists… Done Building dependency tree Reading state information… Done The following NEW packages will be installed: host 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 70.0kB [...]

Posted in Linux
Tags: , ,

How-To: Nagios 3 installation on Debian

Nagios is a great monitoring software. This is how I get it working on debian lenny…

Posted in Linux
Tags: , , , ,

Moving wordpress to subdir

I had wordpress installed in root directory of domain, but that’s not a very good idea in case you want to have multiple applications on the same domain. Just moving wodpress to subdir is very easy, but what’s with old links, that are already indexed by search engines? we need to set-up permanent redirects (http [...]

Posted in Web
Tags: