My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Friday, December 16, 2011

How to set WinDbg as your Default Postmortem Debugger

In one of my my earlier post related to Microsoft Useful Apps and Powertoys for Windows, I already talked about WinDbg. WinDbg is a tool for debugging any Crash in a program. This tool automatically syncs up the required pdb files ie. The symols file from the MSDN and enables your machine to debug the problems. Refer http://http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx You can have a dump of your crash and investigate, or contact your administrator. In addition, you can also log a radar (defect/bug) on the Microsoft. (Also See http://en.wikipedia.org/wiki/WinDbg)

This time I m gonna xplain how to set WinDbg as a Default Windows Postmortem Debugger.

Usually Windows system has Dr. Watson as the default debugger. But undoubtedly, Windbg has upper hands.

So what you can do is as follows:
1. Try to Install the latest Windbg Debugging Tools for Windows:
http://www.microsoft.com/whdc/devtools/debugging/default.mspx
2. You can Set WinDbg as a default debugger by issuing the following command:
WinDbg -I
It is very important to note that the letter 'I' must be capitalized.



3. Create some folder where the dump will. Give it full read/write permissions.
4. Open Registry editor (Run->regedit at command line)
Go to the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
It has the following value:
"C:\Program Files\Debugging Tools for Windows\windbg.exe" -p %ld -e %ld -g
Append this with following string:
-c '.dump /o /f C:\DMP\dmp1.dmp; q' -Q -QS -QY -QSY
The new key will have something like this :
"C:\Program Files\Debugging Tools for Windows\windbg.exe" -p %ld -e %ld -g -c '.dump /o /f C:\DMP\dmp1.dmp; q' -Q -QS -QY -QSY
[Lets assume here C:\DMP is the folder u wanna make dump creation folder]
5. Important to note the address of WinDbg, since it may vary depending on or OS being x86 or 64 bit.
6. Now it is set as postmortem debugger. In case of any crash now, windbg will pop-up saying the error is encounterd. Dump is stored in the folder allocated earlier.

You must remember the following:
a) Dump is not appended, so if there is some old dump, then that will be over-written
b) On some OS like Win Server 2k3, Win-XP XP and later, you can use the /ma switch instead of /f to save additional debugging information.

Readers can email me personally, as many regularly do, if they found the article helpful and wanna share how this helped them in their roles. Finding my email address is not at all any deal ;)
Cheers!!!
-Mohd Anwar Jamal Faiz

GeoBing by Anwar Faiz: First Facebook App using Bing Maps

I have developed a new Facebook Application and wanted to post something about that.


Name of the Facebook App: GeoBing

Description: Use the GeoBing App to share your location on Facebook using Microsoft's Latest Bing Maps. Your Profile would get updated with your current location and map.

Importance: GeoBing Facebook Application is the world's first innovative way to share your Geographical Location over Facebook using Bing Maps. You can even do it from your Laptop and Desktop Browsers.!!

GeoBing FaceBook Link: http://apps.facebook.com/geobing/?ref=ts

Steps to use:
Step 1: Click this button Show map. [You need to click this]

Step 2: When prompted, allow your location to be shared to see Geolocation in action

Step 3: When you see your Location information on the Map below, Click 'Post to Facebook' button on the bottom.

Effect: Your geographical location would be posted over your Facebook profile page.

Help promoting this App. This was designed in curiosity to use Bing Maps. And I am happy and glad to let you all know, GeoBing is the first Facebbok Application that uses Microsoft Bing Maps to post your Geographical location. This works from your desktop, laptops, handheld devises, Samsung Galaxy S2, Iphone, Ipads etc.

Love u all.
Keep clicking advertisements. Keep reading more original contents.
-Mohd Anwar Jamal Faiz

PHP Curl not working on GoDaddy Host : why and Solution

Problem is that sometimes PHP Curl library not works on GoDaddy Host. Why curl is not working and how to solve this issue is what this post is all about.

I was trying to use curl library in my php code. But was soon tired of seeing numerous failures. My code was pretty much neet [those who know me know that well. I like cleanliness!! ;) ].

Still I was getting timeouts or some or the other errors , as I tried playing between parametrs. It was after some research over the internet and the manual, I found out that the trouble was because of host. Actually, GoDaddy uses a proxy server.

Voila!! You got it!!

So now on, if anyone uses GoDaddy as host and wants to use the curl library in his codes, has to just tweak his code by some additional lines.

