SVN: Creating a Repository and Migration

Technologies: 

Creating a Repository
There are loads of documentation in creating a Repository. Provided below is an example VHOST config file for SVN:

<VirtualHost *:80>
ServerName svn.example.com
DocumentRoot /home/svn/
<Location /svn/example>
  DAV svn
  SVNPath /home/svn/reponame
#  SVNParentPath /var/svn/
  AuthType Basic
  AuthName "Example Repository"
  AuthUserFile /etc/subversion/passwd
  Require valid-user
</Location>
ErrorLog /home/svn/logs/error.log
CustomLog /home/svn/logs/access.log combined
</VirtualHost>

Handling Unwanted Stuff

Technologies: 

This is not a post for handling SPAM.

Please find the following Softwares you would need to install.
1. ModSecurity supplies an array of request filtering and other security features to the Apache HTTP Server, IIS and NGINX. ModSecurity is a web application layer firewall.
2. Mod_evasive prevents against ddos and scripted bots which can hammer a website. Mod_evasive is the Web Denial of Service module used in ASL. It is designed to throttle http and https connections when they reach above a specified threshold.

Disabling Munin and Awstats

Munin is a server and network monitoring tool. AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages.

Sometimes both can result in High Server i/o due to its periodic cron tasks. Uninstalling via command line wont help as you may see cron based tasks for Munin and Awstats running in logs.

User Profiles On Registrations - Per Role

Technologies: 

Dear Dhongis,

We have almost all sites where we have multiple roles and we need a different profile for each role. This was so far rocket science since we did not have a mechanism to create different looking registration forms per user role. We handled this situation post login when we asked people to create profiles as per their roles.

Also, we have an issue of assigning roles when logically a person should be able to choose their role and admins should simple approve or disapprove of it.

Walking by the PC
One September Afternoon
I found the solution
But not very soon

How to send email from loclahost Drupal hosted in Ubuntu?

Technologies: 

Consider a situation in which you have installed Drupal in your Ubuntu machine. Now you would like to start sending email from localhost.If you have not setup Mail Transfer Agent(MTA) than you will not be able to send email from localhost.

What is Mail Transfer Agent(MTA)?

Wikipedia Says:

Utility Methods

Technologies: 

function_exists: function_exists — Return TRUE if the given function has been defined

Syntax:

bool function_exists ( string $function_name )

Example:

<?php
if (function_exists('payroll_getcomponents')) {
    echo(
"payroll_getcomponents functions is available");
}else{
    echo(
"payroll_getcomponents functions is NOT available");
}
?>

profile2_load_by_user: Loads the profile data of a user. Takes user id as input

Syntax:

profile2_load_by_user($account, $type_name = NULL)

Example:
<?php

How to Set Filters for a View in Drupal 7 programmatically

Technologies: 

Accessing a view programmatically

<?php
$view = views_get_view('view_name');
$view->init();
$view->set_display('default'); // or display id like page_1, block_1
$view->set_arguments(array($ARGS));
//display_name = 'default' or 'page' and so on
//filter_name is the name of the filter
//debug($view->display['display_name']->handler->options['filters']['filter_name']);
$view->display['default']->handler->options['filters']['date_filter']['value']['min']='2012-05-01';
$view->display['default']->handler->options['filters']['date_filter']['value']['max']='2012-06-30';

Google Drive for Project Management

This post highlights the important features Google has brought into it's Drive tool (formerly Google Docs and Spreadsheets) which has made online collaboration easier than before and enabled the use of Spreadsheets as a serious project management tool.

Without going into obvious features, what I would like to highlight is the fact that Google Drive not supports Pivoted spreadsheets. This means that while you maintain your raw data, you can also auto generate elegant status reports with all the power of pivots. An example report for one of my active project is here:

Inspecting Objects: Simple Trick

Technologies: 

How often have you felt the need to display a PHP Object in a readable manner? We are all very familiar with the use of the print_r() function. However, print_r() gives a difficult to read output and we end up matching braces to figure out the exact structure of complex objects. Here is a small trick which you can use to see the print_r() output in a 'Display for Humans' format.

echo '<pre>';
print_r($object);
echo '</pre>';

Let's see an example(borrowed from PHP.net):

<?php