Friday, May 17, 2013

Outlook - Removing GMail Account from Outlook

Very often, you will want to remove your GMail account from your Outlook for various reason.

To remove GMail account completely. Do the following

1. Open your Outlook. Tools -> Account Settings.
2. At Account Setting, select your GMail account and click on Remove. Click on Yes on the confirmation dialog box.



3. The above steps only remove the account from Outlook. The PST file still exist in the system. So, for XP, you should go to C:\Documents and Settings\your_account_name\Local Settings\Application Data\Microsoft\Outlook. Delete all pst files that has your gmail account name. In this example, it is ExchanXXXX@gmail.com-00000004.pst. Please note that you need to show hidden file and folder in your Folder Options before your can see Local Settings folder



4. Empty your recycle bin


Outlook - Accessing and Synchronizing GMail to Outlook

Well.. Many many post in Google had discussed about this topic. My purpose of this post is to provide a tested instruction for my future referral.

The reason to access GMail in Outlook usually are

1. Single point of email access
2. Back up/synchronize Outlook email to and from GMail

In order to access GMail in Outlook, it is best to use IMAP protocol. So, you need to make sure your GMail account has IMAP enabled.

Below are the steps to setup GMail and Outlook

1. Log onto your GMail account
2. Go to Setting -> Forwarding and POP/IMAP. Make sure IMAP is enabled. Click Save Changes after you had enabled IMAP





3. Now, open your Outlook (tested on Outlook 2007)
4. Go to Tools -> Account Settings



5. At Account Settings, click on new



6. A wizard will be shown. Select "Microsoft Exchange, POP3, IMAP, or HTTP". Then click next



7. Click on the check box "Manually configure server settings or additional server types". Then click next



8. Select "Internet Email". Then click next



9. Key in all information as per screenshot. Make sure your user name is XXX@gmail.com



10. Next, click on "More Settings"
11. Click on "Outgoing Server" tab and click on "My outgoing server (SMTP) requires authentication"



12. Click on "Advanced tab". Type in the screenshot information



13. Click OK to close More Settings
14. Click Next and Finish to complete the setup. Then click close to close the Account Settings dialog
15. Now, you should see your GMail Inbox in your mail folder



16. Normally, it will update your IMAP folder automatically. If not, you can right click on your xxx@gmail.com mail box and select Update Folder List



Now, you can access your GMail in your Outlook. You can start doing the following

1. To access your GMail mail, simply click on your folder listed under XXX@gmail.com mail box
2. To move mail from Outlook to GMail, just drag and drop your mail from Outlook to GMail folder.

If you have problem with the setting, you can refer to https://support.google.com/mail/troubleshooter/1668960?hl=en&ref_topic=3026306 for the updated list of port numbers and settings

Tuesday, May 7, 2013

DDoS in Action

Not sure if I should be excited, but, this is the first time I am experiencing DDoS on a VPN server. Now, my mind is all about my past infocomm security topic to think about how DDoS works.

DDoS

The DDoS existed since 1998 and it is happening to me right now. In a nutshell, DDoS means that some adversary is using a BotNet (a large group of computers) to attack a single system to prevent access for legitimate users.

There are wide range of attacking method such as ICMP flood and TCP Syn flood. I will not discuss on the attack as they are widely discussed in Google.

Symptom

Before my real experience, I always think that DDoS only affect a single system. But now, I know I am wrong.

An DDoS attack to my VPN server caused network congestion to my organization's 10Mbps Internet to slow down. The reason being is the BotNet is sending enormous amount of data in my network, and as a result, the Internet router is overloaded and caused the slow down in Internet as well.

So, if you encounter a sudden slow down in accessing a system or the whole network/Internet, you may be encountering a DDoS attack

Treatment

First, you need to identify which system is being attack. For me, since I have access to the data center, I physically unplug LAN cable from my router to isolate the problem. And this method helped me to single out my VPN server is being attacked.

After you had identified the system, inspect all logs from the system and identify if you are genuinely under DDoS attack.

If you are under DDoS attack, you can do the following

1. Change the system IP address
2. Set up the firewall to filter the IP of the DDoS attack
3. Set up IPS to detect future DDoS attack
4. And many more if you search Google :)

Reference

http://staff.washington.edu/dittrich/talks/sec2000/timeline.html
https://en.wikipedia.org/wiki/Denial-of-service_attack

Big Data - Hadoop Overview

Starting to look into Big Data area and feel that I better look into Hadoop.

Big Data

Recently, everyone talk about big data and I am asking myself what is big data? Big databases and file system?

Gartner define Big Data as "Big data are high volume, high velocity, and/or high variety information assets that require new forms of processing to enable enhanced decision making, insight discovery and process optimization.

High volume refers to the ever glowing volume of data transaction. Data are in petabytes nowadays.

High velocity refers to the speed of processing required to process the data. Time-sensitive data analysis may requires speed of processing of data into seconds.

