Skip directly to content

Sudeepg's blog

Mysql "If exists update else insert" performance dilemma

on Thu, 12/16/2010 - 07:57

Everyone who uses databases is in the habit of using "If exists update else insert" in the software program. Irrespective of the software program (Oracle, Mysql, Sql Server) and irrespective of the language (Php, ASP, Java). Ever wondered what is the efficient way of doing it.

Typically, we do it this way:

Creating a PDF file with PHP: Tutorial

on Sat, 05/08/2010 - 07:55

In PHP, we have a nice open source library for PDF file generation, FPDF. This library has an extention FPDI that allows for manipulating PDF files. FPDI extracts the content of the pdf, allows you to change it and then output the changed pdf.

SVN Cheatsheet

on Fri, 04/09/2010 - 07:48

This cheatsheet is a quick reference for using SVN,

Create a Repository on Linux: svnadmin create

 To store projects in Subversion/SVN, first you must create a repository.

Drupal Cron Stuck? Log the progress.

on Fri, 04/09/2010 - 07:47

Challenge with Drupal 6 Cron

Drupal cron getting stucked is quite a common problem with Drupal 6 and I found out an interesting way to figure out the reason why it is getting stuck.

Logging as always

As always, the solution is to log at the correct place. Drupal cron is invoked at includes/common.inc in the function drupal_cron_run (around line 2727), so we begin here logging into watchdog. We have to start logging when the cron starts for a particular module and when it finishes as follows:

Yum has depsolving problems. What to do?

on Tue, 03/30/2010 - 07:44

Did you ever try to install an application on CentOS using powerful "yum" and had following errors showing up:

Configuring your favourite VIM for Drupal Coding Standards

on Sat, 03/06/2010 - 07:39

1) Create a file (if not already existing) .vimrc in your home directory.

2) Put following vimrc file in ~/.vimrc:

Configure and Installing Apache, PHP, and MySQL on Fedora/CentOS

on Sat, 03/06/2010 - 07:37

1. Install Apache (httpd), PHP, MySQL (server and client) and php-mysql bridge:

 yum -y install httpd php mysql mysql-server php-mysql 

2. Make the new services to start automatically on boot:

  /sbin/chkconfig httpd on
  /sbin/chkconfig --add mysqld  
  /sbin/chkconfig mysqld on

3. Start http and mysqld:

  /sbin/service httpd start
  /sbin/service mysqld start

4. Change Mysql root password:

 mysqladmin -u root password 'newpassword'   

5. Additional changes to Mysql security:

Installing PHP APC for Performance on Fedora/CentOS using Yum in 5 Steps

on Sat, 03/06/2010 - 07:29
  1. Install basic packages:
    yum install php-pear php-devel httpd-devel
  2. Install APC using pear. This is important: When the installer asks about APXS, say ‘no’. 
    pear install pecl/apc
    

Adding Items to cart in Drupal Ubercart: uc_cart_add_item() API

on Wed, 02/10/2010 - 07:25

Drupal with Ubercart

 Ubercart is an open source e-commerce package that works on Drupal. It is powerful because it has the flexible archtecture of Drupal behind it.

 Drupal is a powerful web-based, flexible, community solution and with Ubercart at hand, it allows e-commerce functions readily available to Drupal.

 

Installing, Upgrading and Maintaining Drupal and its modules with Drush

on Wed, 02/03/2010 - 07:23

Quick Tip:

Command line tools are usually very fast when doing a repeatative task.

 Linux/MAC command shell with all its shotcuts makes most developers like myself keep coming back for more development to them. Drupal too has its command shell: Drush and that can make the Drupal maintaince and upgrade the breeze.

 

Pages