Tuesday 28 April 2009

What is Bandwidth?


Bandwidth

Bandwidth is a central concept in many fields, including information theory, radio communications, signal processing, and spectroscopy.
DEFINITION 1: Bandwidth
Is a measure of frequency range, measured in hertz.

EXAMPLE

The range of frequencies within which the performance of the antenna, with respect to some characteristics, conforms to a specified standard. (2.4-2.5GHz antenna has 100MHz bandwidth).
DEFINITION 2: Bandwidth
The amount of data that can be transmitted in a fixed amount of time, expressed in bits per second(bps) or bytes per second.

EXAMPLE

A V.90 modem supports a maximum theoretical bandwidth of 56 Kbps. Fast Ethernet supports a theoretical maximum bandwidth of 100 Mbps.
According to the Shannon-Hartley theorem, the data rate of reliable communication is directly proportional to the frequency range of the signal used for the communication. In this context, the word bandwidth can refer to either the data rate or the frequency range of the communication system (or both).
Bandwidth is a key concept in many applications. In radio communications, for example, bandwidth is the range of frequencies occupied by a modulated carrier wave, whereas in optics it is the width of an individual spectral line or the entire spectral range.
There is no single universal precise definition of bandwidth, as it is vaguely understood to be a measure of how wide a function is in the frequency domain. For different applications there are different precise definitions. For example, one definition of bandwidth could be the range of frequencies beyond which the frequency function is zero. This would correspond to the mathematical notion of the support of a function (i.e., the total "length" of values for which the function is nonzero). Another definition might not be so strict and ignore the frequencies where the frequency function is small. Small could mean less than 3 dB below (i.e., less than half of) the maximum value, or it could mean below a certain absolute value. In short, as with any definition of the width of a function, there are many definitions available, which are suitable for different applications.

Analog systems

For analog signals, which can be mathematically viewed as a function of time, bandwidth is the width, measured in hertz, of a frequency range in which the signal's Fourier transform is nonzero. This definition can be relaxed wherein bandwidth would be the range of frequencies that the signal's Fourier transform has a power above a certain threshold, say 3 dB within the maximum value, in the frequency domain. Bandwidth of a signal is a measure of how rapidly it fluctuates with respect to time. Hence, the greater the bandwidth, the faster the variation in the signal. The word bandwidth applies to signals as described above, but it could also apply to systems. In the latter case, to say that a system has a certain bandwidth is a short-hand for saying that the transfer function of the system has a certain bandwidth. As an example, the 3 dB bandwidth of the function depicted in the figure is f2 ? f1, whereas other definitions of bandwidth would yield a different answer.
Figure 1:
-3dB bandwidth)
-3dB bandwidth) (Bandwidth.jpg)
The fact that real baseband systems have both negative and positive frequencies can lead to confusion about bandwidth, since they are sometimes referred to only by the positive half, and one will occasionally see expressions such as B = 2W, where B is the total bandwidth, and W is the positive bandwidth. For instance, this signal would require a lowpass filter with cutoff frequency of at least W to stay intact. The bandwidth of an electronic filter is the part of the filter's frequency response that lies within 3 dB of the response at the center frequency of its peak. In signal processing and control theory the bandwidth is the frequency at which the closed-loop system gain drops to ?3 dB. In basic electric circuit theory when studying Band-pass and Band-reject filters the bandwidth represents the distance between the two points in the frequency domain where the signal is frac{1}{sqrt{2}} of the maximum signal strength. In photonics, the term bandwidth occurs in a variety of meanings:
  • the bandwidth of the output of some light source, e.g., an ASE source or a laser; the bandwidth of ultrashort optical pulses can be particularly large
  • the width of the frequency range that can be transmitted by some element, e.g. an optical fiber
  • the gain bandwidth of an optical amplifier
  • the width of the range of some other phenomenon (e.g., a reflection, the phase matching of a nonlinear process, or some resonance)
  • the maximum modulation frequency (or range of modulation frequencies) of an optical modulator
  • the range of frequencies in which some measurement apparatus e.g., a powermeter) can operate
  • he data rate (e.g., in Gbit/s) achieved in an optical communication system

Sunday 26 April 2009

Manually Upgrading MySQL

If at all possible, you should use /scripts/mysqlup to do a MySQL upgrade, however, if you need a version of MySQL outside of what they are offering in current cPanel versions, it is possible to upgrade manually.

