Wednesday, January 28, 2009

How to Install Windows TeamSpeak Server

Step by Step Procedure to Install Windows TeamSpeak Server
  1. Go to http://www.goteamspeak.com.
  2. Image:Downloads_17.JPGClick on Downloads on the left side of the screen.
  3. Here you will see a list of different versions of TeamSpeak Client and Server.
    1. Find the Windows downloads section.
    2. Find the TeamSpeak 2 Server.
    3. Click on either Site 1 or Site 2 to begin downloading.
  4. Read the TeamSpeak End User License Agreement.
  5. Click 'I AGREE' at the bottom of the page to continue.
  6. Click Run when prompted with the next two screens.
  7. When asked if you would like to install TeamSpeak 2 Server, click 'Yes.'
  8. The setup wizard will be displayed, click 'Next' to continue.
  9. The License Agreement screen will be shown.
  10. Select 'I accept the agreement' and click 'Next.'
  11. You will then be prompted to select a folder directory to install the server in
  12. Select a folder to install the application in, and click 'Next'.
    • For most users, the default location is recommended.
  13. You will then be prompted to select a folder to put the shortcuts in and then click 'Next' to continue.
    • For most users, the default location is recommended.
  14. The wizard will then ask if you would like to create an icon on the desktop.
    • If you would like to create an icon on the desktop, leave Create a desktop icon checked and click Next.
    • If you would like to not create an icon on the desktop, uncheck Create a desktop icon and click Next.
  15. Click Install to begin the install process.
  16. Read the information about TeamSpeak Server and click Next.
  17. The setup wizard will then be finished.
    • If you would like to launch TeamSpeak right away, Click Finish.
    • If you don’t want to launch TeamSpeak right away, uncheck Launch TeamSpeak 2 Server, Click Finish.
  18. TeamSpeak Server is now installed on your machine.
    • If you selected to launch TeamSpeak, you will see an icon running in the lower right bottom of your screen.

Explode function to divide string

This will show explode function .
it will divide the string into number of chunks


$someWords = "Please don't blow me to pieces.";

$wordChunks = explode(" ", $someWords);
for($i = 0; $i < count($wordChunks); $i++){ echo "Piece $i = $wordChunks[$i]
";
}

$wordChunksLimited = explode(" ", $someWords, 4);
for($i = 0; $i < count($wordChunksLimited); $i++){ echo "Limited Piece $i = $wordChunksLimited[$i]
";
}

File copy from one directory in Perl

It will copy file from one directory to other directory

it will copy file from its current directory to HTML directory


#!/usr/bin/perl
use File::Copy;

print "content-type: text/html \n\n"; #The header
$filetobecopied = "myhtml.html.";
$newfile = "html/myhtml.html.";

copy($filetobecopied, $newfile) or die "File cannot be copied.";

fetch data using Select query in perl

Here is code to fetch the data from database and display it with loop

#!/usr/bin/perl

use Mysql;

print "Content-type: text/html \n\n";

# MYSQL CONFIG VARIABLES
$host = "localhost";
$database = "store";
$tablename = "inventory";
$user = "username";
$pw = "password";

# PERL MYSQL CONNECT()
$connect = Mysql->connect($host, $database, $user, $pw);

# SELECT DB
$connect->selectdb($database);

# DEFINE A MySQL QUERY
$myquery = "SELECT * FROM $tablename";

# EXECUTE THE QUERY FUNCTION
$execute = $connect->query($myquery);

# HTML TABLE
print "


";

# FETCHROW ARRAY

while (@results = $execute->fetchrow()) {
print "";
}

print "
idproductquantity
"
.$results[0]."
"
.$results[1]."
"
.$results[2]."
";

Saturday, January 24, 2009

White Paper

Application DoS attacks exploit flaws in the bespoke application design and implementation to
prevent legitimate access to the victim’s services. They represent a subset of potential attacks
on such applications, as they are aimed specifically at disrupting operation rather than
subverting the application controls.
Attacks based on exploiting these flaws can offer the attacker a number of advantages over
traditional DoS attacks:
• The attacks will typically not be detectable or preventable by existing security
monitoring solutions1 – Since the attacks do not consume an unreasonable amount of
bandwidth and could, in many cases, be indistinguishable from normal traffic.
• Application attacks are more efficient – The attacker may not need as much resource at
their disposal to successfully complete the attack. Application level attacks target
bottlenecks and resources limitations within the application and do not require many
compromised “zombie” systems or a large amount of bandwidth. Furthermore, they
can be targeted at the weakest link in an environment – for example if a web-farm of a
hundred servers relies on a single back-office host to authenticate users, an application
attack may be able to directly target it.
• Application attacks are harder to trace – Application level attacks normally use HTTP or
HTTPS as their transport. Proxy servers can therefore be used to obfuscate the true
origin of the attacker; and many are available for an attacker to redirect his malicious
traffic. Many of these proxy servers do not keep logs of connection attempts and could
therefore successfully hide the true origin of the attacking host.

Socket Programming in Asp.net

//Server Code
using System;
using System.Net.Sockets;
using System.IO ;
public class Echoserver
{
public static void Main()
{
//TcpListener is listening on the given port... {
TcpListener tcpListener = new TcpListener(1234);
tcpListener.Start();
Console.WriteLine("Server Started") ;

Socket socketForClient = tcpListener.AcceptSocket();
try
{
if (socketForClient.Connected)
{
while(true)
{
NetworkStream networkStream = new NetworkStream(socketForClient);
StreamWriter streamWriter = new StreamWriter(networkStream);
StreamReader streamReader = new StreamReader(networkStream);
string line = streamReader.ReadLine();
Console.WriteLine("Read:" +line);
line=line.ToUpper()+ "!";
streamWriter.WriteLine(line);
streamWriter.Flush() ;
}
}
socketForClient.Close();
Console.WriteLine("Exiting...");
}
catch(Exception e)
{
Console.WriteLine(e.ToString()) ;
}
}
}
//Client Code
using System;
using System.Net.Sockets;
using System.Windows.Forms;
using System.IO ;
using System.ComponentModel ;
using System.Drawing;
public class Echoclient: Form
{
private Button b1;
private TextBox t1,ta;
TcpClient myclient;
private NetworkStream networkStream ;
private StreamReader streamReader ;
private StreamWriter streamWriter ;
public Echoclient()
{
InitializeComponent();
}
public static void Main()
{
Echoclient df=new Echoclient();
df.FormBorderStyle=FormBorderStyle.Fixed3D;
Application.Run(df);
}
public void InitializeComponent()
{

this.Closing+= new CancelEventHandler(form1_closing) ;
//connect to the "localhost" at the give port
//if you have some other server name then you can use that instead of "localhost"
try
{
myclient = new TcpClient("localhost", 1234);
}
catch
{
Console.WriteLine("Failed to connect to server at {0}:999", "localhost");
return;
}
//get a Network stream from the server
networkStream = myclient.GetStream();
streamReader = new StreamReader(networkStream);
streamWriter = new StreamWriter(networkStream);
}

//User can enter a text in the textbox and on click of the button the message will be sent to the server..
//then the Client waits and receives the response from the server which is displayed in the textarea..
private void b1_Click(object sender, EventArgs e)
{
ta.Text="" ;
if(t1.Text=="")
{
MessageBox.Show("Please enter something in the textbox");
t1.Focus();
return ;
}
try
{
string s;
streamWriter.WriteLine(t1.Text);
Console.WriteLine("Sending Message");
streamWriter.Flush();
s= streamReader.ReadLine();
Console.WriteLine("Reading Message") ;
Console.WriteLine(s) ;
ta.Text=s;
}
catch(Exception ee)
{
Console.WriteLine("Exception reading from Server:"+ee .ToString());
}
}

}

File Handling in Asp.net

using System.IO;

private void button2_Click(object sender, System.EventArgs e)
{
TextReader tr = new StreamReader("c:/t.txt");

string s = tr.ReadLine();

while(s != null)
{
s = tr.ReadLine();
this.textBox2.Text += s + "\n";
}

tr.Close();
}

Wednesday, January 21, 2009

Auto Refresh in Asp.net

This will cause the page to be refreshed automatically after 2 min. interval
write following in HTML

" meta equiv="REFRESH" content="120" "

Quantum Teleportation

Teleportation is the name given by science fiction writers to the feat of making an object or person disintegrate in one place while a perfect replica appears somewhere else. How this is accomplished is usually not explained in detail, but the general idea seems to be that the original object is scanned in such a way as to extract all the information from it, then this information is transmitted to the receiving location and used to construct the replica, not necessarily from the actual material of the original, but perhaps from atoms of the same kinds, arranged in exactly the same pattern as the original. A teleportation machine would be like a fax machine, except that it would work on 3-dimensional objects as well as documents, it would produce an exact copy rather than an approximate facsimile, and it would destroy the original in the process of scanning it. A few science fiction writers consider teleporters that preserve the original, and the plot gets complicated when the original and teleported versions of the same person meet; but the more common kind of teleporter destroys the original, functioning as a super transportation device, not as a perfect replicator of souls and bodies.

Saturday, January 17, 2009

Medical Text Analysis System - Natural Language Processing

The Medical Text Analysis System (MedTAS) is a UIMA-based, modular and flexible system that uses advanced Natural Language Processing (NLP) techniques to extract structured information from unstructured data sources, such as pathology reports, clinical notes, discharge summaries, and medical literature. MedTAS is also a development platform that is adaptable to customer and domain requirements. It has been designed to operate within institutional systems, and seamlessly integrates with IBM products, such as the DB2 Data warehouse.

Implementations of MedTAS have been developed for major medical institutions. MedTAS/P is a version customized for the pathology domain. It is based on a novel representation of cancer, its characteristics and disease progression.

SwiftFile - Artificial Intelligence

SwiftFile for Notes is an intelligent assistant for Lotus Notes that helps users organize their e-mail into folders. SwiftFile uses a text classifier to learn each user's mail-filing habits. SwiftFile uses the model it learns to predict the three folders in which the user is most likely to place each incoming message. The predictions are presented to the user as three shortcut buttons that allow the user to quickly file each message into one of the predicted folders. When one of SwiftFile's predictions is correct, the effort required to file a message is reduced to a single button click. An incremental classifier is used to allow SwiftFile to continuously update its model of the user.

We have performed a number of static and dynamic experiments with SwiftFile as well as some initial user studies. The results show that the shortcut buttons provided by SwiftFile are useful between 80% to 90% of the time, and this performance level is maintained over time despite the constantly-changing classification problem. We also find that the bootstrap period for the classifier is extremely short and that SwiftFile is useful from the moment it is first installed.


For more Info

http://www.research.ibm.com/swiftfile/index.html


Wednesday, January 14, 2009

Windows XP Commands

  CACLS    Change file permissions
CALL Call one batch program from another
CD Change Directory - move to a specific Folder
CHANGE Change Terminal Server Session properties
CHKDSK Check Disk - check and repair disk problems
CHKNTFS Check the NTFS file system
CHOICE Accept keyboard input to a batch file
CIPHER Encrypt or Decrypt files/folders
CleanMgr Automated cleanup of Temp files, recycle bin
CLEARMEM Clear memory leaks
CLIP Copy STDIN to the Windows clipboard.
CLS Clear the screen
CLUSTER Windows Clustering
CMD Start a new CMD shell
COLOR Change colors of the CMD window
COMP Compare the contents of two files or sets of files
COMPACT Compress files or folders on an NTFS partition
COMPRESS Compress individual files on an NTFS partition
CON2PRT Connect or disconnect a Printer
CONVERT Convert a FAT drive to NTFS.
COPY Copy one or more files to another location
CSCcmd Client-side caching (Offline Files)
CSVDE Import or Export Active Directory data

Send Email from Asp.net

protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
MailMessage message = new MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);
SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text);
emailClient.Send(message);
litStatus.Text = "Message Sent";
}
catch (Exception ex)
{
litStatus.Text=ex.ToString();
}
}

Monday, January 12, 2009

VS.Net error "has not been setup for the current user"?

Run regedit and try to find the following Registry Key
[HKEY_CLASSES_ROOT\Licenses\C4B8C1BC-A36C-4723-AF48-F362BFAB9DF5]

If it exists, then delete it.
Then, try launching VS.NET Beta 2 again.

Export DataGrid to Excel

con.Open();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.ContentType = "application/Excel";
//Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DataGrid1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
con.Close();

Sunday, January 11, 2009

Asp.net Interview Ques

Which namespace is used for event log support ?
How to handle the exception occurred in catch block ?
Does data grid has a view state ?
Difference between remoting and web service in .net ?explain with an example
Can Dataset be stored in view state ?
What is the difference between server controls and html controls ?
How to create a permanent cookie
How will create Assemblies at run time ?
What is a view state ?
How to maintain View State of dynamically created user controls ?
How will create assemblies at run time ?
How to refresh the crystal report data from ASP.Net ?
What is AutoWiredUp=false in PAGE directive in ASP.NET ?
What is Reflection ?
What is the trace in ASP.NET
What is the difference between Custom Control and a User Control ?
How will you load dynamic assembly ?
What is the difference between Form Post and PostBack. ?
Why we need both server controls and html controls in asp.net ?
Can we use http handlers to upload a file in asp.net ?
What is the difference between inline coding & code behind?

CGI Configuration in apache server

Run -> cmd
1. ppm
2. Install CGI - y/n
3. Install DBD:mysql
4. Install CGI::Session
5. Install CGI::Carp

Login Check in CGI

#! /usr/bin/perl
use CGI;
use DBI;
$obj=new CGI();
$loginid=$obj->param("login");
$password=$obj->param("pass");
print $obj->header();
$user="root";
$pass="";
$dsn="DBI:mysql:db12:localhost";
$dbh=DBI->connect($dsn,$user,$pass);
$stmt=$dbh->prepare("select * from login where loginid='". $loginid . "' and password='". $password ."'");
print "select * from login where loginid='". $loginid . "' and password='". $password ."'";
$stmt->execute();

$no=$stmt->rows();


if($no==1)
{
print "";
}
else
{
print "";
}
#$dbh->disconnet;

Monday, January 5, 2009

Important PHP Website

PHP.net: A Tourist's Guide

Everyone knows the www.php.net site. All of us went there sooner or later, and will keep going back there. This is the central reference point for PHP users, and there is a wealth of information there. Not all of it is obvious. Come with me, I'll show you.

www.php.net: Main Website

This is the primary web site. The front page is where major news is published: new PHP versions, security updates, and new projects launched. This site is also mirrored in dozens of countries worldwide.

This is the home of the download page, for everyone to get the latest version of the PHP source code and binaries for Windows. The current and next-to-current versions are available there. (There is also a PHP Museum, which has all of the source distributions since June 1996.)

The next most visited section is the documentation. The documentation is translated into twelve different languages, and is available in a variety of different formats. Users are able to read notes on the documentation left by other users, and contribute their own notes. The documentation is a real community project by itself!

The support page has all the directions to a wealth of resources both inside and outside of PHP.net. The community has built a huge network of knowledge bases, PHP user groups, and training sessions where anyone can have his or her questions answered. Non-English-speaking users also get a large share of attention.

Now, buckle up your seat belt, and stop smoking. Here are the no-light streets:

talks.php.net: Conference Materials

This is where speakers at various PHP-related conferences keep their slides. It covers all sorts of topics, from the famous 'Rasmus' introduction to PHP to the latest 'PHP system administration', through PEAR and advanced topics. All those slides are available within the PHP slide application.

news.php.net: Mailing Lists Web and NNTP Interface

news.php.net is the web interface to the PHP mailing lists. If you're not subscribed to the mailing lists, but you still want to keep in touch regularly, this is your place. An infinite pile of fresh news and trends of PHP. You can also point your news reader at the NNTP server at news.php.net to follow the lists.

pear.php.net: The PHP Extension and Application Repository

PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library.

pecl.php.net: The PHP Extension Community Library

PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.
The packaging and distribution system used by PECL is shared with its sister, PEAR.

bugs.php.net: Bug Database

The bug database is where you can bring problems with PHP to the attention of developers (but don't forget to double-check that somebody else hasn't already reported the same problem!).

doc.php.net: Documentation collaboration

The documentation projects website tries to gather all PHP.net hosted documentation teams together with tools, status reports and an RFC system.

docs.php.net: Documentation dev server

The documentation developmental server is a PHP mirror that contains upcoming releases of the PHP documentation before it's pushed out to the mirrors. Documentation changes, such as layout, is tested here (with feedback requested) before being made official. Documentation is built here four times a day.

qa.php.net: Quality Assurance Team

The Quality Assurance team is one of the most important pieces of the PHP project, protecting users from bugs. It is gathered around the QA mailing list, and this site allows anyone to provide tests and experience to the release process.

cvs.php.net: CVS Repository

The PHP project is organized with a CVS server, and this website is the web interface to it. There you can browse the history (and latest versions) of the source code for all of the PHP projects. For example, the php-src module is the repository for the source code to the latest version of PHP itself.

lxr.php.net: Cross Reference

Cross reference for source code, based on the "Linux Cross Reference". This is the ultimate tool for exploring PHP code. Any time an important macro or function is detected within the code, it is linked to its definition, and all its usage locations. This will help you build your code, and understand the PHP source.

gtk.php.net: PHP-GTK

This web site is the home of the PHP-GTK project, which allows PHP to be used to build graphical interfaces, with slick interface and highly interactive content. You'll find the downloads and docs here, and the latest news from the project.

snaps.php.net: Daily PHP Snapshots

This is your first stop if you're looking for cutting edge development versions of PHP which are generated every day from the current stable and current development sources.

gcov.php.net: Test and Code Coverage analysis

This site is dedicated to automatic PHP code coverage testing. On a regular basis current CVS snapshots are being build and tested on this machine. After all tests are done the results are visualized along with a code coverage analysis.

wiki.php.net: The PHP Wiki

Home of the official PHP wiki, this site contains information related to php.net like RFCs, GSOC information, and TODO files. Most every aspect of the PHP project has a wiki section and everyone is able to apply for wiki commit access.