Tuesday, December 29, 2009

Installing RMagic in fedora

To install RMagic gem for graphic operations in fedora os follow the below instructions
open terminal by Application -> System Tools -> Terminal
login as root by giving command su
#password: enter root password
goto ruby path
#cd usr/lib/ruby
issue the below command
[root@localhost ruby]
gem install rmagick --no-rdoc --no-ri
you should see the below message if successfully installed RMagic gem
Building native extensions. This could take a while...
Successfully installed rmagick-2.12.2
1 gem installed
To see the gem in your local gems list issue the below command
[root@localhost ruby]# gem list --local

*** LOCAL GEMS ***

actionmailer (2.3.4)

For Windows users
c:\> gem install rmagick-2.0.0-x86-mswin32.gem

Bydefault gem install will look for the particular gem name in rubyforge site.
You can also mention the path for git repository if the gem is available in github.

Wednesday, December 23, 2009

Rails error: initialize_without_backlog': Address already in use - bind(2)

When try to start the webserver for the application some times this error may happen. This happen when you already run any application in the same port number. Make sure you are not running any other rails application with that same web server in the same system.

If you already start the server one one application, stop it for that application and run for the new application you want.

Good Luck -:)

Tuesday, December 22, 2009

Item Stock Availability check for oscommerce

Availability contribution allows you to set an unique message to
display on each product relating to the availability of the item.
Two messages can be set, one for in-stock and another for out of stock.
Includes convenient admin tool to add and modify the messages
menu on the product edit page. Allows you to include the actual
stock quantity in the message.

donwload this addon from below url

Userfull admin features in oscommerce

Here are few of the features available for the siteadmin in oscommerce.

Manage administrators
Manage Administrators including add new admin, or edit / delte admin information.

Manage customers
View and manage the customers registered to the site

Manage orders
Process and Manage orders made by customers

Categories, subcatagories and products
Managing all categories, subcategories and products in the site. Site admin can add/ edit or delete catgories, subcategories and products.

Product Attributes
Managing all product attributes like color, price etc.,

Product Reviews
View the statistics of each product reviewed by customer

Site was entirely in multilanguage. Admin can manage the content for each locationization.

View the reports of products viewed, products purchased

Send Emails
Sending emails to customers

Sunday, December 20, 2009

Best Employee Award

I got Best Employee of the year 2008 award on December 14th 2009. I had a warm hug with my CEO.

Wednesday, December 16, 2009

PHP sending emails with gmail smtp to prevent spam mails

1 Download PHPMailer from http://phpmailer.sourceforge.net
2 Extract to folder phpmailer
3 Create a file email.php
4 Paste this code and change the values in blue as you need (I modified the sample code given on the PHPMailer homepage)

$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
IsSMTP(); // send via SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "username@gmail.com"; // SMTP username
$mail->Password = "password"; // SMTP password
$webmaster_email = "username@doamin.com"; //Reply to this email ID
$email="username@domain.com"; // Recipients email ID
$name="name"; // Recipient's name
$mail->From = $webmaster_email;
$mail->FromName = "Webmaster";
$mail->WordWrap = 50; // set word wrap
$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // attachment
$mail->IsHTML(true); // send as HTML
$mail->Subject = "This is the subject";
$mail->Body = "Hi,
This is the HTML BODY "
; //HTML Body
$mail->AltBody = "This is the body when user views in plain text format"; //Text Body
echo "Mailer Error: " . $mail->ErrorInfo;
echo "Message has been sent";

5 Open the file class.smtp.php in phpmailer directory
6 Paste this code
$host = "ssl://smtp.gmail.com";
$port = 465;
before the line 104 #connect to the smtp server
Hint: Search for #connect
7 Open this page in browser and it will send the email using GMail.

Hint: When you want to email the details from a form, set the variables using the form variables.
eg. $mail->Username=$_POST['email']