JUN
2009
29
0 Comments
165 Hits
Greedy and Non-Greedy Matching using Perl Regular Expression
Posted under: Tutorial
Tags: Scripting

In this article I will show the difference between the default greedy (.+ and .*) and non-greedy matching using Perl-compatible regular expression.

For example, I have a string in a single line:

$line= "Seq[03] Command : CREATE("A") Seq[04] Command : CREATE("B") Seq[04] error: 5006 Seq[03] error: 5006 Seq[05] Command : DELETE("A") Seq[05] error: 5006 ";

I could capture all the Command without the error code using the following regular expression:

m/Seq\[[0-9]{2}\].+Command.+\(.+\)/gi
Read More
APR
2009
30
0 Comments
377 Hits
Binary String Conversion to Decimal and Hex Using C#
Posted under: Tutorial

microsoftnet-logoIf you need to convert Binary String to Decimal (Integer) and Hexadecimal, .NET Framework has conversion methods in Convert class to make numeric conversion easier. This class is located in Microsoft.VisualBasic library.

Read More
APR
2009
24
0 Comments
208 Hits
Change IP Address Using netsh from Command Prompt
Posted under: Tutorial
Tags: Scripting

Network interface can be changed manually by using netsh command (netsh.exe) from Windows Command Prompt. To change the interface IP to static IP, use the following command format:

netsh interface ip set address [Connection Name] [Source] [IP] [Netmask] [Gateway] [Metric]
Read More
JAN
2009
15
0 Comments
347 Hits
Validating Email Address using Javascript Regular Expression and PrototypeJS
Posted under: Tutorial
Tags: Scripting

Annoyed with form submitters that keep fills the email form field with an invalid email? You can use javascript's regular expressions to validate it. There's so many regular expressions form to validate e-mail on the internet but many of them is very long and difficult to understand to modify to suit my need. The regular expressions is expressed below:

/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,60})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
Read More
NOV
2008
18
0 Comments
148 Hits
Avoid ARP Poisoning Packet Data Sniffing
Posted under: Tutorial

Did you ever realize that someone on your network could steal your private data such as your username and password email? It is possible to do with a method called ARP redirect or sometimes called by ARP poisoning. This method is also often used by worms or spyware to hijack your private information gathered by those worms or spyware and sending 'silently' through internet to it's owner without you to be noticed. This is can be avoided by installing antivirus or anti-spyware that monitor and scan your network packet data activity on your network connections.

Read More
NOV
2008
10
0 Comments
134 Hits
Ping a Specific Port
Posted under: Tutorial

Actually you can't ping a specific port by using the ping command to test whether specified port is open or not. The ping command is used to test specified node/host whether it is live or not. It uses ICMP packets (wiki.answers.com). You can test a port whether it is live or not by telneting the port using the telnet command. The telnet command is a utility to connect over TCP and defaults to port 23 (make a TCP connection to port 23 on remote computer/server). But if you specify a different port than 23, then what the telnet command do is opening a TCP connection on the specified port to the remote computer/server.

Read More
SEP
2008
13
0 Comments
228 Hits
Power Management Commands in Windows XP
Posted under: Tutorial

Windows XPFor anyone who need to know about commands that shuts down, reboot, hibernate, log off, and/or locking the computer in Windows XP by executing it from Windows XP command prompt or 'console'. This command may be useful in task scheduling or making it programmable.

 

Read More
Next