This site has moved to a new address: techies.topaix.com

Thursday, July 31, 2008

Introduction to L7 – Application Layer Packet Classifier for Linux

L7-filter is a classifier for Linux’s Netfilter that identifies packed based on application layer data. This is very effective tool to classify the packets regardless of ports. Packets can be classified as Kazza, HTTP, Jabber, Citrix, Bittorrent, Gnucleus, eDonkey etc. L7-filter can also be used in conjunction with Linux QoS to do bandwidth arbitration and traffic accounting.

Links:
Linux advanced routing & traffic control howto

How to block LimeWire traffic in your network

I have to admit that blocking LimeWire traffic is not easy. But you can put some control or can block it to some extent.

LimeWire is a peer-to-peer file sharing (P2P) client for the Java Platform, which uses the Gnutella network to locate files as well as share files. It is free and distributed with GNU General Public License.

As Limewire uses Gnutell protocol which can be blocked by Firewall having packet filtering capability. This can be done by using IPTABLES in conjunction with IPP2P module.

Here is few guidelines which can be implemented at various level in your network:

1. At PC level, setup a rule to block “C:\Program Files\LimeWire\LimeWire.exe”. Also block FrostWire which is basically a limeWire variation.

2. At firewall level, Setup IP filter to block ports 6300-6400 and 10000-65535. Other ports for file sharing application can be found at http://bandwidthcontroller.com/applicationPorts.html. LimeWire uses port 6346 / 6347 (TCP/UDP.

Wednesday, July 30, 2008

What is Intel's Classmate PC

The World Ahead Program from Intel Corporation has a vision to provide access to technology for everyone, anywhere in the world. The classmate PC is a revolutionary new device targeted to provide one computer per student and is part of Intel's World Ahead program.

Classmate PC: http://www.intel.com/intel/worldahead/classmatepc/

Dell launching music player to renew iPod

Over years, many companies like Microsoft, and Sony have tried to capture iPod market. But, they failed to make a dent in the Apple's iPod market. As per the Wall Street Journal newspaper, the Dell music player is being tested right now and will be available for sale in September.

The music player will have small screen and basic buttons for navigation. It will have capability to connect to Internet via Wi-Fi and will cost around 100$. I am eager see what will be Dell's strategy to compete with popular iPod market.

How to filter P2P traffic

With increasing popularity of video/movie/music sites, network administrator's jobs are challenged to keep the network bandwidth safe from P2P downloads and save it for legitimate use.

This post is based on open source solution which is absolutely free and considerable stable. I am talking about the open source project IPP2P. IPP2P is a netfilter extension to identify P2P file sharing traffic. The name IPP2P comes on the one side from IP (internet protocol) and on the other from P2P (peer-to-peer). IPP2P is a very good dynamic tool for a network administrator to filter the traffic in an intelligent way. It doesn't prohibit all P2P traffic but make it possible to shape the P2P traffic to a given rate.

IPP2P integrates itself easily into IPTABLES based Linux firewalls. It uses suitable search patterns to identify P2P traffic on the network. Once the P2P traffic is identified, it can be dropped, put into low priority, or shaped to a given bandwidth limit.

If you are are interested in using IPP2P to block P2P traffic in your network, Read this post "How to Filter P2P network traffic with IPP2P at Debian Administration". This post will teach you how to install IPP2P and configure it to work with IPTABLES based Linux firewall.

Another Option: if you want to shape the traffic with QoS, consider using L7-filter

Thursday, July 24, 2008

Organise your email with Yahoo Zimbra email program

Yahoo is expanding its popular e-mail service to the desktop in a bid to help consumers manage their e-mail accounts when they aren't online.

Yahoo Zimbra Desktop, an e-mail program that organizes Yahoo Mail, AOL, Google's Gmail and work and business e-mail accounts in one place - and lets you read, compose and organize messages off-line.

>> Read the full story

Monday, July 14, 2008

What is Rootkit?

Rootkit is a malicious program or combination of many malicious programs which is engineered to take control of operating system without authorization of the computer's user. It is basically intended to seize control of the system and keep itself hidden from the user.

In the early days, it use to replace system tools like ls, passwd or ps in Unix system. Soon after it was spotted by security experts, hackers started to target kernel itself which is hard to discover easily.


Read more: What is RootKit?

Basic vi editing command

You must be in command mode to execute editing commands. Many of the editing commands are case sensitive. They have different meaning depending on whether they are typed as lowercase or upper case. Also, editing commands can be preceded by a number to indicate a repetition of the command.


