How to install Varnish on CPANEL Server

Installation1. Make Apache listen in any other port other than 80. Here I am making Apache to listen in port 8080. It can be done in two ways. Either editing the httpd.conf file or editing the Tweak settings in WHMa) Editing httpd.conf file

# vi /usr/local/apache/conf/httpd.conf

Locate the following line in /usr/local/apache/conf/httpd.conf file and change the port from 80 to 8080

Error installing python library with pip on OSX: “'cc' failed with exit status 1” error

Make sure you have installe XCode and it is updated.Then Include the following enviroment variables  suing the command line tool: export CFLAGS=-Qunused-argumentsexport CPPFLAGS=-Qunused-argumentsThen try to install/ compile again.

What is using my port - Error: That port is already in use.

# netstat -tulpn | grep :80

You will get something like:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN 

Now you get the process number and you can proceed to kill it. In this case 12608:

Linux: Update System time and date

Simple:

sudo ntpdate pool.ntp.org

Django Migrations with South

For a Django project using South you need to use the following commands in order to sync the DB:

Start schema for app:

Run manage.py schemamigration app_name 

Run migration

Run manage.py migrate app_name

Reference:

Phonegap Cross-platform Mobile development

PhoneGap is a mobile development framework produced by Nitobi, purchased by Adobe Systems.[3][4] It enables software programmers to build applications for mobile devices using JavaScript, HTML5 and CSS3, instead of device-specific languages such as Objective-C.[5] The resulting applications are hybrid, meaning that they are neither truly native (because all layout rendering is done via web views instead of the platform's native UI framework) nor purely web-based (because they are not just web apps, but are packaged as apps for distribution and have access to native device APIs).

Implementation of conditions on Drupal AND OR queries

A simple query on Drupal looks like:

 
$query = db_select('users', 'u', $options);

So, a full query is:

Save time using Drush on Drupal

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

Simple tasks like clear cache can take long time using the web interface. Using drus you just need to use the following command:

How to create a calendar for a content type

You just need to install the calendar module. Located on this url:

https://drupal.org/project/calendar

After install it you will have access to some new views as a template:

 

Command to fix permissions for SUPHP

#Fix permissions on folder. Correct should be 755
find /webfolder -type d -exec chmod 755 {} \;
#Fix permissions on php files. Must be 644
find webfolder -name '*.php' -o -name '*.php[345]' -o -name '*.phtml'| xargs chmod -v 644