2012 September

Installing Ruby and Rails on Windows

# First step, download ruby from http://rubyinstaller.org/. Once downloaded click the installer to install Ruby into your desired folder (C:\Ruby). Make sure to add Ruby to your path.

# Once installed, check the version of Ruby installed by typing in
Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

How to check Python version number in Linux/Unix environment?

To check the Python version number in Linux, simply type


$ python -V

You will get an output

Python 2.4.3
Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Apache: How to deny access to a folder or file?

Add the following list of lines into .htaccess file or to vhost configuration file appropriate to the folder within the website

<Directory /securedata>
Order Deny,Allow
Deny from all
</Directory>

Same will be the case for denying files within directories

<Files ~ “\.ini$”>
Order allow,deny
Deny from all
</Files>

The above lines of code will be helpful for us to prevent .svn files, .ini files, .htaccess files, include files from display within Apache

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

SQL Injection: Whitelist validation vs. blacklist validation

Whitelist validation refers to data validation techniques such as checking the data type, data length, input range, nature of data by its format (for e.g. phone number will be ten digits separated by hyphens satisfying the format nnn-nnn-nnnn). Regular expressions may be used for format validation in inputs.

Blacklist validation refers to rejecting data based on a know bad list filter. This is not a powerful solution as the list of possible exclusions will be many and it is difficult to implement all possible scenarios. Blacklist validation should be used in conjunction with whitelist validation but in cases where whitelist validation cannot be applied at least blacklist validation should be implemented.

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

SQL Injection: Database Code Security in Programming

Dynamic SQL (concatenated sql string) is a coding practice where by the queries are built in the program and sent to SQL Server for execution. This can allow the code to be injected into the dynamic queries causing a damage to the database.

A good alternative is to use parameterised queries where placeholders are set for the variables. The possibility of queries getting infected with injected code is completely removed with parameterized queries.

In addition to parameterized queries, it is alway a best practice to sanitize the input parameters before using them in queries.

Also the data input should be encoded appropriately especially in case of dynamic sql usage and to apply appropriate encoding when extracted from the database to avoid cross-site script execution.

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

How to integrate Zend Framework with WordPress blog or Joomla website?

Follow the simple steps given below to integrate Zend framework with other applications like WordPress, Joomla and other such open source or custom web applications.

i) Setup your Zend framework application as usual.

ii) Set the document root of the Zend application to the public folder within Zend install

iii) Now setup a folder for your wordpress or joomla or custom application. Let us assume that we want to create a custom blog application. Create a folder “blog” within “public” folder. Inside blog folder, create two files – .htaccess and index.php. Code for the two files are given below
Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn