Friday, March 25, 2011

utility for file transfer. It connects to the the FTP server, delete file, receive and put the file to the FTP server.


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.apache.log4j.Logger;

public class SandvineFTP {

private Logger logger = Logger.getLogger(SandvineFTP.class);
private static SandvineFTP sFTP;
FTPClient client = new FTPClient();
// make singleton
private SandvineFTP(){
}
public static SandvineFTP getInstance(){
if(sFTP==null)
sFTP =  new SandvineFTP();
return sFTP; 
}
// make connection with the server...
public boolean getConnection(String serverName, String uName, String pwd){
boolean result=false;
try {
client.connect(serverName);
int code = client.getReplyCode();
if(FTPReply.isPositiveCompletion(code)){
logger.info("successfully connected to remote server");
System.out.println("Connected to Server ... Code ::: "+ code);
}
result = client.login(uName,pwd);
}
catch(Exception e){
logger.error("Error ::: " + e.getMessage(),e);
e.printStackTrace();
}
return result;
}
// close connection
public void closeConnection(){
try {
client.disconnect();
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error("Disconnect Error ::: " + e.getMessage(),e);
e.printStackTrace();
}
}
// list all files
public List listAllFiles(){
try {
FTPFile[] ftpFile = client.listFiles();
List fileNames = new ArrayList();
System.out.println(fileNames.size());
for(FTPFile file : ftpFile){
fileNames.add(file.getName());
}
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error("List Error ::: " + e.getMessage(),e);
e.printStackTrace();
}
return null;
}
// change the working directory
public boolean changeWorkingDirectory(String dirName){
boolean result = false;
try {
result = client.changeWorkingDirectory(dirName);
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error("Change Directory Error ::: " + e.getMessage(),e);
e.printStackTrace();
}
return result;
}
// delete the file
public String getCurrentWorkingDirectory(){
try {
return client.printWorkingDirectory();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
// put the file
public boolean putFile(String completePath){
boolean result = false;
try {
client.setFileType(FTP.ASCII_FILE_TYPE);
File f = new File(completePath);
if(f.exists()){
result = client.storeFile(f.getName(), new FileInputStream(f));
}
else
{
logger.info("File does not exist");
System.out.println("file does not exist");
}
}catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("File Transfer Error ::: " + e.getMessage(),e);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("File Transfer Error ::: " + e.getMessage(),e);
}
return result;
}
// receive the file
public InputStream getFile(String fileName){
InputStream iStream=null;
try {
client.setFileType(FTP.ASCII_FILE_TYPE);
iStream = client.retrieveFileStream(fileName);
// iStream.close();
System.out.println("File Transfer Successfull");
}catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("File Transfer Error ::: " + e.getMessage(),e);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("File Transfer Error ::: " + e.getMessage(),e);
}
return iStream;
}
public boolean deleteFile(String fileName){
boolean result=false;
try {
result = client.deleteFile(fileName);
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error("File Transfer Error ::: " + e.getMessage(),e);
e.printStackTrace();
}
return result;
}
}

Wednesday, March 2, 2011

What is the difference between http and https

Don't know how many of you are aware of this difference, but it is worth sending to those that may not.

The main difference between http:/// <http:///> and https:// is it's all about keeping you secure. HTTP stands for Hyper Text Transfer Protocol.

The S (big surprise) stands for "Secure". If you visit a Website or webpage, and look at the address in the web browser, it will likely begin with the following: http://. <http://./> 

This means that the website is talking to your browser using the regular 'unsecure' language. In other words, it is possible for someone to "eavesdrop" on your computer's conversation with the Website. If you fill out a form on the website, someone might see the information you send to that site.


This is why you never ever enter your credit card number in an Http website ! But, if the web address begins with https://, <https://,/> that basically means your computer is talking to the website in a Secure code that no one can eavesdrop on.
If a website ever asks you to enter your credit card Information, you should automatically look to see if the web address begins with https://.

If it doesn't, you should NEVER enter sensitive information such as a credit card number.

Sunday, December 19, 2010

LOCK FOLDER WITHOUT ANY SOFTWARE


To do this just follow the steps given below
1. Suppose you want to lock the folder "games" in d: which has the path D:\Games.

2. In the same drive create a text file and type 
ren games games.{21EC2020-3AEA-1069-A2DD-08002B30309D}

3. Now save this text file as loc.bat

4. create another text file and type in it
ren games.{21EC2020-3AEA-1069-A2DD-08002B30309D} games

5. Now save this text file as key.bat

6. Now you can see 2 batch files loc and key.

7. Now press loc file and the folder games will change to control panel and you cannot view its contents. Press key file and you will get back your original folder.

Best social networking sites

Today my post will be on Top "Best social networking sites"Social networking sites are doing more than one another to get on the top


Here is the list of some Popular and well know social networking sites and information on them:


Facebook 
With Facebook officially turning five years old recently, combined with the site surging past MySpace in Monthly Unique Visitors, it seems like a good time to take a little deeper look at the social networking giants.

