Why make Wi-Fi network secure?
While investigating the recent bomb blasts in India, it was uncovered that terrorists of “Indian Mujahideen” used unsecured Wi-Fi networks to communicate with each other and planning there bomb blasts. Its very easy to blame Police and Government for their lack of vigilance, but it take character to acknowledge the fact even we are responsible for it. You, me and everyone who has an unsecured wifi network is or could be responsible for the blasts. So as one my duties as a citizen of India, I am explaining what is wifi network and how to make secure.
What is a Wi-Fi network?
Any computer network, which connects two more more wifi devices via a wifi router is termed as wifi network. In simple words, if you connect to internet via wifi router, then it simple means you are connected via a wifi network. It can be home, work or even a coffee shop.
How to make your Wi-Fi network secured?
- Password protect your Wi-Fi Router Setup Wizard:
- All router comes with an inbuilt setup wizard. All you have to do is type the Router IP in your browser. Commonly used IP by Routers is: http://192.168.8.1 You will see all sorts of settings and options in this wizard. However, you may be asked to authenticate via a username and password. Chances are by default there would be no password or a default (admin/admin) password setup by the manufacturer. So the very first step is to make sure this Router setup wizard or interface is password protected with a strong password. You can use strongpasswordgenerator or goodpassword to get yourself a very strong password.
- Disable SSID broadcasting.
- SSID or Service Set IDentifier, is responsible to display the name of your wifi network when ever a device scans for available networks. I would recommend you disable this feature after you are connected to all your wifi devices, or else you will go in the hidden mode and even your own devices will fail to connect to your router.
- Enable WPA or WEP encryption.
- In order to enable it, login to your router setup wizard. You can find this option user “Security” or “WAN Setup”. They both have same basic role, that is to authenticate every device when it tries to connect to the wifi router. However there is a functional difference between WPA and WEP security algorithm.
- WEP (Wired Equivalent Privacy): It would generate 4 password, and your devices needs to enter anyone of those during handshake. It is recommended for your normal office or work security.
- WPA-PSK (Wi-Fi Protected Access Pre-Shared Key): It would generate a single password, which can be configured to expire after some predefined duration. It is good option for people who use internet for short periods only.
- Define maximum number of devices:
- This options comes into play when you know how many devices normally connect to the router. You can set the maximum limit, so that once all of the devices are connected and operational, no one else can connect to the wifi network.
- Unshare the shared folder/drives:
- When not is use, it is recommended that you unshare all the folder/shared whenever not in use. Otherwise, they may be used to store and run Trojan / Virus.
- Turn off the router when not in use:
- This will not only save you power, but make it virtually impossible for a hacker to use your internet conenction.
Please note, a serious hacker would not actually be deterred by all these measures, but it will make it hard for a novice hacker. If you have any query or need any consultancy to secure your wifi network secure, feel free to contact me via email or IM.
This is one of my favorites, love the melody. Here is small trivia: this song was originally released on a limited edition EP called Extra Credit as a demo in 2005 to promote his second studio album Mr. A-Z. The single was made available on iTunes, Zune Marketplace and Amazon.com on February 12, 2008 and entered Top 40 on iTunes Chart recently reaching number 2. Click here for more info about this song.
Chords for “Jason Mraz - I’m Yours”:
Intro Chords: A E F#m D (2x)
Intro Tabs:
Intro:
Guitar 1 (playing lead melody)
|--------------------------------------|------------------------------------|---------|
|--------------------------------------|------------------------------------|---------|
|-11/13-11~~11/13-11~~11/13-----8/9----|-11/13-11~~11/13-11~~11/13--|-8/9-8-9~|
|---------------------------13~~----9~~|---------------------------13~---|---------|
|--------------------------------------|------------------------------------|---------|
|--------------------------------------|-------------------------------------|---------|
A
Well uh you dawned on me and you bet I felt it,
E
I tried to be chill but you’re so hot that I melted,
F#m
I fell right through the cracks,
D
And now I’m tryin to get back….
A
Before the cool dun run out, Ill be givin it my bestest
E
Nothin’s gonna stop me but divine intervention
F#m
I reckon its again my turn,
D D7*
To Win some or learn some….
CHORUS:
A E
But I wont hesitate
F#m
No more, No more
D D7* A—E—F#m—D—-D7*
It can not wait; I’m Yours
2nd Verse:
A E
Well open up your mind and see like me
F#m
open up your plans & then your free
D
look into your heart and you’ll find love love love
A E
Listen to the music of the moment come and sing/dance with me
F#m
I like happy melodies/family
D D7*
its a guide forsake their right to be loved loved loved loved loved
(Do the chord pattern)
so i won’t hesitate no more
no more it cannot wait i’m sure
theres no need to complicate
our time is short
this is our fate, i’m yours
i been spending way too long checking my tongue in the mirror
and bendin over backwards just to try to see it clearer
my breath fogged up the glass
so i drew a new face and laughed
i guess what i’m sayin is there ain’t no better reason
to rid yourself of vanity and just go with the seasons
its what we aim to do
our name is our virtue
i won’t hesitate no more
no more it cannot wait i’m sure
theres no need to complicate
our time is short
it cannot wait, i’m yours
Lyrics of “Jason Mraz - I’m Yours”:
Well ah you dawned on me and you bet I felt it
I tried to be chill but you're so hot that I melted
I fell right through the cracks
And now I'm trying to get back
Before the cool done run out
I'll be giving it my bestest
Nothing's going to stop me but divine intervention
I reckon it's again my turn to win some or learn some
But I won't hesitate no more, no more
It cannot wait, I'm yours
Well open up your mind and see like me
Open up your plans and damn you're free
Look into your heart and you'll find love love love
Listen to the music of the moment people dance and sing
Were just one big family
It's our god-forsaken right to be loved loved loved loved loved
So I won't hesitate no more, no more
It cannot wait I'm sure
There's no need to complicate
Our time is short
This is our fate, I'm yours
[Scat]
Do you want to come on, and scoot/schooch
On closer dear, and I will nibble your ear
Oh oh oh
I've been spending way too long checking my tongue in the mirror
And bending over backwards just to try to see it clearer
But my breath fogged up the glass
And so I drew a new face and laughed
I guess what I be sayin is there ain't no better reason
To rid yourself of vanities and just go with the seasons
It's what we aim to do
Our name is our virtue
But I won't hesitate no more, no more
It cannot wait I'm sure
There's no need to complicate
Our time is short
This is our fate, I'm yours
Well open up your mind and see like me
Open up your plans and damn you're free
Look into your heart and you'll find the sky is yours
So please don't, please don't, please don't
There's no need to complicate
Cause our time is short
This oh, this oh, this is our fate, I'm yours
So I won't hesatate no more, no more
It cannot wait I'm sure
There's no need to complicate
Our time is short
This is our fate, I'm yours
Please don't hesatate no more, no more
It cannot wait I'm sure
There's no need to complicate
Our time is short
This is our fate, I'm yours