Deleting characters:
1. X : will delete the character before the cursor
2. 4x : This will remove four characters

Deleting Words: Make sure to position the cursor to the first letter of word
1. dw : it will delete the word and space follwing it.
2. 3dw : will delete three words

Deleting Lines: Make sure the cursor is at the beginning of the line
1. dd : delete the entire line.
2. 2dd : delete two lines
3. D : To delete from the cursor postion to the end of the line.

Replacing Characters: This will replace one character with another
1. Position the cursor to the character to be replaced.
2. Then type r
3. Type the new character you want to replace with.
4. Now, the new character should appear and you should still be in the command mode.

Replacing word: move the cursor to the start of the word you want to replace
1. cw : vi will change itself to Inster mode and the last letter of the word to be replaced will turn into a $.
2. 3cw : will replace three words
3. Press “ESC” to get back to command mode.

Replacing Lines: This will change text from the cursor position to the eend of the line.
1. Type C
2. Type the replacement text
3. Press “ESC”


Inserting Text:
1. Position the cursor where you want the new text to appear.
2. Type “i”
3. Now you can start entering text
4. Press “ESC” to go back


Navigating a file:

w : forward word by word
b : backward word by word
$ : to end of line
0 : to the beginning of line
H : to top line of screen
M : to middle line of screen
L : to last line of screen
G : to last line of file
1G : to first line of file
CTRL + f : scroll forward one screen
CTRL + b : Scroll backward one screen
CTRL + d : Scroll down one half screen
CTRL + u : Scroll up one half screen

Search Text:

While in command mode,
1. Type /
2. Enter the text you want search
3. Press “Enter” Key
4. The cursor moves to the first occurrence of the text you typed above after slash
5. Type n to search in forward direction and N to search in backward direction

Saving and Closing the file:

Save the file and quit vi: Shift + ZZ

Save only and leave the file open:
1. Press ESC
2. Type :w
3. Press “Enter”

Don’t save and quit vi:
1. Press ESC
2. Type :q!
3. Press “Enter”

Related Reading: Introduction to vi editor in Linux and Unix system

Introduction to vi editor in Linux and Unix system

The vi editor is the classic screen editing program for Unix systems and is based on a older line editor called ex. It can be used from any type of terminal because it doesn’t depend on arrow and function keys. It uses standard alphabetic keys for command as well as arrow keys.

There are number of enhanced version of vi exists. Some of them are nvi, vim, vile and elvis. In Linux, the vi command is a link to one of these programs. Most likely it will be vim. Most of the Linux distributions have vi and emacs text editor already installed.

In Linux, configuration files are written in plain English. Hence, text editors are required to make changes to these files. The editing capabilities can be invoked within vi by pressing the colon (:), entering ex command and then pressing the Return key. ex commands are still important part of vi and is sometimes called hex in Linux.

Learning vi or emacs is must for every Linux or Unix user. There are some GUI based text editors available. But, there are some situations when you can’t access GUI desktop. In that case, vi or emacs can only save you.

The version which people use normally now a days is Vi iMproved (VIM). Vi was enhanced by Bram Moolenaar and are called vim editor.


The vi editor has three modes, command mode, insert mode and command line mode.

1.Command mode: by default, the vi editor opens in command mode. You can use commands to move cursor, delete. cut, copy, paste and save changes. Commands are case sensitive. The ESC key is used to end a command.

2. Insert mode: Insert mode is what we work in most of the time and text is inserted into the file in this mode only. You can enter the insert mode by pressing “I” key. The newer vi versions will show “INSERT” word on the bottom line. You can also enter "a" (insert after), "A" (insert at end of line), "o" (open new line after current line) or "O" (Open line above current line) commands apart from “I” command. The ESC key ends insert mode and returns you to command mode.

3.Command line mode: You can enter this mode by typing ":" which displays the command line entry at the bottom of the screen.

Note: In broad sense, there are only two modes, one for editing text (i.e. Insert mode) and the other (i.e. command mode) for giving commands. To switch between the two modes you use the “I” and “Esc” keys.


Starting vi

1. To start Vi, open a terminal or console and simply type vi filename (for existing file) or vi newfile (newfile will be name of your new file)

2. The file will open in command mode.

3. Type “I” to go to Insert mode and add your text in the file.

4. Once you are done editing the file, Press “ESC” to go to command mode and save your changes to the file. Press “Shift+ZZ” to save the file. Alternatively, you can use command line mode to issue command to save the file.


Swap file:

Swap files has .swp extension. Swap file is automatically created when you make mistake in saving file. Mistake like issuing wrong command CNTRL+ZZ instead of SHIFT+ZZ. It is similar to temp files in Windows or DOS. .swp file will be in addition to your original file. In this case, the original file will not contain the recent changes.

Command to recover from swap file: Type the following command at the $ prompt and press ENTER

vi -r {file name}

You must delete the swap file after recovery: Type following command at the $ prompt and press ENTER

rm .{file name}.swp


Moving the cursor: This command only works when you are in command mode. The cursor is controlled with four keys: h, j, k, l.

h – one space left

j – one line down

k – one line up

l – one space right


Note: If you were in Insert mode, Press ESC to go to command mode.


Link: www.linuxconfig.org/Vim_Tutorial

official site for vim: www.vim.org


Read more: Basic vi editing commands

Saturday, July 12, 2008

How to create passport size photos

I have found 4 most reasonable resources to generate passport size. They are as follows:

1. Make Your Own Passport Size Photos : This is an excellent tutorial and shows how to create passport size photo in GIMP (Free GNU Image manipulation Program). GIMP is free replacement for expensive Adobe Photoshop.


2. Making Your Own Passport Photos: This is another excellent tutorial for how to create passport size photos by yourself. This tutorial is based on Abode Photoshop. If you don't have Adobe Photoshop, you can go for GIMP.


3. Create online free passport photos by epassportphoto.com: This is excellent online site which enables you to create passport size photo online.

4. Make your own passport photos: Another good tutorials using Photoshop.

Ubuntu can run inside Windows with Wubi

Wubi is actually an application for Windows which can run Ubuntu inside Windows.

This is very good news for those who want to test drive Ubuntu without leaving Windows operating system.

I have not tried it myself. But, it seems very promising.

Friday, July 11, 2008

How to install Firefox 3 in Ubuntu Linux in one command

There are many ways to install Firefox in Ubuntu. You can download the tar file from Mozilla.com and then follow the standard linux installation procedure. But, I prefer to install the software from Ubuntu repository site (archive.ubuntu.com). It is very easy to install Firefox in Ubuntu from repository.


Open the terminal and type the follwoing command:

sudo apt-get install firefox-3.0


You will be required to supply your password and then the download process will start. The file size is 11 MB and it will need 32MB additional disk space.

Wednesday, July 9, 2008

How to add a Photo in teaser and body in Drupal

This tutorial will teach you how to add a photo in teaser and body of a post in drupal without any programming with the help of ImageCache and ImageField module.



Steps are simple:

Step 1: Upload these two modules in the drupal module directory:
a]. ImageCache and b]. ImageField

Step 2: Install the two new modules by going to Module page of the website.

Step 3: Configure the two modules: Go to administration by module, find ImageCache and setup Presets as follows:

[A]. ImageCache Presets:

[i]. Name space for main content: (This is the picture people will see in each node)

Present namespace: Type main and
click on Create Preset.

Choose Action: Scale it and
update Preset
Setting for Scale: Width – 300 px (This makes sure the picture is set for 300px in
landscape and portrait)

[ii]. Another namespace for teaser
Preset namespace: thumbnail
Action: Scale
Settings: Width – 100, Height – 100
Scale to fit: Outside dimensions
Another Action: Crop it
Seetings: Wdith: 100, Height: 100, Xoffset: Center, Yoffset: Center

Step 4: Now go to administration page of the website and choose Content Type and go to story and add some fields to story content type to add photo in teaser and content
A]. Create New Field: Image
Field Type: Image
And Click Create
Max Resolution for images: 800x600
ImagePath: image
Permitted uploaded extensions: JPG JPEG jpg jpeg

B]. Go to Display Field:
Label: Hidden
Teaser: thumbnail as link
Full: main
And then Submit

Add story and then it should be ok.


To make the look of the photo proper in teaser and full node, you can insert few CSS code in modules/system/default.css file. It should work for you but you can change it as per your need.

1. .field-type-image img{
float: right;
margin-left: 10px;
margin-right: 0px;
margin-top: 4px;
margin-bottom: 0px;
border: 0px solid red;
}

2. .field-field-image2 img{
float: left;
margin-left: 0px;
margin-right: 10px;
margin-top: 4px;
margin-bottom: 0px;
border: 0px solid blue;
}
3. .field-field-image3 img{
float: right;
margin-left: 10px;
margin-right: 0px;
margin-top: 4px;
margin-bottom: 0px;
border: 0px solid green;
}