Let us assume that $hn is the curl handler.
Then you have to include this line in your PHP Code---
curl_setopt($hn, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt($hn, CURLOPT_PROXY,"http://64.202.165.130:3128");



Lets see an example..

<?php
$url = "http://www.meonshow.com/";

$hn = curl_init();
curl_setopt ($hn, CURLOPT_URL, $url);
curl_setopt ($hn, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($hn, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($hn, CURLOPT_PROXY,"http://64.202.165.130:3128");
curl_setopt ($hn, CURLOPT_TIMEOUT, 120);
$res = curl_exec ($hn);
if(is_int($res)) {
die("Error occured: " . curl_errno($hn) . " : " . curl_error($hn));
}
curl_close ($hn);

print "Target URL: " . $url . " " . $res;
?>


Now, you may as thanks click on few of the advertisements links. Do it man!!

Thursday, November 3, 2011

error: 452 Error writing:file larger than ulimit set

error: 452 Error writing file: A file cannot be larger than the value set by ulimit

Once I wanted to transfer file from a MAC machine to AIX 64 bit machine. It was an archived file. But after a few seconds of transfer, an abrupt notification of File size exceed was observed. It took me a while, but when the cause was found, I smiled. It was due to a basic setting in Unix based OSes.
The error seen was “Error Writing File : A file cannot be larger than the value set by ulimit”

So here comes the trick of Changing the maximum allowed file size (ulimit)
You cannot create or copy a file that is larger than the limit allowed by ulimit. The profit achieved by this restriction is that it prevents runaway processes from taking up too much disk space.

If you have to work with a file that exceeds the set limit, you must change the default user limit size.
It may be important to note at this point of discussion that the ulimit cannot exceed the values of the SFSZLIM and HFSZLIM tunable parameters.

In addition, do also note that the changed user limit is in effect for the current session only.
1. Use the su command to become root.
2. To view your current limit in blocks, enter:
ulimit -a
3. To set your limit to the new size for the current session, enter:
ulimit [-f] new_size< You can also permanently change your file size limit by setting the new limit in the /etc/profile or the /etc/default/login file. error: 452 Error writing file: A file cannot be larger than the value set by ulimit When trying to transfer a very big file (over ftp for example), you'll receive the error above, this limit is a security limit in AIX and you can solve it by simply editing the /etc/security/limits file and increasing the "fsize" limit or simply changing it to "-1" to be unlimited, and then retry your transfer, you don't have to restart the machine for changes to take effect. This problem have occurred to many as seen over the Internet. Many have reported to see this problem for the first time when they were trying to copy Oracle installer (of size : 1238844 KB) from Windows box to AIX 5.2 box through ftp and it throwed the following The error as already pointed was --" 452 Error writing file: A file cannot be larger than the value >set by ulimit."

Many have reported that they changed the ulimit value to unlimited and then tried copying even after
that the same error was thrown.
Then they changed fsize value in /etc/security/limits file.
Then I tried copying the Oracle installer and it was successful.

It should be remembered here that the problem here is the file system on AIX is JFS (Journalled File
System) and it supports files of size <=2GB. So, if we want to have a file
of size more than 2 GB we need to change the file system to Extended
Journalled File System.

Wish yo all the best,
Anwar

Introduction to Linux FTP command by Anwar Faiz

This post is an introduction to the Linux FTP command. I will discuss in short, the FTP commands, ‘l-variants’, ‘!-variants’, and ‘m-variants’ command in FTP.

To start with, let me tell you that ftp command relates to the File Transfer Protocol. A typical use of the command ftp is for remotely copying, renaming, and deleting files.

For instance:
ftp abc.anwar.edu
This command will attempt to connect to the ftp server at abc.anwar.edu. If it succeeds, it will ask you to log in using a username and password. In case it is a public ftp server, it often allows you to log in using the username "anonymous" and your email address as password. After you are logged in you can get a list of the available ftp commands using the simple help function:
ftp> help
This lists the commands that you can use to show the directory contents, transfer files, and delete files.

Now let us analyze what you can do once you are in FTP command mode. The Shell prompt at this time typically becomes as ftp>.
You can type one of many commands available now to achieve different results.
For instance, ftp> ls
This command prints the names of the files and subdirectories in the current directory on the remote computer.
In a similar way, ftp> cd customers
This command changes the current directory to the subdirecotry "customers", if it exists.
In the same manner, ftp> cd ..
Changes the current directory to the parent direcotry.
Now there can be another variants of these commands too. Because remember now you are in a 2 computer zone. One is your host system from which the ftp command is run. Another is your remote system that has been FTPed here. So for these you can use a prefix ‘l’ befor above command to traverse through the directory structure of the local computer. Obviously ;) local means host system.
For example, ftp> lcd images.
Changes the current directory on the local computer to "images", if it exists.

Now we can directly land into serious discussions. First of any such discussion is about the modes of transfer. There can be two modes of transfer of files. One is ‘ascii’ and another is ‘binary’.
For example, ftp> ascii
Changes to "ascii" mode for transferring text files.
And ftp> binary
Changes to "binary" mode for transferring all files that are not text files.

The next point in discussion is about the transfer of files. After all, it is only for which the FTP command is all about.
So here comes the first one GET command.
Using ftp> get image1.jpg
You can download the file image1.jpg from the remote computer to the local computer.
It is warned that in case there already is a file with the same name it will be overwritten. Obviously you may smile over this warning ;)

And now comes the command for Uploading data, the PUT command
The command ftp> put image2.jpg
Uploads the file image2.jpg from the local computer to the remote computer. Again the same warning of file overwriting if file exists.

Using ‘!’-variant commands in ftp you can achieve results on local computer.
ftp> !ls
A '!' in front will execute the specified command on the local computer. So '!ls' lists the file names and directory names of the current directory on the local computer.

The last of such serious ( please smile again ;) what serious?). Ok. So the last one of such serious discussions would be the ‘m’-variant commands of get and put.
ftp> mget *.jpg
With mget you can download multiple images. This command downloads all files that end with ".jgp".
ftp> mput *.jpg
Uploads all files that end with ".jgp".
ftp> mdelete *.jpg
Deletes all files that end with ".jgp".

The blogpost would remain incomplete if I do not tell about the last point.
ftp> quit
This command exits the ftp program, and lets you return on the normal shell prompt.

With this I end this blogpost. I guess, it is sufficient to begin with and in a typical day to day job. For more details and examples, you may like to visit the website FTP tutorial from About.com. Take care :)