It’s hard to believe that last year around this time we discussing the effects of bad PR for Facebook and if the site had ‘jumped the shark,’ but those arguments now seem to more appropriately apply to other properties.Facebook has now became the largest social networking site in 2009.Ranked at number 4th spot according to Alexa
Orkut:
A social networking site sponsored by Google and named after Google developer Orkut Buyukkokten. Launched in early 2004, Orkut was originally an invitation-only site, but was later opened to the general public. Membership exceeded 40 million users within two years.For some reason the graph of orkut has gone down in 2009
Myspace:
MySpace ( myspace.com) is an online social networking service, allowing users to share messages, interests and photos with a growing body of friends. Users can send emails, post videos, listen to music, and write blogs; the site also includes classified ads and posting of events. Currently one of the top ten Internet sites, MySpace was founded in July 2003 by Tom Anderson and Chris DeWolfe.Its Alexa ranking is 11
Twitter:
A Web site and service that lets users send short text messages up to 140 characters in length from their cellphones to a group of people. Launched in 2006, Twitter www.twitter.com) was designed to keep friends and colleagues informed about one's daily activities.Its alexa rank is"40"
Flixster:
Flixster is a social networking site for movie fans. Users can create their own profiles, invite friends, rate movies and actors, and post movie reviews as well.
Linkedin:
With more than 30 million users representing 150 industries around the world, LinkedIn is a fast-growing professional networking site that allows members to create business contacts, search for jobs, and find potential clients.
Hi5:
hi5, was launched in 2003 and is now one of the world’s largest social networks — ranked by Alexa® as a top 34 website globally and the #1 social network in more than 25 countries across Latin America, Europe, Asia and Africa. hi5 is also the #1 social network for the world’s Spanish-language population.

A year ago, we ranked the top 25 social networking sites by monthly visits, and I was curious to see how the positions would change if we re-ranked those same sites with the most recent figures
Top 25 social networking sites

Some key metrics in the health of a social network revolve around the activity of the user base – visits per unique visitor and time on site. While Facebook has excelled in both areas, MySpace has remained flat or fallen off, with new hot property Twitter climbing the ranks.
Some key metrics in the health of a social network revolve around the activity of the user base – visits per unique visitor and time on site. While Facebook has excelled in both areas, MySpace has remained flat or fallen off, with new hot property Twitter climbing the ranks.
Sessions per month


Some key metrics in the health of a social network revolve around the activity of the user base – visits per unique visitor and time on site. While Facebook has excelled in both areas, MySpace has remained flat or fallen off, with new hot property Twitter climbing the ranks.
 

Nokia cell phone hacking codes


These 3 codes work on 90% of Nokia phones;




*#06#=Display the IMEI (Standard GSM command, works on all phones)
*#0000#=Display the firmware version and date


*#92702689#=Here you can view the S/N and the IMEI as well as the life timer (newer models). The date the phone left the factory and the date it was purchased. If your phone has been repaired the date of the repair is also visible. You will need to turn the phone off to exit this menu. Newer phones simply require you to press ok.

The following codes are specific to older series 40 phones; (Entering the following codes will restart the phone)
*4720#=Activates Half Rate, Half Rate is 5.6kbit/s and uses half the bandwidth at the cost of call quality. Network operators often activate half rate on overloaded towers during peak times to save costs.#4720#=Deactivates Half Rate*3370#=Activates Enhanced Full Rate, EFT attempts to match wire quality. The calls are 12.2kbit/s and are not supported by all operators. It is compatibale with the hightest AMR mode.#3370#=Deactivates Enhanced Full Rate*#746085685#=Display the SIM clock status

The following codes are phone specific or phase related;
*#7220#=Activate the GPRS PCCCH support (Packet Common Control Channel)*#7230#=Deactivate the GPRS PCCCH support*#7760#=Display the manufacturing serial number

This only works on the 3310 and 3330;
*#67705646#=Clear the operator logo, the logo will be reset to the default network operator logo.

The following codes work on newer series 40 & series 60/80 phones;
*#2820#=Display the Bluetooth MAC address (Phone must have a built in bluetooth adapter)*#7370925538#=Reset the mobile wallet (Phone must have the mobile wallet feature)*#7370#=Soft-format the memory (Symbian)*#7780#=Reset to factory defaults, confirmation required (also known has a Hard-format), all phone contents will be wiped clean 

Thursday, December 16, 2010

Sony bringing official PlayStation app to iPhone and Android


Over in Europe, PlayStation fans are getting a treat in the form of mobile apps for iPhone and Android. No, the app won't turn your phone into a PSP, but it does sync up with your PlayStation Network account, which allows you to check trophies and see which of your friends are online. It also loads up announcements about new PlayStation titles. Predictably, there's also social networking, so you can do some volunteer Facebook and Twitter advertising for games you like.

The catch: this app doesn't have a US release date yet. In fact, only the UK, France, Germany, Spain, Italy and the Netherlands will get it at launch. On the plus side, the app is free, and an upcoming version will let you comment on the PlayStation blog. 

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Sweet Tomatoes Printable Coupons
Increase traffic