These are the instructions for performing a manual upgrade of MySQL to 5.1.30, but this typically applies to all versions over 4.1 and higher. Typically it is best to upgrade to whatever the latest stable branch of MySQL is and apply these instructions to install the RPMS.

If this is on a live system, make sure to make backups of the databases.
# mkdir /root/dbbackups

# touch /root/dbbackups/list
for db in `mysql -e 'show databases' |awk '{print $1}' | grep -v Database`
do
# mysqldump --add-drop-table $db > /root/dbbackups/$db.sql && echo $db >> list
done
# mkdir /root/sqllibs

# cp /usr/lib/libmysqlclient.* /root/sqllibs
Do a search for all installed MySQL packages to be removed:
# rpm -qa | grep -i mysql-
This should present a list of 5 or 6 MySQL RPM’s that are installed, likely. Uninstall them one by one with the rpm -e like so:
# rpm -e MySQL-devel-4.1.21-0.glibc23
Some packages are dependencies of each other, so you may need to remove one before being able to remove another.

Download the binaries for the OS version and MySQL version you are using from the cPanel repo:

http://httpupdate.cpanel.net/mysqlinstall/

execute rpm -i for each package (ex: pm -i MySQL-client-5.1.30-0.glibc23.i386.rpm)

Edit /var/cpanel/cpanel.config and change the MySQL version to 5.1 (or whatever version you’re running now). Then run this command:
# touch /etc/mysqlupdisable
This will keep cPanel from resetting or reverting back to its original MySQL version during updates.

Restart MySQL first to make sure that it can at least start (which it should). Once you’ve verified this, run mysql -V to make sure that the correct version is installed. You should see output similar as below:
root@server [~]# mysql -V
mysql Ver 14.13 Distrib 5.1.30-beta, for pc-linux-gnu (i686) using readline 5.0

MySQL should now be up and running, but it’s likely that trying to log in directly as the root user will fail. Before Following the below steps, make sure you can do a ‘mysql -u root’ and log in successfully. If not, you’ll need to set the root password. By default, MySQL has a blank root password which will need to be set to ours…twice.

Recopy the libs, but don’t overwrite any that already exist:
# mv /root/sqllibs/libmysqlclient.* /usr/lib/mysql/
Next update cPanel’s PHP and DBD MySQL bundle for perl by executing the following:
# /scripts/perlinstaller --force Bundle::DBD::mysql

# /scripts/makecpphp
Verify that phpMyAdmin and php -m load properly and without errors.

Saturday 18 April 2009

Converting Images with Command-line

The  convert command is a powerful tool. Here is some ways to manipulate images using the convert command in Linux.

Image types that convert supports include .jpg, .bmp, .gif, .png, .tiff, .xpm,
.xwd, and .pcx

Resizing images:

$ convert -resize 800x400 kitty.jpg kitty-sm.jpg
$ convert -sample 50%x50% dog.jpg dog-half.jpg


The first example creates an image (kitty-sm.jpg) that is 800 × 400 pixels. The second example reduced the image dog.jpg in half (50%x50%) and then saves it as dog-half.jpg.

Creating thumbnails:

$ convert -thumbnail 120x120 a.jpg a-a.png
$ convert -thumbnail 120x120 -border 8 a.jpg a-b.png
$ convert -thumbnail 120x120 -border 8 -rotate 8 a.jpg a-c.png


Where the convert commands can really shine are when you use them in scripts. Instead of resizing, rotating a single file, you can do any or all of
those things to a whole directory of files.

Here's an example of a script you can run to resize an entire directory of photos to
800 × 400 pixels to upload to flickr or something:

$ cd $HOME/images $ mkdir small $ for pic in `ls *.png` do echo "converting $pic" convert -resize 800x400 $pic small/sm-$pic done

Friday 10 April 2009

Installing ntop on Red Hat Enterprise Linux / CentOS Linux / Debian




ntop is a network probe that shows network usage in a way similar to what top does for processes, dnstop for dns, ptop for postgresql, iotop, atop …

In interactive mode, it displays the network status on the user’s terminal. In Web mode, it acts as a web server, creating a HTML dump of the network status. It sports a NetFlow/sFlow emitter/collector, a HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics.

ntop is available for both Unix and Win32-based platforms. It has been developed by Luca Deri, an Italian research scientist and network manager at University of Pisa.

On Redhat or Centos:
For installing ntop on Red Hat or Centos, please follow these instructions:

Packages needed :
- libpcap: system interface for user-level packet capture
- libpcap-devel: development library for libpcap
- rrdtool: Time-series data storage and display system (programs)
- rrdtool-devel: Time-series data storage and display system (development)
- perl-rrdtool: Time-series data storage and display system (perl interface)
- graphviz: Graph Visualization Software

First install libpcap, and libpcap-devel using yum
$ sudo yum install libpcap-devel libpcap

The rrdtool, ntop and graphviz packages you can get them like this:


$ wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/rrdtool-devel-1.2.30-1.el5.rf.i386.rpm
$ wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/rrdtool-1.2.30-1.el5.rf.i386.rpm
$ wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/perl-rrdtool-1.2.30-1.el5.rf.i386.rpm
$ wget http://dag.wieers.com/rpm/packages/ntop/ntop-3.3-1.el5.rf.i386.rpm


$ wget http://www.graphviz.org/graphviz-rhel.repo
$ sudo cp graphviz-rhel.repo /etc/yum.repos.d/
$ sudo yum update
$ sudo yum install graphviz


Installing perl-rrdtool, rrdtool, rrdtool-devel and ntop with rpm package manager :
$ sudo rpm -ivh perl-rrdtool-1.2.30-1.el5.rf.i386.rpm rrdtool-1.2.30-1.el5.rf.i386.rpm rrdtool-devel-1.2.30-1.el5.rf.i386.rpm ntop-3.3-1.el5.rf.i386.rpm

Type the following command to set ntop admin password, enter:
$ ntop -A
Sat Jul 4 14:31:49 2009 NOTE: Interface merge enabled by default
Sat Jul 4 14:31:49 2009 Initializing gdbm databases
ntop startup – waiting for user response!
Please enter the password for the admin user:
Please enter the password again:
Sat Jul 4 14:32:24 2009 Admin user password has been set

The following command start ntop:
$ sudo /usr/bin/ntop -d -L -u ntop -P /var/ntop –skip-version-check –use-syslog=daemon -d

If you have many interfaces you can specify them like this :
$ /usr/bin/ntop -i “eth0,eth1? -d -L -u ntop -P /var/ntop –skip-version-check –use-syslog=daemon -d

Well we need to run ntop as services, please refer to /etc/ntop.conf:
$ sudo vim /etc/ntop.conf
–user ntop
–db-file-path /var/ntop
–interface eth0,eth1
–use-syslog
–http-server 3000
–https-server 3001
–local-subnets 192.168.1.0/20
–domain mydomain.org
–daemon

At last start your ntop service:
$ sudo service ntop start

By default ntop listen on 3000 port. You can view ntop stats by visiting following url:
http://server:3000/ or https://server:3001/
as defined in the ntop.conf.

On Debian:
The ntop package is present in the Debian repository, so you can get simply by:
$ aptitude install ntop

Personalize your ntop config file. After, you can start the service :
$ sudo invoke-rc.d ntop start


Saturday 4 April 2009

An Overview of the Linux Operating System - Birth of Linux

The Birth of Linux


On August 25, 1991, a Finn computer science student named Linus Torvalds made the following announcement to the Usenet group comp.os.minux:



I'm doing a (free) operating system (just a hobby,
won't be big and professional like gnu) for 386(486)
AT clones. This has been brewing since april, and is
starting to get ready. I'd like any feedback on things
people like/dislike in minix, as my OS resembles it
somewhat (same physical layout of the file-system
(due to practical reasons) (among other things).

The “Minix” Torvalds referred to is a variant of the UNIX operating system, used as a guideline for his the free operating system he wanted to run on the x86-based consumer PCs of the day. “gnu” refers to the set of GNU (GNU Is Not Unix) tools first put together by Richard Stallman in 1983. UNIX, the operating system that started it all, had its origins in the old Bell Labs back in the early 60s.


Torvalds built the core of the Linux operating system, known as the kernel. A kernel alone does not make an operating system, but Stallman's GNU tools were from a project to create an operating system as well--a project that was missing a kernel to make Stallman's operating system complete. Torvalds' matching of GNU tools with the Linux kernel marked the beginning of the Linux operating system as it is known today.


Linux is in many ways still only at the beginning of its potential, even though it has enjoyed tremendous success since Torvalds' first request for help in 1991.


Linux has gained strong popularity amongst UNIX developers, who like it for its portability to many platforms, its similarity to UNIX, and its free software license. Around the turn of the century, several commercial developers began to distribute Linux, including VA Linux, TurboLinux, Mandrakelinux, Red Hat, and SuSE GMbH. IBM's 2000 decision to invest $2 billion in Linux development and sales was a significant positive event to the growth of Linux.


Today, Linux is a multi-billion dollar industry, with companies and governments around the world taking advantage of the operating system's security and flexibility. Thousands of companies use Linux for day-to-day use, attracted by the lower licensing and support costs. Governments around the world are deploying Linux to save money and time, with some governments commissioning their own versions of Linux.


The analyst group IDC has projected Linux will be a $49 billion business by 2011, and there are many indications in the market that this figure will be achieved.

An Overview of the Linux Operating System, What Is Linux ?

Linux is, in simplest terms, an operating system. It is the software on a computer that enables applications and the computer operator to access the devices on the computer to perform desired functions. The operating system (OS) relays instructions from an application to, for instance, the computer's processor. The processor performs the instructed task, then sends the results back to the application via the operating system.


Explained in these terms, Linux is very similar to other operating systems, such as Windows and OS X.


But something sets Linux apart from these operating systems. The Linux operating system represented a $25 billion ecosystem in 2008. Since its inception in 1991, Linux has grown to become a force in computing, powering everything from the New York Stock Exchange to mobile phones to supercomputers to consumer devices.


As an open operating system, Linux is developed collaboratively, meaning no one company is solely responsible for its development or ongoing support. Companies participating in the Linux economy share research and development costs with their partners and competitors. This spreading of development burden amongst individuals and companies has resulted in a large and efficient ecosystem and unheralded software innovation.

Over 1,000 developers, from at least 100 different companies, contribute to every kernel release. In the past two years alone, over 3,200 developers from 200 companies have contributed to the kernel--which is just one small piece of a Linux distribution.

This article will explore the various components of the Linux operating system, how they are created and work together, the communities of Linux, and Linux's incredible impact on the IT ecosystem.

Where is Linux?


One of the most noted properties of Linux is where it can be used. Windows and OS X are predominantly found on personal computing devices such as desktop and laptop computers. Other operating systems, such as Symbian, are found on small devices such as phones and PDAs, while mainframes and supercomputers found in major academic and corporate labs use specialized operating systems such as AS/400 and the Cray OS.

Linux, which began its existence as a server OS and Has become useful as a desktop OS, can also be used on all of these devices. “From wristwatches to supercomputers,” is the popular description of Linux' capabilities.

An abbreviated list of some of the popular electronic devices Linux is used on today includes:
























Dell Inspiron Mini 9 and 12

Garmin Nuvi 860, 880, and 5000

Google Android Dev Phone 1

HP Mini 1000

Lenovo IdeaPad S9

Motorola MotoRokr EM35 Phone

One Laptop Per Child XO2

Sony Bravia Television

Sony Reader

TiVo Digital Video Recorder

Volvo In-Car Navigation System

Yamaha Motif Keyboard

These are just the most recent examples of Linux-based devices available to consumers worldwide. This actual number of items that use Linux numbers in the thousands. The Linux Foundation is building a centralized database that will list all currently offered Linux-based products, as well as archive those devices that pioneered Linux-based electronics.

Thursday 2 April 2009

Checking or Changing DNS entries on Mac OSX

To check your Personal VPN DNS entries on a Mac OSX computer while connected to SurfBouncer:

1) From the dock, select 'System Preferences'.

2) Click on 'Network'.

3) Select one of the available connections such as 'AirPort', 'Ethernet' and 'PPPoE'.

4) Click on 'Advanced'.

5) Click on 'DNS'.

6) You should see a screen similar to the one below. The DNS servers are listed on the left.

7) Please send a screen shot and repeat for all available connections.



To take a screen shot of this page, Click on:

Command + Shift + 4 and then Space Bar

A camera will appear. Place it over the window and click. The image will be saved to your desktop.

Attach the image in your email back to us.
(Note: The actual DNS servers may be different than the ones shown above.)
To change DNS settings:

1) Exit Tunnelblick

2) From the dock, select 'System Preferences'.

3) Click on 'Network'.

4) Click on the lock in the lower left hand corner to unlock it, if it is locked.

5) Select one of the available connections such as 'AirPort', 'Ethernet' and 'PPPoE'.

6) Click on 'Advanced'.

7) Click on 'DNS'. You should see a screen similar to the one above.

8) Click on the '+' button and enter the new DNS address we provide you.

9) Drag the new addresses to the top of the list. (If there are grayed out addresses they will stay on top but are inactive.)