30 September 2008 – 9:21 AM
Have you ever noticed that no matter how good your PC’s configuration is, it tends to get slower as the time passes by? Ever wondered why does this happen and how to fix? Well this is what I am going to explain and give you tips and tricks to fix it.
- Uninstall all the unused/unwanted programs.
- Reason: Windows OS is based on the registry system. In simple words, what ever you install or any changes you make are stored in the Windows Registry and each time you start using your windows, it has to check the registry for installed programs and/or settings. So the more programs and software you install, the slower your PC (Computer System) will become.
- Solution: Install only the programs/software which you frequently use. You can install software which you use once in a blue moon. Trust me, this will make a significant difference in the PC’s performance. Go ahead and uninstall all the programs you don’t use or use seldom. You can use a free third party utility CCleaner to clean unwanted cookies, broken registry entries, tempary files.
- Disable the visual effects (eye candy).
- Reason: Windows Xp onwards, Microsoft has implemented some need visual effect to take the user experience closed to that of a Mac. In the process, they made it very taxing on RAM and Processor. In Simple words, the more visual effects you enable, the slower your PC (Computer System) will become.
- Solution: If you are willing to compromise the eye candy effects for performance then this is what you do:
- Right Click “My Computer” icon and click on properties.
- Go to Advanced Tab and click on Setting button of “Performance”
- Select the tab “Select for best performance” and press “apply”
- Scan for Virus, Spywares and Trojans.
- Reason: Most of the time, an infected system is the reason of a painfully slow or crashing system, Make sure you have a lightweight Antivirus and Antispyware software installed. Not to mention, that software should be updated regularly too.
- Solution: Please view “How to clean an infected PC” for more details.
- Defrag your hard drive .
- Reason: Fragmentation is caused when an operating system breaks a file into pieces because there is not enough space on the storage device where the file was originally saved. Hence, defragmentation can be defines as the process of scanning the file system and rejoining the split files back into consecutive pieces. Windows OS comes with an inbuilt utility, but if you want you could use third party software to defrag for hard drives.
- Solution: This is you to use the inbuilt defag utility:
- Open “My Computers”. Right click any hard drive icon and go to properties.
- Now under “Tools” tab, click “Defragment now” button.
- Make sure you do NOT use your computer which the defragment process is in progress.
- Remove unwanted start up programs:
- Reason: As soon as you start your Windows, there are many programs and background processes which turns on automatically. Most of them are unwanted and makes the PC slow. Simple words you should have minimum amount of icons in the bottom right corner of your PC.
- Solution: Please disable only those programs or services which you are sure of. This step is not for novice users. This is how you disable unwanted start up programs:
- Go to “Start” and click on “Run”
- Type “msconfig” and press OK button.
- From the popup window, select “start up” tab.
- Now you will have a list of all the programs which starts automatically with Windows. Just uncheck the items to disable them. You need not to worry no much, you can always “undo” this step by re checking the items again.
- You are also use an addition utility “Autoruns” by Windows to do the same.