High variety refers the various type of data. Nowadays, data is not necessary to be structured. Unstructured data such as video stream, mouse click, sensor information, etc... are very common.

So, my understanding to big data is any data that is under the sun.

Why Hadoop?

This is the next question in my mind. Why Hadoop? Organization has been happily using tradition data warehouse and RDBMS to handle "big data" over the decade and RDBMS is proven to be ACID. After some reading, my conclusion is RDBMS is very well designed for structured data and analyzing reasonable size of normalized dataset. These structured data are often stored in a single server that had 1 big harddisk and multiple CPU core.

However, in the current world, 80% of the data are unstructured and distributed globally. In such environment, RDBMS become very inefficient. Some reasons are

1. Moving terabytes of data across system for RDBMS centralized system for data analysis are infeasible
2. Processing these massive data with limited bandwidth and hardware resources at the RDBMS centralized system is very time consuming.

So, if you encounter the above headache with your RDBMS system, it is time for you to consider Hadoop.

Hadoop is
  • Cheap as it can be run on commodity hardware
  • Scalable as servers can be added with required
  • Distributed as no single node store all data
  • Parallel as each nodes run job with their set of data in parallel
  • Suitable to handle massive amount of data that are unstructured and semi-structured
  • Reliable as it replicates data into multiple nodes.
  • Code based as each Hadoop server could run different job code on their specific set of data
  • Network efficient as only processed results at each slave node are sent to master node for result compilation as a whole 
Below are some architectures that I had found in Google that may help to understand more about Hadoop






To archived the above, Hadoop has 2 main components: HDFS and MapReduce.

I need to read more before I had more insight and post about HDFS and MapReduce.

Reference:
http://en.wikipedia.org/wiki/Apache_Hadoop
http://www.ebizq.net/blogs/enterprise/2009/09/10_ways_to_complement_the_ente.php
http://www-01.ibm.com/software/ebusiness/jstart/hadoop/



Thursday, April 18, 2013

Electrical - Com/NO Relay & LED Resistor Calculation

Recently, I am playing with alarm I/O and requires something that is common but unfamiliar to me - Electrical circuit wiring.

Equipment Required

1. Breadboard - A breadboard (protoboard) is a construction base for prototyping of electronics. See http://tymkrs.tumblr.com/post/6386624174/how-to-use-a-breadboard on how to use a breadboard


2. 3V LED light - Need to display alarm output (see setup picture below)
3. Some electrical wires
4. Open Switch.(see setup picture below)
5. Resistor - We are using 5V input for a 3V LED light. We need a resistor to control the current flow to prevent providing too much current for the LED light (May result in blowing the LED light). 

Setup

The following picture provided a setup for 2 circuits - Alarm input circuit and alarm output circuit.


Alarm Input Circuit

Alarm input are usually used to provide a trigger signal to the attached system. In the above setup, I am connecting a 5V circuit for the alarm input and I used a open switch as a trigger device. If I press the switch button, it will complete the 5V circuit and the alarm system will capture a change in voltage and respond accordingly.

Alarm Output Circuit

Alarm output are usually used to connect external device to provide visual/audio alert. In the above setup, I am using a 3V LED light as the visual output alert with an NO (normally open) circuit.

Normally, there are 3 type alarm output port provided by an alarm system. The port interfaces are C, NO, NC

C - This is a Common port for alarm circuit. Either NO or NC will use Common port to complete the alarm circuit

NO - Normally Open port for alarm circuit. Normally Open means the circuit is opened and will be closed if and only if the alarm system detect an alarm event. For example, if I connect a LED light to NO circuit, the LED light will only light up if there is an alarm event.

NC - Normally Close port for alarm circuit. Normally Close means the circuit is closed and will be opened if and only if the alarm system detects an alarm event. For example, if I connect a LED light to NC circuit, the LED light will be lighted up and it will only be turned off if there is an alarm event.

Now, let's talk a bit about voltage and resistor. If you look at the breadboard, the alarm output circuit is using a 5V input for lighting up a 3V LED light. This implies that the alarm system is providing more voltage (5V) to the LED light (3V) than the LED light required. The extra 2V will eventually blow the LED light. To prevent that, we need a resistor to reduce the voltage flow across the LED light.

Below is a common setup for a circuit. So for us

Supply Voltage: 5V
Current: 20 milliampere (3V LED usually used 20 milliamp current)
Forward voltage: 3V (Voltage needed to light up the LED light)
Resistance: To be calculate


So, to calculate resistance, we need to use Ohm Law



where

I = Expected Current through the conductor in ampere
V = Potential difference measure across the conductor in volt
R = Resistance in conductor in ohm

Therefore, to calculate resistance, use R = V / I

For us, 

V = difference of supply voltage - forward voltage of LED = 5V - 3V = 2V
I = expected current of LED = 20 milliamp = 0.02 amp

