Monday, May 23, 2016

Git script which shows little bit advanced status. Save with Preferred file name in /usr/local/bin/XX
branches="git branch --list"
while read -r branch; do
clean_branch_name=${branch//\*\ /}
description=`git config branch.$clean_branch_name.description`
if [ "${branch::1}" == "*" ]; then
printf "$COL_RED$branch$COL_RESET $description \n"
printf " $branch $description\n"
done <<< "$branches"
git status
Use the following command to add a description to your local branches.
git branch --edit-description

Saturday, April 2, 2016

SQL Result as CSV

SELECT * FROM core_config_data INTO OUTFILE '/tmp/core_config.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '`' LINES TERMINATED BY '\n';

Tuesday, December 15, 2015

Dual Screen Script for Ubuntu

I have experienced problems when installing two monitors in Ubuntu. Following script will help you to solve this problem. I had problems when saving below values so I created a script and put it to the startup.
xrandr --output VGA-0 --mode 1920x1080 --pos 1280x0 --rotate normal --output DVI-I-1 --off --output DVI-I-0 --mode 1280x1024 --pos 0x0 --rotate normal --output HDMI-0 --off

Tuesday, August 26, 2014

MYSQL Compare data in different Databases

Following statement will compare values in two databases and gives you records that not matched.

SELECT stage,live,path,scope_id FROM
        WHEN (S.value = L.value) THEN ''
        ELSE 'N/M'
    END) as matched,
    S.value AS 'stage',
    L.value AS 'live'
    cin_stage.core_config_data S
        INNER JOIN
    cin_live.core_config_data L ON S.path = L.path
WHERE matched = 'N/M'
ORDER BY scope_id

Thursday, August 7, 2014

Magento DB access denied

I got this error suddenly while accessing the magento site.

SQLSTATE[HY000] [1129] Host 'user.workgroup' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'


use below command in console

mysqladmin flush-hosts

or log in to  mysql with a different host if its implemented on network environment and use below statement;



Restart the mysql server

Monday, July 28, 2014

PHP URL Checker using CSV

| File: url_checker.php
| Info: Take CSV as inpu and check url status.
| Usage: php url_checker.php
| CSV file contain URLS
| ex:

$file = fopen("urls.csv","r");

while(! feof($file))
 $row = fgetcsv($file); 

 $handle = curl_init($row[0]);
 curl_setopt($handle,  CURLOPT_RETURNTRANSFER, TRUE);
 $response = curl_exec($handle);
 $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); 
  //Following will use teminal colors to 
  echo "\033[01;31m{$httpCode} \033[0m {$row[0]} \n";
  echo $httpCode."\n";

echo "Finished fetching...";


Sunday, July 13, 2014

Magento Generate Google Sitemap using Cron

I had a problem with generating the Google sitemap using cron job. To do that you can simply change following database value.

SELECT * FROM core_config_data
WHERE path = 'crontab/jobs/sitemap_generate/schedule/cron_expr'

Change the value as you set time in cron jobs.

EX: Generate the Sitemap for every 5 minutes

value = */5 * * * *

That's it. Now you have to worry about cron is working or not. Just type following in your browser and hit enter.

Friday, March 14, 2014

Delete Order details from Magento


TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `sales_order_aggregated_created`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;

ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1;


Thursday, March 13, 2014

Delete Customer Details from Magee using SQL

-- reset customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
TRUNCATE customer_entity;
TRUNCATE customer_entity_datetime;
TRUNCATE customer_entity_decimal;
TRUNCATE customer_entity_int;
TRUNCATE customer_entity_text;
TRUNCATE customer_entity_varchar;
TRUNCATE log_customer;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;

ALTER TABLE customer_address_entity AUTO_INCREMENT=1;
ALTER TABLE customer_address_entity_datetime AUTO_INCREMENT=1;
ALTER TABLE customer_address_entity_decimal AUTO_INCREMENT=1;
ALTER TABLE customer_address_entity_int AUTO_INCREMENT=1;
ALTER TABLE customer_address_entity_text AUTO_INCREMENT=1;
ALTER TABLE customer_address_entity_varchar AUTO_INCREMENT=1;
ALTER TABLE customer_entity_datetime AUTO_INCREMENT=1;
ALTER TABLE customer_entity_decimal AUTO_INCREMENT=1;
ALTER TABLE customer_entity_int AUTO_INCREMENT=1;
ALTER TABLE customer_entity_text AUTO_INCREMENT=1;
ALTER TABLE customer_entity_varchar AUTO_INCREMENT=1;
ALTER TABLE log_visitor_info AUTO_INCREMENT=1;

Wednesday, October 30, 2013

Delete Magento images programmatically

$productId =1;
$mediaApi = Mage::getModel("catalog/product_attribute_media_api");
$mediaApiItems = $mediaApi->items($product->getId());

foreach($mediaApiItems as $item)
 $mediaApi->remove($loadpro->getId(), $item['file']); 

Tuesday, August 6, 2013

Search column name from MYSQL database

SELECT table_name,column_name,table_schema
WHERE column_name like '%mail%'

Thursday, July 11, 2013


I have used DbVisualizer 9.0 in Ubuntu 13.04. Because of that I cannot use other software like netbeans and chrome due to slowness of their process. So I moved to different Mysql Admin tools and Tora is great tool.

here is how you can install it in Ubuntu

$ sudo apt-get install tora
$ sudo apt-get install libqt4-sql-mysql libqt4-sql-psql libqt4-sql-sqlite libqt4-sql-odbc libqt4-sql-tds

Saturday, February 2, 2013

Cheap Web Hosting

I just want to mention here I found some of my friends offering cheap web hosting in fiverr. Checkout their gigs. They offer following options for $5. Its Cheap I guess. Why don't you give a try

Below are the links to those gigs. You can pay them via Paypal

Tuesday, October 16, 2012

Use Default Value in Product Magento

Again I Spent quiet time to set `Use Default Value` in Magento. 

I wanted to set Product Status to be `Use Default  Value` under store views. I tried some methods and checked not lucky for me so i tested with the database.

Wednesday, July 18, 2012


You might want to update or insert Database single statement rather than checking the record is inserted or and again go to the update.

But using following SQL statement you can run First run and check Insert statement and if that fails Update statement after that.

Sunday, June 3, 2012

Override Magento Module MD5 to SHA1

Override Magento Module MD5 to SHA1

Here I am going to override the hash function in Encryption class to sha1 instead of md5.
Original file is located in below path.

Sunday, March 11, 2012

AJAX, Cross Domain, XMLHttpRequest, XDomainRequest Over IE8 FF8 and Chrome

Ok.I have been faced for this cross domain request using ajax last week and i got real pain when i tried to use it.
I tried with jquery ajax and read lots of articles from the Internet. Reading made me to do this post.
First i tell you what was my scene. I had to do a validation regarding some value. I request this via Ajax.

Sunday, October 16, 2011

SQL Distributed Management Objects (SQL-DMO)

A SQL-DMO object exposes the attributes of a Microsoft® SQL Server™ 2000 component.
Distributed Management Objects (DMO) is a set of programmable objects that come with SQL Server that make it easy to programatically administer your databases. SQL-DMO is actually the foundation of Enterprise Manager, so you can pretty much do anything programatically that you can do in the management tools. Some of these tasks include :

Send mail with VB.NET + Gmail

Here is a post how to send Email using VB.NET including your Gmail Account

Codeignitor Simple Example

How To Remove index.php
How To use CSS,Javascript & etc in your site

Before Start

Monday, October 10, 2011

Google Chart API perfect way to visualize data in your web site

Google Chart API perfect way to visualize data in your web site

JavaScript classes. Many Chat Types. Easily Customizable. Highly Interactive with events. Charts are rendered using HTML5/SVG technology to provide cross-browser compatibility (including VML for older IE versions) and cross platform portability to iPhones, iPads and Android. No plugins are needed.

Perfect right?

You should identify there are two types of charts are  provided by google.

Google chart tools are powerful, simple to use, and free. Try out our rich gallery of interactive charts and data tools. 

The Google Chart API lets you dynamically generate charts with a URL string. You can embed these charts on your web page, or download the image for local or offline use.

Its not hard  to build up a chart using google. Its easy. Google documentation gives you enough details to customize your chart.

Sample example

<!--Load the AJAX API-->
<script type="text/javascript" src=""></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {

// Create the data table.
var data = new google.visualization.DataTable();
.addColumn('string', 'Topping');
.addColumn('number', 'Slices');
['Mushrooms', 3],
['Onions', 1],
['Olives', 1],
['Zucchini', 1],
['Pepperoni', 2]

// Set chart options
var options = {'title':'How Much Pizza I Ate Last Night',

// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
.draw(data, options);

<!--Div that will hold the pie chart-->
<div id="chart_div"></div>

Have fun make you chart

Sunday, September 18, 2011

Instalation of xdebug on Linux and Work with Eclipse (Ubuntu 11.04)

The Xdebug extension helps you debugging your script by providing a lot of
valuable debug information.(

Installation of xdebug

Open up ur terminal and do below

sudo pecl install xdebug

Output of terminal display like below

Build process completed successfully
Installing '/usr/lib/php5/20090626+lfs/'
install ok: channel://
configuration option "php_ini" is not set to php.ini location
You should add "" to php.ini

editing the php.ini

sudo gedit /etc/php5/apache2/php.ini

append below line to php.ini
You can find from when you install pecl. (Output message in terminal)


eclipse configuration

Debug Configuration (Run>Debug Configuration)

Set Server Debugger to XDebug (not Zend Debugger)

Start Debugging

Thursday, April 7, 2011

Expire Session When the Browser Close [Codeigniter]

I wanted user to log again to the site whenever they close the browser. i searched everywhere and i found the easiest way.


sess_expire_on_close = TRUE


Session Preferences

You'll find the following Session related preferences in your file:
Preference Default Options Description
sess_cookie_name ci_session None The name you want the session cookie saved as.
sess_expiration 7200 None The number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0
sess_expire_on_close FALSE TRUE/FALSE (boolean) Whether to cause the session to expire automatically when the browser window is closed.
sess_encrypt_cookie FALSE TRUE/FALSE (boolean) Whether to encrypt the session data.
sess_use_database FALSE TRUE/FALSE (boolean) Whether to save the session data to a database. You must create the table before enabling this option.
sess_table_name ci_sessions Any valid SQL table name The name of the session database table.
sess_time_to_update 300 Time in seconds This options controls how often the session class will regenerate itself and create a new session id.
sess_match_ip FALSE TRUE/FALSE (boolean) Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
sess_match_useragent TRUE TRUE/FALSE (boolean) Whether to match the User Agent when reading the session data.

Tuesday, April 5, 2011

Date Difference in PHP

There is a easy method for find date difference in php.

But this method didn't work after i hosted my files.

So i came up with following. it is generating difference in days. but you can use other calculations for generate Months, years. This is a simple method.

$from = date("Y-m-d",strtotime('2011-04-01'));

$to= date("Y-m-d",strtotime('2011-04-06'));

$diff = strtotime($from )-strtotime($to);

echo floor($diff / (60*60*24));

60*60*24 = Generate Days (86400)

"year" = 29030400,

// seconds in a year (12 months)
"month" = 2419200, // seconds in a month (4 weeks)
"week" = 604800, // seconds in a week (7 days)
"day" = 86400, // seconds in a day (24 hours)
"hour" = 3600, // seconds in an hour (60 minutes)
"minute" = 60, // seconds in a minute (60 seconds)
"second" = 1 // 1 second

Saturday, April 2, 2011

Codeigniter Email Sending Using GMAIL

I searched this and got it. Worked fine. Only problem was below code line.


If you miss it code wont work

$config = array(
'protocol' => 'smtp',
'smtp_port' => 465,
'mailtype' => 'html',
'charset'=> 'iso-8859-1',

$this->email->from('', 'Your Name');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');

echo $this->email->print_debugger();

Simple as that

Thursday, September 23, 2010

Execute *.sql with .NET

Do you ever want to execute slq statements at once. I mean SQL Script file.

Normally we are using like following commands to Execute Single SQL statement.

SqlCommand cmd = new SqlCommand(sSQL, conn);

but this way you can execute one command at a time. We cannot execute SQL script using above command.

Normal SQL Script Like this.

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK__titleauth__au_id__0519C6AF]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[titleauthor] DROP CONSTRAINT FK__titleauth__au_id__0519C6AF

CREATE TABLE [dbo].[authors] (
[au_id] [id] NOT NULL ,
[au_lname] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[au_fname] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[phone] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[address] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[city] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[state] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[zip] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[contract] [bit] NOT NULL

When executing above script SqlCommand gives an exception because it does not know about "GO" like statements.

But simply we can execute SQL Script by following by removing GO keyword.


This is not a complete example. But i explain you important lines.
Here i assumed you have taken Whole SQL Script into txtSqlScript.Text

i have created two string arrays. one to hold "GO" keyword and one to hold SQL Statments taken from Split function.

String.Split is a function that split a single string into multiple strings by a seperator.
The seperator is the "GO"

After finished Split process i have executes each statement by cmd.ExecuteNonQuery();

[] removeWord ={"GO"};
string[] statements;
statements = txtSqlScript.Text.Split(removeWord,StringSplitOptions.RemoveEmptyEntries);

(string singleStatement in statements)
singleStatement );
SqlCommand cmd = new SqlCommand(sSQL, conn, t);

May be there are More ways. But I did this by my self. Im happy with this.
Leave a Comment

Friday, March 5, 2010

Remove comma from a String in Crystal Reports

I have a little problem regarding with following in Crystal Report

"Salary Sheet For "+ Monthname (month({PrintPaySlip;1.Salary_Date}))+ " "+ totext(TONumber({@FYear}))

Outout will be like follwos.

Salary Sheet For January 2,010

What i want is like follows (Without the comma)

Salary Sheet For January 2010

So the soultion would be like this.

"Salary Sheet For "+ Monthname (month({PrintPaySlip;1.Salary_Date}))+ " "+ totext(TONumber({@FYear}),0,"")

Thanks for looking a simple function.
but if you dont know....
it'll become Difficult....
Learn everything....
impossible but give a try...

Friday, January 22, 2010


I think you can understand with following code.

SalesInvoice rpt = new SalesInvoice();

rpt.RecordSelectionFormula = SQL;

rpt.SetDatabaseLogon("sa", "pwd");

PrintDialog prtdlg = new PrintDialog();

prtdlg.ShowDialog();rpt.PrintOptions.PrinterName = prtdlg.PrinterSettings.PrinterName;

rpt.PrintToPrinter(prtdlg.PrinterSettings.Copies, prtdlg.PrinterSettings.Collate, prtdlg.PrinterSettings.FromPage, prtdlg.PrinterSettings.ToPage);

Keep Programming.

Saturday, July 18, 2009

Customized Page for Printer

  • Intro
  • How to Create Customized papper (Windows XP)
  • Set the Customized papper as Default paper to the printer.


When i was working with several projects; customers are using pre printed invoices for print their bills.For printing invoices i used Crystal Reports. for print particular information on that pre printed invoices i had to waste lots of time with doing alignments. If that pre-printed bill is A4 then its easy for me to set alignments because most of every printer supports A4 papers.(NOT POS PRINTERS). But if the customer select a Paper which is not supports to the printer then i have to waste lots of time to set the paper alignments.

New printers are supporting user to set their own customized paper. But lots of companies still using dot matrix printers for print lots of invoices. It is easy and economical. Most of all Dot matrix printers does not have a feature to customized the paper size.Windows XP has a option to user defined paper on Printer and Faxes in the control panel. Unfortunately some of printers are not supporting this feature.But Luckyly printers like Epson LX-300+ (very popular dot matrix printer) supports customized papers.If the paper size is supports to the printer other things going to be very easy

How to Create Customized paper (Windows XP)

(Assume have Epson LX-300+ printer attached to my PC)
Open Control Panel an double click on Printers and Faxes.

Select File
select Server Properties

Then you can see Print Server Properties Dialog Box.
Put a Check Mark on Create a new form under Forms tab.

Now you can define Paper size and printing margins on Form description (measurements) Area.
After finish your work give Appropriate Name on Form Name and click Save Form.

Set the Customized paper as Default paper to the printer

Right Click on Epson LX-300+ printer and select Properties.

click Printing Preferences
from Printing Preferences dialog box click Advanced button
From the Advanced Option dialog box select Paper Size and click the paper name you already created.
click OK twice.
Select Device Settings Tab from Properties Dialog Box.
Choose Customized paper for Manual Feed:, Sheet Feeder: and Tractor Feed:.

click OK.

Now your Printer Default paper settings are set to your Customized paper.

Tuesday, July 14, 2009

Create RSS with Simple Example

  • Content
  • What is RSS and Usage
  • How do i subscribe to RSS
  • Creating the XML file
  • Creating the HTML file
  • Testing The Sample
What is RSS and Usage

RSS - Really Simple Syndication also known as Rich Site Summary. RSS feeds provide Webmasters and content providers to update their site summaries to Readers of the site.

A blog sites are always updating by new articles daily.
If a reader of that blog wanted to read newly posted articles, he or she wanted to go to the site and check whether there are any new posts available.
Without going to the blog site if they can check are there any new posts available. If so, readers can check the post's title and description then by selecting particular title and log into that article directly....It'll be easier for that reader.

For that owner of the blog site has to do update a xml file with summary of newly posted articles and give a link to that file.
Readers have to do subscribe for that link and get that newly posted article's summaries to RSS reading software. (Firefox has inbuilt RSS reader. )
Now Redaer can check are there any Newly updated articles available or not.

How do i subscribe to RSS

All you have to do go to the site which is give RSS feature. Almost Every updating websites are providing this feature (News sites).
You Can see These kind of RSS logos.

Just click on that picture from selected site. Before that you should have installed RSS reading Software. (FeedDemon from
You can use Firefox.

Creating the XML file

Lets move on to a simple example. RSS content stored in a XML file. lets create that file.
Assume your publishing new posts to your blog site. Readers of your site needed to know your newly posted articles. So after publishing your new posts to the blog your creating or updating your RSS file. Saying that i have published these articles and here are those article's titles, description and the link for that article

Type following in notepad and save it as "newposts.xml".

<rss version="2.0">
<title>New Posts</title>
<description>July articles are now available</description>
<title>Article 1</title>
<description>Small Description of Article 1</description>
<title>Article 2</title>
<description>Small Description of Article 2</description>
<title>Article 3</title>
<description>Small Description of Article 3</description>

this is a simple file. Try to understand it. it'll be very easy. Above tags <channel>,<rss>,<Title>,<Description> and <link> are vital tags. beyond that there are more tags are using to describe the RSS.

like pubdate,lastbuilddate,language,copyrght,category,docs...and more. As a beginner we can start with above and you can find many tags from the internet.

Creating the HTML file

Now you created the xml file. I have saved that file in http://localhost/rss/newposts.xml

lets create a html file which is tells the user to subscribe to newly posted RSS Feed.

type following in notepad and save it as welcome.html. i am putting that file in http://localhost/rss/welcome.html

<LINK rel="alternate" type="application/rss+xml" title="RSS Newly Posts" href="http://localhost/rss/newposts.xml">
<h1>Click <a href="http://localhost/rss/newposts.xml">here</a> to Subscribe to newly posted articles</h1>

The following line tells to the rss readers to where is the RSS file located. Rss Reader will get the content of that file and shows you in a propper way.

<LINK rel="alternate" type="application/rss+xml" title="RSS Newly Posts" href="http://localhost/rss/newposts.xml">

Testing The Sample

This example is tested on apache web server Using Firefox as a web browser and RSS reader.
first of all reader has to subscrbe to that page.
i am loggin to that welcome page using firefox.

Then readers have to check whether there are any new posts available daily by clicking on that bookmark.
Webmaster has to do update that xml file when there are any new posts.

Thursday, April 2, 2009

Application Configuration FIle Visual Studio 2005

Through the application configaration file You can easily save values to later usage.
you can create a application configuration file from

project > Add New Item (Ctrl + Shift + A)


You want to add get string from config file

Create a Config file using above step.
after that insert following code to the config file. its a XML file.

add key="DatabasePath" value="c:\\projects\data\spider.mdb"
add key="SupportEmail" value=""

in the coding add following

Dim app As New System.Configuration.AppSettingsReader
Dim s As String
s = app.GetValue("DatabasePath", Type.GetType("System.String"))

its very easy when you are handling databases.
you can store database connection string in that config for later reusabilty.

Please post your comments

Tuesday, January 6, 2009

How To Disable Export Button In Crystal Report

When you are taking crystal report printouts through a program, such as program written using vb6. you might have a problem how to disable Export button in print preview.

Preview window contain export Button

All you have to change following property to false or Uncheck the Export option in Property Pages.

CR.WindowShowExportBtn = False

Crystal Report Object

Crystal Report Object in Visual Basic 6. (CR is refer to Crystal Report Object )

Preview window does not contain export Button

You can go to Property Pages by right click and choose Properties on Crystal Report Object

After you done those things you crystal Report print preview will showing like follows.

I was face to above problem. We implemented a software program which is written using vb6.
Cashier can take daily sale print out. before printing it is showing a preview to the user. So when the time pass user click export button and saved that report as a excel file. Then he modified the values and took printout to the management. That gives Security problem to the program and program become unstable. So we Disable Export Button to minimize the problem.

Thursday, December 18, 2008

MS-DOS Batch Files

This Article Contain:

Introduction to MS-DOS Batch Files
Create a Simple Program
How to Get Command Prompt and its commands
Matrix Program

Introduction to MS-DOS Batch Files

Batch files are not a program. It consists of commands and batched in to a one file. That file called as Batch file. It is easy to make batch files. If you can think lot may be you can make an advance batch file. Just Think.

Create a Simple Program

@echo off
Tree /f /a
Echo Did you see directory of your C drive

Type above example in Notepad and save it as any name you prefer and extensions should be .cmd of .Bat.

Example:- MyBatchProgram.cmd or MyBatchProgram.bat

Run that file.

That is called Batch program. If you type above command lines in MS-DOS command Prompt then you’ll get same kind of results. Different is you have to type each command by command instead of double clicking the batch program.

How to Get Command Prompt and its commands

You can learn commands in MS-DOS by typing help in MS-DOS Command Prompt. To get that,
Go to Start > Run and Type Cmd or Command. In the command prompt type HELP. You will get lots of commands. If you need more help about each program shown in command prompt Type particular program name and /? after the program’s name.

Example:- tree /?

Matrix Program

@echo off
color 0A
echo 100 000000 0010 010010 101 01110 111000 0 1111 0100 0001 11 110 01
echo 010011 0101 011 01 010 101010 10 101101 110 110110 10110 11 01101101 11
echo 11110111 101 10 1 01 111100 10 01 100 0000101 1 11101 000110 01 011 01
echo 100 000000 0010 010010 101 01110 111000 0 1111 0100 0001 11 110 01
echo 0101000 0000 0 00 0 0011101 11010 11011 1011 1011011000 0 1 1000000011
echo 11110111 101 10 1 01 111100 10 01 100 0000101 1 11101 000110 01 011 01
Goto start

Save above program as MATRIX.CMD or MATRIX.BAT. This file found from Internet who has implemented his creative idea.

More Batch file Help is coming near future…..
(If you are hurry please forward your problem to


How to connect PDA with SQL Server 2000

How to connect PDA with SQL Server 2000

When we trying to connect PDA with SQL Server 2000 It generate SQL Exception every time. We searched every where to overcome this matter. Our target was connecting PDA to Server Computer via Wifi and does the transaction to SQL Server 2000. We designed program with MS Visual Studio 2005 and Deployed to PDA. We included the Connection String as following.

"Data Source=ServerName;Initial Catalog=master;Integrated Security=true;User ID=sa"

Server Computer should include following connectivity software.

  • MS .NET Framework 2.0

  • MS SQL Server 2000 Service Pack 3

  • MS SQL Server 2005 Compact Edition [ENU]

  • MS SQL Server 2005 Mobile Edition Device SDK

  • MS SQL Server 2000 SP3a Replication Components

  • MS SQL Server 2000 SP4 Replication Components

You can download above from the Microsoft site.

After you install above software and when you trying to connect PDA with Server maybe you will still get that SQL Exception Error. What you have to do is go to your Windows firewall and switch off the firewall and go to Advance Tab and click ICMP Settings and enable "Allow incoming echo Request". Apply the settings and try to Connect.

If you have still troubles with this Matter mail me your situation to


Tuesday, November 18, 2008

Google Talk Secret Emoticons

Some of the basic emoticon like :) and :D works inside google talk and on typing will turn bold blue like: :) and :D. Some other notably useful emoticons are

:( , :P , :O , : , :'( , :x , :-) , :-D , :-( , :-P , :-O , :- , :-x .

However, if you use chat feature inside Gmail, there are few animated emoticons which aren't documented and hidden for normal users.

One thing to keep in mind is that all emoticons are available for Gmail chat client but Google talk does not supports all of them. Google has beautifully added 'animated smileys' or 'emoticons' to the Gmail-integrated version of Google Talk. These emoticons begin by showing you what you typed, then rotate or morph into a more traditional smiley (Refresh this page to see what I mean). Most of them are black on white (like the text in chat), with a few splashes of color. If you hover mouse arrow over them, they again re-animate to create lovely effect.

To use emoticons, you need to click the blue smiley-face button at the right of the text-entry field. A pop-up menu appears, where you can choose from different emoticon sets, including circular, rectangular, or standard. However beside these, there are few others which are undocumented and considered as hidden emoticons just like secret text formatting feature in Google talk.

Below is the list of all secret emoticons. Type the appropriate combination of keys in chat box and press enter to display them .

Emoticon Type this
to get this!
<3 heart
:() monkey
\m/ rock out!
:-o shocked
:D grin
:( frown
X-( angry
B-) cool
:'( crying
=D big grin
;) wink
:- straight face
=) big smile
:-D nose grin
;^) big nose wink
;-) nose wink
:-) nose smile
:-/ skeptical
:P sticking tongue out

Note that if you send an emoticon to someone who isn't using chatting through Gmail, the emoticon may not display properly.

Wednesday, October 22, 2008


The first day of Uni our professor introduced himself and challenged us to get to know someone we didn't already know. I stood up to look around when a gentle hand touched my shoulder.
I turned around to find a wrinkled, little old lady beaming up at me with a smile that lit up her entire being.
She said, 'Hi handsome. My name is Rose. I'm eighty-seven years old. Can I give you a hug?'
I laughed and enthusiastically responded, 'Of course you may!' and she gave me a giant squeeze.
'Why are you in college at such a young, innocent age?' I asked.
She jokingly replied, 'I'm here to meet a rich husband, get married, and have a couple of kids...'
'No seriously,' I asked. I was curious what may have motivated her to be taking on this challenge at her age.
'I always dreamed of having a college education and now I'm getting one!' she told me.
After class we walked to the student union building and shared a chocolate milkshake.
We became instant friends. Every day for the next three months we would leave class together and talk nonstop. I was always mesmerized listening to this 'time machine' as she shared her wisdom and experience with me.
Over the course of the year, Rose became a campus icon and she easily made friends wherever she went. She loved to dress up and she revelled in the attention bestowed upon her from the other students. She was living it up.
At the end of the semester we invited Rose to speak at our football banquet. I'll never forget what she taught us. She was introduced and stepped up to the podium. As she began to deliver her prepared speech, she dropped her three by five cards on the floor.
Frustrated and a little embarrassed she leaned into the microphone and simply said, 'I'm sorry I'm so jittery. I gave up beer for Lent and this whiskey is killing me! I'll never get my speech back in order so let me just tell you what I know.'
As we laughed she cleared her throat and began, 'We do not stop playing because we are old; we grow old because we stop playing.
There are only four secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day. You've got to have a dream. When you lose your dreams, you die.
We have so many people walking around who are dead and don't even know it!
There is a huge difference between growing older and growing up.
If you are nineteen years old and lie in bed for one full year and don't do one productive thing, you will turn twenty years old. If I am eighty-seven years old and stay in bed for a year and never do anything I will turn eighty-eight.
Anybody can grow older. That doesn't take any talent or ability. The idea is to grow up by always finding opportunity in change. Have no regrets.
The elderly usually don't have regrets for what we did, but rather for things we did not do. The only people who fear death are those with regrets.'
She concluded her speech by courageously singing 'The Rose.'
She challenged each of us to study the lyrics and live them out in our daily lives.
At the year's end Rose finished the college degree she had begun all those years ago.
One week after graduation Rose died peacefully in her sleep.
Over two thousand college students attended her funeral in tribute to the wonderful woman who taught by example that it's never too late to be all you can possibly be.
When you finish reading this, please send this peaceful word of advice to your friends and family, they'll really enjoy it!
These words have been passed along in loving memory of ROSE.
REMEMBER, GROWING OLDER IS MANDATORY. GROWING UP IS OPTIONAL. We make a Living by what we get, we make a Life by what we give. Life promises a safe landing, not a calm passage. Life is what YOU make of it.