25 September 2008 – 7:17 PM
In my opinion, developing a Web based application in JSP (Java) is more or less like killing a housefly with a bazooka. Of course you will hit your target, no one is denying that, but you will also have collateral damage along with it. This damage ranges from Cost of hardware, hosting, servers and development. Not to mention the time taken to develop, edit or modify the application.
But, that’s just me, I’ll let you to decide and let me know after going through these factors.
|
SNO
|
Function / Feature
|
JSP
|
PHP
|
|
1.
|
Programming Approach
|
1. Completely Object Oriented
Advantage:
· Clean code
Disadvantage:
· Way too descriptive
|
1. Mainly a Scripting Language
2. It can also be used in OOPS from PHP 5 and above.
Advantage:
· Functional and quick coding, you can use OOP practices at your convenience
Disadvantage:
· May get clumsy
|
|
2.
|
String and data manipulation
|
Rich library, too much descriptive and object oriented code
|
Rich functionality. Functional and easy coding.
Has inbuilt support to use third party libraries from other programming languages like Java, C and Dot.net
|
|
3.
|
Web Oriented features
- Includes
- Mails
- File Uploads
- Form Handling
- Sessions
|
Advantage:
· Almost everything is built in or supported by libraries.
Disadvantage:
· Complicated and way too much of code.
|
Advantages:
· Inbuilt functionality and easy to use functions, written for the specific tasks
· Reduces the lines of code and time taken to write an application.
|
|
4.
|
Database Access features
|
Standard JDBC structure/ Use EJB/ Struts framework built over JDBC. Descriptive and too much overhead or boiler plate code involved. Uses the same API for all databases using JDBC drivers
|
Dedicated inbuilt libraries for most of the commonly used databases. Very tight integration with Oracle, MySQL and PostGRE SQL. Very minimal boiler plate code required. The libraries and results are straight forward, robust and easy to use.
|
|
5.
|
XML/XSL/XPATH
|
Use standard SAX/DOM parsers. Too much boiler plate code involved. Well defined APIs and stable implementations are available for XSL and XPATH
|
SAX and DOM parsers available are easy to use and to the point. Another library, Simple XML provides very easy OO approach to handling XML data. XSL and XPATH functionality is also built in.
|
|
6.
|
Extensibility
|
Java Classes and Libraries. Run’s in sandbox and hard JNI approach needed to integrate with server programs.
|
PHP/C/Any thing executable by the underlying OS platform. Can very easily interact with programs on the server. Very good support for native code.
|
|
7.
|
Dynamic Graphics/PDF and bells and whistles
|
Almost everything has a readymade library
|
Supported internally or though libraries.
|
|
8.
|
Web Services/SOAP
|
Addon Libraries like Axis, JAX-WS, etc.
|
In Built
|
|
9.
|
Portals
|
Spec JSR-168 and 286
|
Many different Portal frameworks
|
|
10.
|
Learning curve
|
It helps if you have an decent understanding of JAVA and its architecture.
|
If you know C/C++, then you are halfway through to learn PHP.
|
|
11.
|
Support
|
It has support and backing of Industry giants like Sun and IBM.
|
It enjoys the backing of Oracle, Sun, IBM, Microsoft and Zend.
|
|
12.
|
Hardware cost and requirement.
|
Well this is one factor which makes PHP a favourite. The cost of procuring a server is exponentially higher than that of getting PHP server up and running.
|
Cost of hosting a small and medium scale PHP application start from as low as $9 per month.
For a decent enterprise level application server with an enterprise PHP framework, the cost would come out to be around $50 per month.
|
Sample Codes for comparison
1. Hello World
|
JSP
|
PHP
|
|
<html>
<head>
<title>JSP — Hello World!</title>
</head>
<body>
<% out.println(” Hello World”); %> !
</body>
</html>
|
<html>
<head>
<title>PHP — Hello World!</title>
</head>
<body>
<?php echo ”Hello World”; ?>
</body>
</html>
|
2. Print Date as DD/MM/YYYY
|
JSP
|
PHP
|
|
<html>
<head>
<title>JSP – Print date</title>
</head>
<body>
<%
java.util.Calendar cal =java.util.Calendar.getInstance();
out.println(
new SimpleDateFormat(“dd/MM/yyyy).format(cal.getTime()?)
);
%>
</body>
</html>
|
<html>
<head>
<title>PHP – Print Date</title>
</head>
<body>
<?php echo date(“d/m/Y”); ?>
</body>
</html>
|
3. Read / Write session variable
|
JSP
|
PHP
|
|
<html>
<head>
<title>JSP – Session Read/Write</title>
</head>
<body>
<%
//Get current session or create a new session
HtppSession session = request.getSession(true);
//Add information to the session
session.setAttribute(“name”, “Pramati”);
//Print the information
out.println(session.getAttribute(“name”);
%>
</body>
</html>
|
<html>
<head>
<title>PHP – Session Read/Write</title>
</head>
<body>
<?php
//Get current session or create a new session
session_start();
//Add information to the session
$_SESSION['name']= “Pramati”;
//Print the information
echo $_SESSION['name'];
?>
</body>
</html>
|
4.
a. File Uploading - Form
|
JSP
|
PHP
|
|
<html>
<head>
<title>JSP – File upload form</title>
</head>
<body>
<form action=”ProcessFileUpload.jsp” method=”post” enctype=”multipart/form-data”>
File 1:<input type=”file” name=”file1″/>
<br/>
<input type=”submit” name=”Submit” value=”Upload File”/>
</form>
</body>
</html>
Please Note: No in-built support for file uploading in JSP. You have to rely on external libraries. This example uses Apache’s commons-upload lib.
|
<html>
<head>
<title>PHP – File upload form</title>
</head>
<body>
<form action=”ProcessFileUpload.php” method=”post” enctype=”multipart/form-data”>
File 1:<input type=”file” name=”file1″/>
<br/>
<input type=”submit” name=”Submit” value=”Upload File”/>
</form>
</body>
</html>
|
4.
b. File Uploading – Backend Code
|
JSP
|
PHP
|
|
Code for ProcessFileUpload.jsp
<%
if(ServletFileUpload.isMultipartContent(request))?
{
FileItemFactory f = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(f);
List items = upload.parseRequest(request);
Iterator itemsIter = items.getIterator();
if(iter.hasNext())?
{
File uploadedFile = new File(item.getName());
item.write(uploadedFile);
}
}
%>
Please Note: No in-built support for file uploading in JSP. You have to rely on external libraries. This example uses Apache’s commons-upload lib.
|
Code for ProcessFileUpload.php
<?php
if ($_FILES["file"]["error"] > 0)?
{
echo “Error: ” . $_FILES["file"]["error"];
}
else
{
move_uploaded_file(
$_FILES["file"]["tmp_name"],
“upload/” . $_FILES["file"]["name"]);
}
?>
|
5. Connect to the Database (MySql)
|
JSP
|
PHP
|
|
<%@ page import=”java.sql.*” %>
<%
Connetion conn = null;
java.sql.Connection conn= null;
Statement st = null;
ResultSet rs = null;
try {
Class.forName(”com.mysql.jdbc.Driver”).newInstance();
Class.forName(”org.gjt.mm.mysql.Driver”).newInstance();
conn = DriverManager.getConnection( “jdbc:mysql://localhost/jsp?user=xxx&password=xxx”);
st = conn.createStatement();
// connection made….
}
|
<?php
$dbserver=”locations”;
$username=”username”;
$password=”password”;
$database=”your_database”;
mysql_connect($dbserver,$username,$password);
@mysql_select_db($database) or die( “Unable to select database”);
//connection made…
?>
|
25 September 2008 – 3:39 PM
JavaScript has come a long way from being used just as Client Side Form Validator to becoming the backbone of Web 2.0 rich web applications. In the current scenario, every web developer have to learn JavaScript as there is hardly any Web 2.0 application which does not implement JavaScript.
In my opinion followings are the most common errors/mistakes made during JavaScript implementation.
- Calling JavaScript Code without any event:This is the first error any JavaScript developer is bound to make. Allow me to illustrate it with a real life example. Suppose, we need to alert the content inside a div with id “content”. The novice developer would write:
-
<html>
-
<head>
-
<title>Invalid JavaScript Code</title>
-
<script type="text/javascript" language="javascript">
-
var content=document.getElementById(‘content’).innerHTML;
-
alert(content);
-
</script>
-
</head>
-
<body>
-
<div id="content">This is the sample content</div>
-
</body>
-
</html>
Needless to say, the above code will throw an error. The technical explanation of the error is as follows. As JavaScript is an interpreted scripting language, it would try to read the content on the line 6. However, at that moment, the HTML had not been rendered and hence JavaScript will find no div. Its solution is very simple and elementary. All you have to do is to call this code on some event, like onload , onclick etc. Following is the correct way to do it:
-
<html>
-
<head>
-
<title>Valid JavaScript Code</title>
-
<script type="text/javascript" language="javascript">
-
function init(){
-
var content=document.getElementById(‘content’).innerHTML;
-
alert(content);
-
}
-
</script>
-
</head>
-
<body onload="init()">
-
<div id="content">This is the sample content</div>
-
</body>
-
</html>
- Reading string as array:Well, once I committed this mistake and spent over 2 days to find this issue from 102 lines of JavaScript. Suppose you need to read and display the 3rd character of a string. any C or PHP developer is bound to write the code like this:
-
<html>
-
<head>
-
<title>Invalid JavaScript Code</title>
-
<script type="text/javascript" language="javascript">
-
function readString(){
-
var str="JavaScript";
-
alert(str[2]);
-
}
-
</script>
-
</head>
-
<body>
-
<input type="button" onclick="readString();" />
-
</body>
-
</html>
Quite interestingly, the above code if alert “v” in Firefox or Mozilla. On few Internet Explorers it will throw an error. The reason is that reading string as an array (str[2]) is not an cross browser compatible. The correct way code is as follows:
-
<html>
-
<head>
-
<title>Valid JavaScript Code</title>
-
<script type="text/javascript" language="javascript">
-
function readString(){
-
var str="JavaScript";
-
alert(str.charAt(2));
-
}
-
</script>
-
</head>
-
<body>
-
<input type="button" onclick="readString();" />
-
</body>
-
</html>
- Validating for an blank field in JavaScript:This is one of the most common bug your quality analyst or client would let you know. When you are validating a blank field (say username). Most of the JavaScript developers would write the following code to validate it:
-
<html>
-
<head>
-
<title>Valid JavaScript Code</title>
-
<script type="text/javascript" language="javascript">
-
function validate(){
-
var value=document.getElementById(‘uname’).value;
-
if(value.length<1) {
-
alert("ERROR: Username cannot be left blank");
-
return false;
-
}
-
}
-
</script>
-
</head>
-
<body onload="init()">
-
Username: <input type="text" id="uname">
-
<input type="button" onclick="validate()" />
-
</body>
-
</html>
Although the above code may seems to work, but it fails as soon as you enter any invisible character like space, newline/enter or a tab. The check is that the length of the string entered should not be less than 1 (in this case). What the developer has failed to negotiate that three invisible characters like spaces would count 3 but would be invalid. The solution is simple. Trim (similar to one in PHP) the value before applying this check. Unfortunately, there is no inbuilt function to trim a string. However you can use it from my free library rochak.js as used in the following example.
-
<html>
-
<head>
-
<title>Valid JavaScript Code</title>
-
<script type="text/javascript" language="javascript" src="http://rochakchauhan.com/rochak.js"></script>
-
<script type="text/javascript" language="javascript">
-
function validate(){
-
var value=document.getElementById(‘uname’).value;
-
value=rochak.trim(value);
-
if(value.length<1) {
-
alert("ERROR: Username cannot be left blank");
-
return false;
-
}
-
}
-
</script>
-
</head>
-
<body onload="init()">
-
Username: <input type="text" id="uname">
-
<input type="button" onclick="validate()" />
-
</body>
-
</html>