Therefore R = 2V / 0.02 amp = 100Ohm

Thus, we need a resistor of 100Ohm to complete the circuit (shown in the picture)

You can use http://www.hebeiltd.com.cn/?p=zz.led.resistor.calculator to calculate your required resistor value

In addition, resistor has color code. You can use http://www.electronics2000.co.uk/calc/resistor-code-calculator.php to compute your resistor color code before going to electrical shop to purchase your resistor. For example, 100 Ohm resistor has a color code of brown black brown gold


The above had described the completed circuit setup for alarm input and output. Please take note that you have to setup your alarm system to relay alarm input to alarm output. Different alarm system has different setting.

Result

For me, after I had linked up the alarm system relay setting and pressed the open switch at alarm input, the LED light will light up as external alarm.


Wednesday, April 10, 2013

Video - Measuring Video Bitrate Over Network

There are 2 ways to measure bitrate for a video streams. You can do it via VLC and Wireshark.

VLC

VLC provide statistical information for user to understand the input bitrate for video. However, the statistic provided by VLC is current statistic, and thus, it is not the overall average bitrate for the video stream.

To use VLC for seeing current bitrate for a video stream, do the followings

1. Open a network video stream via VLC

2. When the video stream had set up and started playing, go to Tools -> Codec Information


3. Click on the Statistics Tab

4. Look at Input/Read -> Content Bitrate. That will be the current bitrate for your current video stream. At the screenshot, it shows 3kbps. This means that during the time of capture, the bitrate for the video stream is at 3kbps. Thus, this value varies over time.


Wireshark

Wireshark provide statistical analysis on your captured network information and it is a very good tool to understand the average bitrate, maximum bitrate and minimum bitrate for a video stream.

To use Wireshark for seeing bitrate of a video stream, do the followings

1. Open a video stream through your LAN interface. The video stream can be open by any players such as VLC, webpage, etc... 

2.When the video stream had set up and started playing, allow the video stream to play for about 1 minute to stabilize the connection and streaming.

3. After 1 minutes, open Wireshark, click on "List the available capture interfaces" button and start capturing packets from LAN interface.



4. Allow Wireshark to capture at least 1 minutes of video packets.

5. After 1 minutes, stop packet capture by pressing "Stop the running live capture" button


Now, you have all the packets needed to analyze your bitrate for this video stream. There are 2 way Wireshark can do it.

Via Conversation Statistics

Conversation statistics will provide an overview of traffic information for all network conversation captured in Wireshark. Conversation statistics will tells us the average bitrate of the video stream.

To see bitrate of conversation, do the followings

1. Go to Statistics -> Conversations


2. At the open window, look for a column "bps a <- 5.2kbps="" a.="" a="" address="" and="" at="" average="" axis="" b="" below="" bits="" bps="" camera.="" column="" div="" from="" is="" laptop="" means="" my="" per="" referring="" screenshot="" second="" so="" stream="" tells="" the="" this="" to="" transferring="" video="" you="">

Via IO Graph

IO Graph statistics will provide a graph view of the bitrate over time for your network. Applying to our discussion, this will show the bitrate over time for a particular video stream; that include the maximum and minimum bitrate of for the video stream

To see bitrate of IO Graph, do the following

1. Find a video packet in the Wireshark window. Right click -> Follow TCP stream


2. Step 1 will open a Follow TCP Stream window. However, we are not using it. So, just close it.



3. The purpose of performing step 1 is to ask Wireshark to create a logic statement that filter and capture all video packets for the video stream. If you look at the below screenshot, Wireshark create a logic filter "tcp.stream eq 0" to get all video packets for the video stream. Please note that 0 is just a TCP stream index by Wireshark, it can be a different index number for other captures.


4. Now, go to Statistics -> IO Graph


5. It will open an windows that display a graph. Change the y-axis to Bits/Tick to get a graph that show Bits over time. From the below screenshot, it shows that the video steam has a maximum bitrate up to 25kbps and minimum bitrate of 1kbps.

 

Reference: http://www.cardinalpeak.com/blog/?p=1054

Monday, April 1, 2013

Remote Desktop - No Terminal Server License Servers Errors

If you had administrative right with your PC and has the following error with Remote Desktop Connection, this post may help.



You can use mstsc command to workaround this error. MSTSC (MS Terminal Server Connection) creates connections to Remote Desktop Session Host (RD Session Host) servers or other remote computers, edits an existing Remote Desktop Connection (.rdp) configuration file, and migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.

You can use mstsc.exe /admin to create and connect a administrating session with the sever.

Steps as follows

1. Assuming you are using WinXP. At Start menu -> Run, type mstsc.exe


2. It will launch a Remote Connection Application with administrative setup


3. Enter your remote IP and connect.


References: http://technet.microsoft.com/en-us/library/cc753907(v=ws.10).aspx