Sunday, March 14, 2010
Tuesday, September 12, 2006
Maybe Last Post on Sumitworld.blogspot.com
Hi,
I am not so happy saying that, but yes its last post for now on this blog. Hey that doesn't mean i will not write ... I have new Domain as you know and today I finally manage to transfer free blog account to my own Domain
Find my blog on http://www.sumitgupta.net. There is interesting story behind Transfer, well I was planning to shift my blog from 2 months, but really doesn't get time to backup my blog and Shift it to Wordpress , but finally I manage to write code for that, yesterday. And When I transfer it to my wordpress test installation it works fine. Than I start exploring "import" function in word press...
It has inbuilt transfer module that hardly take 3 min of my life to transfer blog ..wow and people say I am one of decent programmer .
But All wells if end well ( i heard that some where ) and since I am happy to get new domain... Good bye to SUMITWORLD @ BLOGSPOT.COM its now really Sumit's WORLD at sumitgupta.NET .
See you soon at new home....
Bye from here
Sumit Gupta
Monday, September 04, 2006
Another idiotic Story
Hi,
I face a new problem now a days while surfing internet website. As I am working on opensource software now a days, I some how get to some sites, that display a Warning message when viewed through "Internet Explorer" ...
Warning is something like you are view some blah blah kind of web browsers or IE. If you are view IE than some site is not viewable as other browser can easily replicate its "USER AGENT" string and does false detection....
interesting na ...false USER AGENT for IE. hmm and what more they prefer FireFox. If I remember correctly as I use that tool myself for Firefox, will easily allow anyone to switch to popular browser User Agent ... so firefox does that wrong User agent thing not IE itself. So why Internet Explorer is punished ?
Sumit Gupta
Two Forms in ASP.Net
Hi,
As any other ASP.Net developer, I was not feeling comfortable with only one form concept that ASP.Net has (not sure about v2.0 as never work on it). Also, when you have to put something like google Search or other such service on your Site and place for such "explicit" forms are in middle of your Only "Runat Server form" how will you put the other forms ...
Well what I did is simply use IFrame, capabilities of web browsers. I simply make a HTML page of Google search, and using IFrame call that page. now since it load explicit HTML page, you don't have to worry about nested form, but simply about how it looks.
though It has a disadvantage that , on older browser your site might not be viewable, but who cares about old stuffs ... every body you should get new browser after all browser are free :)
Sumit Gupta
Sunday, September 03, 2006
Linux User authentication using PHP
Hi,
in one of my last post i try to define how linux store its password. Today I will be putting Complete PHP code for it.
Just run it on your local server(mind it your Http server must be running as root user in order to use this script )
Its a raw way of doing password matching and shouldn't be used for commerical application or servers. its purely Learning script
So here goes the script
//Script to test the Linux Password matching
function ReadUser($user)
{
$fuser=file("/etc/passwd"); //Read passwd file to match user
$UserFound = false;
while(list($index,$value) = each($fuser))
{
$userlist = explode(":",$value);
if ($userlist[0] == $user && $userlist[1] != '!!')
{
$UserFound=true;
break;
}
}
return $UserFound;
}
function MatchPassword($user,$password)
{
$fuser = file("/etc/shadow");
$UserMatch = false;
while(list($index,$value) = each ($fuser))
{
$userlist = explode(":",$value);
if ($userlist[0] == $user) {
if (strlen($userlist[1]) > 6 && CRYPT_MD5 == 1) {
$salts = explode("$","$userlist[1]");
$salt = "\$1\$".$salts[2]."\$";
$gen_password= crypt($password,$salt);
if ($gen_password == $userlist[1]) {
$UserMatch = true;
}
else
{
$UserMatch = false;
}
}
else {
$UserMatch = false;
}
break;
}
}
return $UserMatch ;
}
if (ReadUser("sumit") == true)
{
if (MatchPassword("sumit","sumit") == true )
{
echo "Login successful";
}
else
{
echo "Login unsuccessful";
}
}
?>
Hope that helps learn understanding linux passwd and shadow usage.
Sumit Gupta
Wednesday, August 30, 2006
My first use of awk command
Hi,
today I has to detect the machines IP. So I thought to make use of "awk" for it and got build this command
ifconfig eth0 | awk '/inet addr:/ {print $2}' | cut -d\: -f2
first get the ifconfig output to awk, find "inet addr:" in it (for ip version 6 use "inet6 addr" ) than cut it in piece and pick the second one
as simple as that
Sumit Gupta
Tuesday, August 29, 2006
Quality assurance
Hi,
One of my friend told me that they have a QA department in their company. I ask him what is QA ? and get this old word in new look "Quanlity Assurance". At that time I neglect that word and doesn't bother about it, as i don't know what it is. and thought why we need it.
Today, I have been asked that why I haven't check the coding pattern of developers working under me. Hmm , as a project manager and handling 15 projects at one go is it possible for me to check those things ? my answer is NO. not sure my boss love it or not( and ofcourse he will not love it).
But now its time for him to think of it. Can they get enough time to think even to check the coding, or about any such things?
Its partical problem in Small Software companies, they spend money, but on programmers only. But to make a application click we need more than just programmers
or maybe we need to re-read SDLC to know that we been a software company we need more than junior level programmers.
And also a Good programmer cannot do miracles. Software programming is Team work, Senior programmer/team leader/project manager all are good if their complete team is.
Sumit Gupta