Wednesday, August 24, 2011

iperf tool for tcp and udp traffic generations


TCP Uplink

CONSOLE:
iperf -s -i 1

STA:
iperf -c [-t 90] -i 1
-------------------------------------
TCP Downlink

CONSOLE:
iperf -c [-t 90]

STA:
iperf -s -i 1
-------------------------------------
Multicast

iperf -c 225.0.0.1 -u -b 80k 92 -i 1

iperf -s -u -b 225.0.0.1 -i 1

Tuesday, August 23, 2011

Are URLs on your servers "case sensitive"?


No, our Web servers do not treat URLs as being case sensitive. This means that your visitors won't see an error page if they follow a link that accidentally points to a file named "mypage.html" on your Web site if the file is actually named "MyPage.html": they'll see the "MyPage.html" file, just as you would expect.
However, there's a little more to it than that. The sections below have more details.

Some background information

We should first explain exactly what we mean by "case sensitive URLs". Some Web servers (usually Unix servers, such as the ones we use) consider URLs to be case-sensitive. That is, they would treat each of the following URLs as referring to a different file:
http://www.example.com/mypage.html
http://www.example.com/MyPage.html
http://www.example.com/MYPAGE.html
http://www.example.com/MYPAGE.HTML
If you visited "http://www.example.com/mypage.html" but the file was actually named "MyPage.html", these kinds of servers would display a "file not found" error.
Other Web servers (mostly Windows servers) would treat all these URLs as requests for the same file, because they use a file system that doesn't care about capitalization. Using an incorrectly capitalized link on these kinds of servers doesn't cause an error.
It's best to avoid this problem by making sure that the capitalization of any URL links matches the capitalization of your file names, ensuring that your files work on any kind of server. However, if you have an existing site, these errors can be difficult to find.

So do these kinds of links work on Tiger Technologies servers?

Yes. Our servers use special software that makes links work even if they contain capitalization errors. In other words, although we use Unix servers for reliability, our servers treat URLs in the same forgiving fashion as Windows servers.
That means that if you're transferring your Web site from a Windows server to Tiger Technologies, you don't need to worry about fixing the capitalization of links to avoid "file not found" errors. If your file is named "MyPage.html" and you have a link referring to "mypage.html", it will work, just as it did on a Windows server.
That's not to say that you shouldn't try to make your links match your file names. For technical reasons, pages that are accessed through miscapitalized links take a little more time to load. The delay is only a few milliseconds, but every little bit helps.

Some technical details

Advanced users may be interested in knowing how URLs can be case insensitive even though Unix servers use a case-sensitive file system. The answer is that we use an Apache Web server module called "mod_speling" (sic), which "fixes" URL requests that don't exactly match an existing file. We have mod_speling configured to look for matches that differ only in terms of case, which almost always "does the right thing".
We should mention that there is a (quite rare) potential issue when relying on mod_speling to fix miscapitalized links, which is that mod_speling does not change the fact that the actual file system can still allow files with different capitalization to exist simultaneously. This can cause subtle problems if you mistakenly upload two files with names that differ only in capitalization.
For example, if you upload a file named "mypage.html", then later upload a file named "MyPage.html", both files will exist on the disk, just as they would on any Unix server. The second upload will not replace the first file as it would on a Windows server. If you then use a link named "mypage.html", you're always going to see "mypage.html", even though you might be expecting to see the new "MyPage.html" file you more recently uploaded. Stranger still, if you use a link that doesn't match either file — say, "MYPAGE.HTML" — you'll appear to get one of the files at random. Again, just make sure that your link capitalization matches the file names you upload to avoid any potential problems.

Thanks to :
http://support.tigertech.net/case-sensitive

How ARP Works

How ARP Works

This article is based off of a series of usenet posts (one in particular) on the alt.certification.network-plus news group. I've done some revision in order to make the whole thing flow as a stand-alone document and I've also made some revisions to the example.

What is ARP?

ARP stands for Address Resolution Protocol. It is used to associate a layer 3 (Network layer) address (such as an IP address) with a layer 2 (Data Link layer) address (MAC address).

Layer 2 vs. Layer 3 addressing

I think where a lot of confusion with ARP comes from is in regards to how the IP address and the MAC address work together. The IP address is a layer 3 (network layer) address. The MAC address is a layer 2 (data link) address. The layer 3 address is a logical address. It will pertain to a single protocol (such as IP, IPX, or Appletalk). The layer 2 address is a physical address. It pertains to the actual hardware interface (NIC) in the computer. A computer can have any number of layer 3 addresses but it will only have 1 layer 2 address per LAN interface. At layer 3, the data is addressed to the host that the data is destined for. At layer 2 though, the data is addressed to the next hop. This is handy because you only need to know a host's layer 3 address (which can be found out by using DNS for instance) but you won't need to know the hardware address (and you won't have to bog down the network by sending an ARP request across the internet to find it out). The layer 3 packet (addressed to the destination host) will be encapsulated within a layer 2 frame (addressed to the next hop).

ARP operation for a local host

Your computer will have data that it needs to send (I'm assuming that we're using TCP/IP from here on). When the data gets to the Network layer it will put on the destination IP address. All of this info (the network layer datagram, aka packet) is passed down to the data link layer where it is taken and placed within a data link frame. Based on the IP address (and the subnet mask), your computer should be able to figure out if the destination IP is a local IP or not. If the IP is local, your computer will look in it's ARP table (a table where the responses to previous ARP requests are cached) to find the MAC address. If it's not there, then your computer will broadcast an ARP request to find out the MAC address for the destination IP. Since this request is broadcast, all machines on the LAN will receive it and examine the contents. If the IP address in the request is their own, they'll reply. On receiving this information, your computer will update it's ARP table to include the new information and will then send out the frame (addressed with the destination host's MAC address).

ARP operation for a remote host

If the IP is not local then the gateway (router) will see this (remember, the ARP request is broadcast so all hosts on the LAN will see the request). The router will look in it's routing table and if it has a route to the destination network, then it will reply with it's own MAC address.
This is only the case if your own computer doesn't know anything about the network topology. In most cases, your computer knows the subnet mask and has a default gateway set. Because of this, your own computer can figure out for itself that the packet is not destined for the local network. Instead, your computer will use the MAC address of the default gateway (which it will either have in it's ARP table or have to send out an ARP request for as outlined above). When the default gateway (router) receives the frame it will see that the MAC address matches it's own, so the frame must be for it. The router will un-encapsulate the data link frame and pass the data part up to the network layer. At the network layer, the router will see that the destination IP address (contained in the header of the IP packet) does not match it's own (remember, the IP address has not been touched at all in this process since your computer created the IP packet). The router will realise that this is a packet that is supposed to be routed. The router will look in it's routing table for the closest match to the destination IP in order to figure out which interface to send the packet out on. When a match is found, the router will create a new data link frame addressed to the next hop (and if the router doesn't know the hardware address for the next hop it will request it using the appropriate means for the technology in question). The data portion of this frame will contain the complete IP packet (where the destination IP address remains unchanged) and is sent out the appropriate interface. This process will continue at each router along the way until the information reaches a router connected to the destination network. It will see that the packet is addressed to a host that's on a directly connected network (the closest match you can get for an address, short of the packet being addressed to you). It will send out an ARP request for MAC address of the destination IP (assuming it doesn't already have it in it's table) and then address it to the destination's MAC address.
Now then, I did slightly gloss over 1 part in the above explanation and that's the part about the router finding out the hardware address for the next hop. I just didn't want to disturb the flow with entering into that there. How the router does this will depend on what type of connection (and in some cases, what protocol and/or encapsulation is used on the connection). In some cases, this will be a hard set value (like a frame relay pvc) within the configuration of the router. In some cases, you don't even need a hardware address (like any point to point connection, there's only 1 possible host you could send it to), in those cases the router will just create a data link frame appropriate for the connection and it won't even need to be addressed. This is why the OSI model is good. It's layered so that any layer can change and as long as it takes in information in a standard way (the way the layer above wants to send it) and spits out information in a standard way (the way the layer below wants to receive it), then it's all good. When Frame Relay came along nothing changed with the way you had to address IP packets, all of the changes took place at the data link and physical layers. If some new type of connection comes along in the future, only the data link and physical layers will likely change. When we go to IPv6, only the network layer should change (it probably won't but that's more to do with how the layers tend to blur, but if it were truly layered that would be the case).

Putting it all together

Anyways, since I feel like doing an example here's one showing the whole process. In the original post, I had used IP addresses from the 10.x.x.x range (which is a reserved range for private networks) with a subnet mask of 255.255.255.0. This seemed to cause some confusion (both because of the misconception that the 10.x.x.x range is non-routable and because I was using a class C subnet mask for a class A network) both of these are valid and would work but I've decided to change this so that I'm using non-reserved (ie, real) IPs from class C networks. I figure that this will help reduce the confusion in this example, and I can clear up the rest in another article or 2. Needless to say then, if you want to try this on your own network, don't connect it to the internet! IP conflicts are just plain evil and can screw up lots of stuff. If you want to try this in a home lab that is connected to the internet then put the whole network behind some kind of a firewall and use the reserved IPs. Or, if you're lucky enough to have a block of real IPs, use them. The bottom line is don't use IPs that haven't been assigned to you on the internet.
Your computer has an address of 200.0.1.2, it's connected to the 200.0.1.0 network (I'm assuming a subnet mask of 255.255.255.0, we'll call this network 1) which is an ethernet network. Your default gateway is a router (router a) which has an address of 200.0.1.1. That router is connected to the 200.0.1.0 network and the 200.0.2.0 (network 2) network (the interface connected to the 200.0.2.0 network will have an address of 200.0.2.1). The network 2 is also an ethernet network. Also connected to network 2 is another router (router b) which has the address (for the interface connected to network 2 at least) of 200.0.2.2. Router b is also connected to network 3 (200.0.3.0). Router b's interface on network 3 has the address of 200.0.3.1. Here's a (probably bad) ASCII diagram to illustrate:
Router        Router
           a             b
-----------O-------------O------------
Network 1    Network 2       Network 3
(200.0.1.0)   (200.0.2.0)      (200.0.3.0)
Now then, your computer (on network 1 with an address of 200.0.1.2) wants to send some data to a computer on network 3 (with an address of 200.0.3.2). We'll assume that none of the info in already cached in an ARP table on any of the machines or routers (a big assumption but it's mine to make!). Your computer will create an IP packet addressed to 200.0.3.2. That packet will be sent to the data link layer where it needs a MAC address. Based on the subnet mask, your computer will know that the destination computer isn't on the same local network. So, your computer will send out an ARP request for the default gateway's MAC address (ie, what's the MAC for 200.0.1.1?). On receiving the MAC address, your computer will send out the IP packet (still addressed to 200.0.3.2) encapsulated within a data link frame that is addressed to the MAC address of router a's interface on network 1 (because routers have more than 1 interface they can have more than 1 MAC address, in this case each router has 2 ethernet interface each with it's own unique MAC address). Router a will receive this frame and send the data portion up to the network layer (layer 3). At the network layer, router a will see that the packet (which is addressed to 200.0.3.2) is not addressed to router a. Router a will look in it's routing table to find out where to send the packet. The routing table will show that network 3 (the closest match to 200.0.3.2) is reachable via network 2. The routing table will also show the IP address for the next hop is 200.0.2.2. Router a will send out an ARP request onto network 2 asking for router b's MAC address (well at least for the interface connected to network 2). On receiving this, router a will send the IP packet (still addressed to 200.0.3.2, nothing's changed here) encapsulated in a data link frame addressed to router b's MAC address. When router b receives this frame it will do the same thing that router a did, it will send the IP packet up to the network layer and see that the packet is not addressed to router b (the packet is still addressed to 200.0.3.2). Router b will then look up in it's routing table for the closest match and see that it is directly connected to network 3, so there isn't a next hop router to send it to. Router b will send out an ARP request to learn the MAC address for 200.0.3.2. When this is received, router b will send out the IP packet (again, this is still addressed to 200.0.3.2) encapsulated within a data link frame that is addressed to the MAC address of the destination computer. The destination computer will see that the data link frame is addressed to it and will pass the IP packet to the network layer. At the network layer, the IP address will also match that of the computer and the data from the IP packet will be passed up to the transport layer. Each layer will examine the header and determine where to pass it up to until eventually, the data reaches the application running on the destination computer that has been waiting for the data.
What you'll notice through this whole process is that the IP address never changes. The IP packet is always addressed to 200.0.3.2. However, at the data link layer, the address used changes at each hop (it's always addressed to the next hop). As you go up through the layers, you get more and more specific about where the data is supposed to be going. At the data link layer this is very vague, it's basically just, "here's who to pass it on to, they should know what to do with it". At the network layer you get more specific (this is the exact computer I want to send this to). Above that you get more specific (is it TCP or UDP?, what port?, etc)

Thanks to :
http://www.tildefrugal.net/tech/arp.php

TCP/IP: The Three-way handshake

TCP/IP: The Three-way handshake
myline
Each and every communication through TCP starts with a procedure called three-way-handshake. Here I'm going to illustrate the process for future reference --- for myself.



three-way-handshake

Here client is shown as active participant and server is shown as passive participant because client initiates (active) a connection to a server which waits (passive) for connetions on a particular port.
The three-way handshae is done in the following process:

  1. The client sends a SYN packet to the server indicating that it wants to set a TCP connection. It also sends ISN (Initial Sequenc Number). Here ISN is x.
  2. If the server is 'alive' and listening on the requested port and can accept an incoming connection, it replies with its own SYN + ACK packet. It sends its own ISN (Initial Sequence Number) (for this connection, y ) and acknowledges the clients request by sending back client's ISN + 1 sequence number (x + 1) .
  3. Finally, after receiving the server's SYN + ACK response, the client sends back an ACK packet with a sequence number of server's ISN + 1 (y + 1) .
Now this is all theory! Let's see whether we can observer a real TCP connection and whether we can identify the three-way-handshake process. We'll be using tcpdump to observe the process. Commands used to capture the TCP communication is:

tcpdump -n -S -t
Here, -n don't convert addresses (i.e., host addresses, port numbers,
	    etc.) to names.
	 -S print absolute, rather than relative, TCP sequence numbers.
	 -t don't print timestamp.
    
192.168.1.12.1051 > 192.168.1.11.23: S 4255483971:4255483971(0) 
                              win 65535  (DF)
    192.168.1.11.23 > 192.168.1.12.1051: S 4279842714:4279842714(0) 
	                           ack 4255483972 win 32120  (DF)
    192.168.1.12.1051 > 192.168.1.11.23: . ack 4279842715 win 65535 (DF)
	 
  1. First line: someone on client (192.168.1.12) is connecting to port 23 (telnet) of server (192.168.1.11). We can see that SYN flag is set (S), followed by:
    4255483971:4255483971(0)

    Here, 4255483971(=x) is the ISN (Initial Sequence Number) and it apears twice separated by ':' because there's no payload (0 in parentheses indicates this).

    win 65535 indicates that the client has a buffer that can hold 65535 bytes.

    mss 1460 indicates that the network on which the client exists can accept a maximum of 1460 bytes payload in a single packet. mss stands for maximum segment size .

    requests that the packet shouldn't be fragmented.

    Interesting fact: though the client has a buffer that can accept 65535 bytes of data, the network cannot accept more than 1460 bytes of payload.
  2. Second line: server replies with a SYN and ACK flagged packet. It also sends its ISN (4279842714=y) and acknowledge number (clinet's ISN + 1 = 4255483972).

    Server's window size is 32120 and maximum segment size is 1460.
  3. Third line: client sends back acknowledgement packet with a sequence number of 4279842715 (server's ISN + 1 = 4279842715).

    Note that this packet has no flag set (`.' indicates that no flags were set).
 Thanks to:
http://www.reocities.com/jchakma/TCPIP/ThreeWayHandshake.html

Wednesday, August 17, 2011

7zip File: How to Uncompress 7z files on Ubuntu, Debian, Fedora


Question: How do I uncompress a *.7z file ( 7zip file ) in UNIX / Linux ? Can you explain with a simple example? Answer: Use 7za command to unzip a 7z file ( 7zip file ) on Unix platform as shown below.

Verify whether you have 7za command on your system.
# whereis 7za
7za: /usr/bin/7za /usr/share/man/man1/7za.1.gz
If you don’t have 7za command, install p7zip package as shown below.

Install p7zip to unzip *.7z files on Fedora

# yum install p7zip

Install p7zip to unzip *.7z files on Debian and Ubuntu

$ sudo apt-get install p7zip

Uncompressing a *.7z 7zip files in Linux using 7za

$ 7za e myfiles.7z 

7-Zip (A) 9.04 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-05-30
p7zip Version 9.04 (locale=C,Utf16=off,HugeFiles=on,1 CPU)

Processing archive: ../../myfiles.7z

Extracting  myfiles/test1
Extracting  myfiles/test2
Extracting  myfiles/test
Extracting  myfiles

Everything is Ok

Folders: 1
Files: 3
Size:       7880
Compressed: 404
  • 7za – command name
  • e – specifies the 7z to be extracted
  • myfiles.7z – is the file that is to be extracted

Creating a 7zip compression file in Linux

$ 7za a myfiles.7z myfiles/

7-Zip (A) 9.04 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-05-30
p7zip Version 9.04 (locale=C,Utf16=off,HugeFiles=on,1 CPU)
Scanning

Creating archive myfiles.7z

Compressing  myfiles/test1
Compressing  myfiles/test2      

Everything is Ok
Files and sub directories of myfiles/ will be added to the myfiles.7z.
  • a – add to archive
  • file.7z – archive file to which these files and dir from dir1 will be added to.

Extracting 7z Files in Linux

Download

The first thing you will need to do is download the p7zip program.
Ubuntu users can do this by typing the following command:
sudo apt-get install p7zip

Extracting

To extract the file just type:
p7zip -d filename.7z
If you are using gnome you should also be able to right click on the file and select extract here.
right-click-7zip
7zip files have great compression ratios and often times offer higher compression than RAR, ZIP and other formats. Enjoy!

Tuesday, August 16, 2011

Install Application of Ubuntu Restricted Extras

Application: Ubuntu Restricted Extras

What it is:

While not strictly an application in the true sense, Ubuntu Restricted
Extras takes care of a number of software and codecs that other Ubuntu
applications may require and that cannot be shipped with Ubuntu for
legal reasons.

To install in Ubuntu:

sudo apt-get install ubuntu-restricted-extras

This will install Java, Flash, some proprietary fonts and a bunch of
codecs, enabling you to view most video files and play your favorite
audio formats and a lot more essential software that you may not use
directly but is important all the same.

To know more about:

https://help.ubuntu.com/community/RestrictedFormats

Wednesday, July 13, 2011

How to downgrade the Kernel in Ubuntu 8.10 the easy way



In case you need to use an older kernel version in your new all shiny Ubuntu 8.10 preloaded with kernel version 2.6.27, there’s a very easy way to do it.
Instead of compiling it yourself and have to build a god forsaken config file for the compilation, you can install a linux-image package from the repositories. If you do a quick
sudo aptitude search linux-image
You can see the fine result:
p   linux-image-2.6.25-2-386 – Linux kernel image for version 2.6.25 on i386
so if you install the package with
sudo aptitude install linux-image-2.6.25-2-386
You’re all set. The kernel will be automatically added to your grub menu.

Thanks to :

Tuesday, July 12, 2011

Low Blood Pressure causes - home remedies

Low blood pressure is a condition takes place when the pressure of blood in the arteries tends to be very low. A consistent blood pressure reading of 90/60 mm Hg or lower is considered low blood pressure.

Symptoms of Low Blood Pressure

Following are the major low blood pressure symptoms:

1. Lethargy
2. Weakness
3. Fatigue
4. Dizziness

Causes of Low Blood Pressure

Following are the major low blood pressure causes:

1. Faulty nutrition
2. Malnutrition
3. Loss of blood
4. Slow bleeding in the gastrointestinal tract, kidneys, or bladder
5. Prolonged disappointment and frustration

Natural Home Remedies for Low Blood Pressure

Following are some of the effective home remedies for low blood pressure:

1. Take a cup of the juice of raw beetroot twice daily. It is one of the most effective home remedies for low blood pressure.
2. You can also hot Epsom salt bath for treating low blood pressure. An Epsom salt bath is prepared by dissolving 1 to 1 ½ kg of commercial Epsom Salt in an ordinary bath of hot water. The patient should remain immersed in the bath for 10 to 20 minutes. This bath should be taken just before retiring to bed
3. Take protein, vitamin C, and all vitamins of the B group to for natural treatment of low blood pressure.

Low Blood Pressure Treatment and Advice

1. Take salty foods and half a teaspoon of salt in water daily.
2. Do regular breathing and other light exercises like walking, swimming and cycling.
3. Avoid overwork, excesses of all kinds, needless worry, and negative thinking.
------------
Causes
There can be plenty of reasons why you may be suffering from low blood pressure.
Dehydration : Drinking enough water is extremely essential for your well-being. If you are one of those who gets dehydrated easily, you must do something about it. One needs to drink more fluids than one loses. If you are one of those who works outdoors, ensure you keep sipping on liquids like nimbu paani. This will help keep the weakness in check.
Pregnancy : If you are pregnant, there's a good chance your pressure might drop. This is normal but get yourself checked if it becomes too frequent.
Heart issues : Some heart problems could cause blood in your body to not circulate properly.
Deficiency of nutrients: A lack of some essential vitamins such as B-12 and iron can lead to anaemia, which is turn can result in low blood pressure.
Solution
- Increase your salt intake: Generally people are told to avoid using too much salt in their diet. For people suffering from low blood pressure, salt can help. Check with your doctor though before turning to salty foods.
- Drink more water: Water is necessary for your basic body functioning. It also helps prevent dehydration. Don't forget to increase your water intake if you're constantly feeling giddy.
Home remedies : Take a cup of the raw beetroot juice twice daily. It is one of the best home remedies for low blood pressure. Drinking a cup of strong black coffee can also help. Some people suggest making a paste of almonds and drinking with lukewarm milk.
Exercise : Include a little exercise in your daily regime. A walk or a quick swim can help circulate the blood.

Thanks to:
http://www.natural-cure-guide.com/home-remedies/low-blood-pressure.htm

Oral Rehydration Solutions: Made at Home


The most effective, least expensive way to manage diarrhoeal dehydration

The "Simple Solution" Do-It-Yourself .... Encouraging self-reliance
Off page linkThe Special Spoon for homemade Oral Rehydration Solutions (ORS) from TALC - Teaching-aids At Low Cost




Facts for Life  »  Diarrhoea  » 
ORS Solution: A special drink for diarrhoea

Key Message 5. 
A child with diarrhoea should receive oral rehydration salts (ORS) solution and a daily zinc supplement for 10–14 days. Diarrhoea medicines are generally ineffective and can be harmful.

Made at home: ORS Solution A special drink for diarrhoea

Give the child a drink made with 6 level teaspoons of sugar and 1/2 level teaspoon of salt dissolved in 1 litre of clean water.

Be very careful to mix the correct amounts. Too much sugar can make the diarrhoea worse. Too much salt can be extremely harmful to the child.

Making the mixture a little too diluted (with more than 1 litre of clean water) is not harmful.


Diarrhoea usually cures itself in three to four days with rehydration (drinking a lot of liquids). The real danger is the loss of liquid and nutrients from the child's body, which can cause dehydration and malnutrition.

A child with diarrhoea should never be given any tablets, antibiotics or other medicines unless prescribed by a trained health worker.

The best treatment for diarrhoea is to (1) drink lots of liquids and oral rehydration salts (ORS), properly mixed with clean water from a safe source, and (2) take zinc tablets or syrup for 10–14 days.
What is ORS? ORS (oral rehydration salts) is a special combination of dry salts that is mixed with safe water. It can help replace the fluids lost due to diarrhoea.
When should ORS be used? When a child has three or more loose stools in a day, begin to give ORS. In addition, for 10–14 days, give children over 6 months of age 20 milligrams of zinc per day (tablet or syrup); give children under 6 months of age 10 milligrams per day (tablet or syrup).
Where can ORS be obtained? In most countries, ORS packets are available from health centres, pharmacies, markets and shops.
How is the ORS drink prepared?
  1. Put the contents of the ORS packet in a clean container. Check the packet for directions and add the correct amount of clean water. Too little water could make the diarrhoea worse.
  2. Add water only. Do not add ORS to milk, soup, fruit juice or soft drinks. Do not add sugar.
  3. Stir well, and feed it to the child from a clean cup. Do not use a bottle.
How much ORS drink to give? Encourage the child to drink as much as possible.
A child under the age of 2 years needs at least 1/4 to 1/2 of a large (250-millilitre) cup of the ORS drink after each watery stool.
A child aged 2 years or older needs at least 1/2 to 1 whole large (250-millilitre) cup of the ORS drink after each watery stool.
What if ORS is not available? Give the child a drink made with 6 level teaspoons of sugar and 1/2 level teaspoon of salt dissolved in 1 litre of clean water.
Be very careful to mix the correct amounts. Too much sugar can make the diarrhoea worse. Too much salt can be extremely harmful to the child.
Making the mixture a little too diluted (with more than 1 litre of clean water) is not harmful.


Diarrhoea usually stops in three or four days.

If it does not stop, consult a trained health worker.

 


»  Download and Print Instructions: Home made Oral Rehydration Salts (ORS) for treating dehydration caused by diarrhoea Download pdf

Oral Rehydration Solutions

To prevent too much liquid being lost from the child's body, an effective oral rehydration solution can be made using ingredients found in almost every household. One of these drinks should be given to the child every time a watery stool is passed.

Ideally these drinks (preferably those that have been boiled) should contain:
  • starches and/or sugars as a source of glucose and energy,
  • some sodium and
  • preferably some potassium.
The following traditional remedies make highly effective oral rehydration solutions and are suitable drinks to prevent a child from losing too much liquid during diarrhoea:
  • Breastmilk
  • Gruels (diluted mixtures of cooked cereals and water)
  • Carrot Soup
  • Rice water  -  Congee
A very suitable and effective simple solution for rehydrating a child can also be made by using salt and sugar, if these ingredients are available.

If possible, add 1/2 cup orange juice or some mashed banana to improve the taste and provide some potassium.

Molasses and other forms of raw sugar can be used instead of white sugar, and these contain more potassium than white sugar.

If none of these drinks is available, other alternatives are:
  • Fresh fruit juice
  • Weak tea
  • Green coconut water
If nothing else is available, give
  • water from the cleanest possible source
    (if possible brought to the boil and then cooled).

Download Instruction Guides in English and Creole

Thanks to Charles R. Staubs, D.O. and Jean Michelet



The "Simple Solution" -  Home made Oral Rehydration Salts (ORS) Recipe

Preparing 1 (one) Litre solution using Salt, Sugar and Water at Home

Mix an oral rehydration solution using the following recipe.

Ingredients:
  • Six (6) level teaspoons of Sugar
     
  • Half (1/2) level teaspoon of Salt
     
  • One Litre of clean drinking or boiled water and then cooled - 5 cupfuls (each cup about 200 ml.)
Preparation Method:
  • Stir the mixture till the salt and sugar dissolve.
Recipe  1: Making a 1 litre ORS solution using Salt, Sugar and Water
 

Effective homemade remedy for watery diarrhea

An efficient and effective homemade remedy to be used when watery diarrhea strikes and is a good substitute for oral rehydration salts:

Ingredients:
  • 1/2 to 1 cup precooked baby rice cereal or 1½ tablespoons of granulated sugar
  • 2 cups of water
  • 1/2 tsp. salt
Instructions:
Mix well the rice cereal (or sugar), water, and salt together until the mixture thickens but is not too thick to drink.

Give the mixture often by spoon and offer the child as much as he or she will accept (every minute if the child will take it).

Continue giving the mixture with the goal of replacing the fluid lost: one cup lost, give a cup. Even if the child is vomiting, the mixture can be offered in small amounts (2-1 tsp.) every few minutes or so.
  • Banana or other non-sweetened mashed fruit can help provide potassium.
     
  • Continue feeding children when they are sick and to continue breastfeeding if the child is being breastfed.



Questions on Solutions made at Home

Q.  How do I measure the Salt and Sugar?

Different countries and different communities use various methods for measuring the salt and sugar.
  • Finger pinch and hand measuring, and the use of local teaspoons can be taught successfully. 
  • A plastic measuring spoon is available from Teaching Aids at Low Cost (TALC) with proportions to make up 200 ml of sugar/salt solution. 
Whatever method is used, people need to be carefully instructed in how to mix and use the solutions.

Do not use too much salt. If the solution has too much salt the child may refuse to drink it. Also, too much salt can, in extreme cases, cause convulsions. Too little salt does no harm but is less effective in preventing dehydration.

A rough guide to the amount of salt is that the solution should taste no saltier than tears.


Q.  How much solution do I feed?


Feed after every loose motion.

Adults and large children should drink at least 3 quarts or liters of ORS a day until they are well.

Each Feeding:
  • For a child under the age of two
    Between a quarter and a half of a large cup
  • For older childrenBetween a half and a whole large cup 
For Severe Dehydration:

Drink sips of the ORS (or give the ORS solution to the conscious dehydrated person) every 5 minutes until urination becomes normal. (It's normal to urinate four or five times a day.)


Q.  How do I feed the solution?
  • Give it slowly, preferably with a teaspoon.
  • If the child vomits it, give it again.
The drink should be given from a cup (feeding bottles are difficult to clean properly). Remember to feed sips of the liquid slowly.


Q.  What if the child vomits?


If the child vomits, wait for ten minutes and then begin again. Continue to try to feed the drink to the child slowly, small sips at a time.

The body will retain some of the fluids and salts needed even though there is vomiting.


Q.  For how long do I feed the liquids?

Extra liquids should be given until the diarrhoea has stopped. This will usually take between three and five days.


Q.  How do I store the ORS solution?

Store the liquid in a cool place. Chilling the ORS may help. If the child still needs ORS after 24 hours, make a fresh solution.


 

10 Things you should know about Rehydrating a child.

  1. Wash your hands with soap and water before preparing solution.
  2. Prepare a solution, in a clean pot, by mixing

    - Six (6) level teaspoons of sugar and Half (1/2) level teaspoon of Salt
        or
    - 1 packet of Oral Rehydration Salts (ORS) 20.5 grams

    mix with
    - One litre of clean drinking or boiled water (after cooled)

    Stir the mixture till all the contents dissolve.
  3. Wash your hands and the baby's hands with soap and water before feeding solution.
  4. Give the sick child as much of the solution as it needs, in small amounts frequently.
  5. Give child alternately other fluids - such as breast milk and juices.
  6. Continue to give solids if child is four months or older.
  7. If the child still needs ORS after 24 hours, make a fresh solution.
  8. ORS does not stop diarrhoea. It prevents the body from drying up. The diarrhoea will stop by itself.
  9. If child vomits, wait ten minutes and give it ORS again. Usually vomiting will stop.
  10. If diarrhoea increases and /or vomiting persists, take child over to a health clinic.

Footnote:


People often refer to home-prepared oral rehydration solutions as "home-brew."  This should be discouraged because the word brew implies:
  • either fermenting which in fact is an obstacle to some home-prepared solutions especially those made with rice-powder
  • or it implies boiling (as in tea) which, especially with sugar and salt or using packets of  ORS, should not be done because it decomposes the sugar, or caramelises.
Thanks to :
http://rehydrate.org/solutions/homemade.htm

Thursday, June 30, 2011

How does massaging relieve muscular pain?

Question by:
R.SARANYARAJ
Coimbatore, Tamil Nadu
 
The muscle consists mainly of muscle fibre, endothelial and arterial vessels which carry blood to the muscles, and nerve endings, which sense the pain. This pain sensation is stimulated by situations like bleeding inside the muscle due to tear of the muscle, prolonged contraction, prolonged stretching, accumulation of metabolic poisons which stimulates the nerve endings etc.
Moreover, the pain signals reach the spinal cord, and from there by a pathway called dorsal column with a junction in the spinal cord, where in exchange of signals are transferred to the dorsal column like a relay race. This exchange is subjected to the quantum of volleys of pain impulses, which can be allowed only to a certain extent.
This is called ‘gate control system'. If the volleys are too much, the gate naturally (physiologically) closes, and refuses to send the impulses to a higher centre, like the thalamus, and parietal brain tissue. The higher centres are only capable of realising the pain, quantum of pain, quality of pain, and the nature of the pain.
If the volleys do not reach the brain, then there is no chance of realising the pain at all. Moreover, there are lots of chemicals which makes the pain feelable, called endorphins, which play a role both for killing the pain and feeling the pain, depending on their chemical structure.
While massaging, the following reactions occur in the muscle: If the massage is gentle, then there is improved vascularity owing to mechanical rub, which carries all the accumulated bad metabolites away from the pain nerve endings.
There is a moderate stretch, hence muscles subsequently relax calmly from the contracted stage. The massage also produces multiple pain signals, which are capable of confusing the dorsal column of brain, due to increased volleys, hence the gate closes, to the higher centres so that pain is not allowed to transmit.
Massage gives a pleasant feeling due to development of good endorphins also in the brain which are capable of suppressing the pain feeling of brain, like morphine ( drug for pain ) like reactions, which stimulates an area called amydaloid in the brain which causes a pleasure sensation to body. 

Answered by:
DR. NAGARAJAN.V.
VN Neuro Care Center
Madurai, Tamil Nadu

Thanks to: thehindu newspaper

Monday, June 20, 2011

How to automate FTP uploads from the Windows Command Line

Windows has included batch files since before it existed… batch files are really old! Old or not, I still find myself frequently creating batch files to help me automate common tasks. One common task is uploading files to a remote FTP server. Here’s the way that I got around it.
First, you will have to create a file called fileup.bat in your windows directory, or at least inside some directory included in your path. You can use the “path” command to see what the current path is.
Inside the batch file, you will want to paste the following:
@echo off
echo user MyUserName> ftpcmd.dat
echo MyPassword>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat SERVERNAME.COM
del ftpcmd.dat
You will want to replace the MyUserName, MyPassword and SERVERNAME.COM with the correct values for your ftp server. What this batch file is doing is scripting the ftp utility using the -s option for the command line utility.
The batch file uses the “echo” command to send text to the ftp server as if you had typed it. In the middle of the file you can add extra commands, potentionally a change directory command:
echo cd /pathname/>>ftpcmd.dat
In order to call this batch file, you will call the batchfile using the fileup.bat name that we gave it, and pass in the name of a file as the parameter. You don’t have to type the .bat part of the filename to make it work, either.
Example:
> fileup FileToUpload.zip
Connected to ftp.myserver.com.
220 Microsoft FTP Service
ftp> user myusername
331 Password required for myusername.
230 User myusername logged in.
ftp> bin
200 Type set to I.
ftp> put FileToUpload.zip
200 PORT command successful.
150 Opening BINARY mode data connection for FileToUpload.zip
226 Transfer complete.
ftp: 106 bytes sent in 0.01Seconds 7.07Kbytes/sec.
ftp> quit
And that’s all there is to it. Now your file should be sitting on the remote server.

Thanks to :

http://www.howtogeek.com/howto/windows/how-to-automate-ftp-uploads-from-the-windows-command-line/

FTP Session and its commands in Windows

Introduction
(Next) (Previous) (Table-of-Contents)

The following information is provided as a reference for the File Transfer Protocol (FTP) commands. This document describes a typical process for an interactive and automated, batch FTP session running on a PC with Windows/2000 and connecting to a UNIX system. This process may vary slightly depending on the hardware and software configurations of the local and remote systems.

An Interactive FTP Session
(Next) (Previous) (Table-of-Contents)

To start an FTP interactive session type "ftp" from a DOS Command window.
C:\> ftp
The DOS prompt should be replaced with the FTP prompt. The FTP program is now running on the local system. A connection (or session) to a remote system has not been established.
The help command or ? (question mark) may be executed without being attached to a remote system and will do a print (usually to the screen) of the FTP commands. The following is a typical result of the help command running on a PC with Windows.
ftp> help
Commands may be abbreviated. Commands are:
!           delete      literal     prompt      send
?           debug       ls          put         status
append      dir         mdelete     pwd         trace
ascii       disconnect  mdir        quit        type
bell        get         mget        quote       user
binary      glob        mkdir       recv        verbose
bye         hash        mls         remotehelp
cd          help        mput        rename
close       lcd         open        rmdir
ftp>
The following commands will establish a connection (or session) by doing a logon between the local FTP program and a remote system.
ftp> open domain.name
Connected to domain.name
220 antigonous FTP server ready.
User (domain.name:(none)): User-Name
331 Password required for user-name
Password: password
230 User user-name logged in.
ftp> 
The following command will change the directory on the remote system.
ftp> cd /web
250 CWD command successful.
ftp> 
The following command will find out the pathname of the current directory on the remote system and display the information.
ftp> pwd
257 "/web" is the current directory.
ftp> 
The following command will set the file transfer mode to ASCII (this is the default and transmits seven bits per byte).
ftp> ascii
200 Type set to A.
ftp> 
The following command will copy a file from the local system to the remote system.
ftp> put d:\simoweb1\filename.txt
200 PORT command successful.
Opening ASCII mode data connection for filename.txt
226 Transfer complete
ftp> 
The following command will set the file transfer mode to binary (the binary mode transfers all eight bits per byte and must be used to transfer non-ASCII files).
ftp> binary
200 Type set to I.
ftp> 
The following command will copy a file from the local system to the remote system.
ftp> put d:\simoweb1\filename.zip

200 PORT command successful.
Opening BINARY mode data connection for filename.zip
226 Transfer complete
ftp> 
The following command will exit the FTP environment (same as "bye").
ftp> quit
221 Goodbye.
When the preceding command is finished the DOS prompt will be displayed.
C:\>
The preceding is a typical process for an interactive FTP session running on a PC with Windows/2000 and connecting to a UNIX system. This process may vary slightly depending on the hardware and software configurations of the local and remote systems.

An Automated, Batch FTP Session
(Next) (Previous) (Table-of-Contents)

The following batch file (UPWIP001.BAT) will start an FTP session and pass the name of a text file (UPWIP001.TXT) to the FTP program. This text file will be processed by the FTP program and each of the statements in the text file will be processed in the sequence they appear.
@echo OFF
echo * *******************************************************************
echo *                   This program is provided by:                    *
echo *                    SimoTime Enterprises, LLC                      *
echo *           (C) Copyright 1987-2001 All Rights Reserved             *
echo *             Web Site URL:   http://www.simotime.com               *
echo *                   e-mail:   helpdesk@simotime.com                 *
echo * *******************************************************************
echo *
echo * This batch and text file illustrate the use of FTP to upload an
echo * ASCII file and an EBCDIC or Binary file. The UPWIP001.BAT file
echo * references UPWIP001.TXT that contains...
echo *
echo *   user
echo *   password
echo *   cd /web
echo *   pwd
echo *   ascii
echo *   put d:\simoweb1\cbltxn01.htm
echo *   binary
echo *   put d:\simoweb1\cbltxn01.zip
echo *   quit
echo *
ftp -s:upwip001.txt www.simotime.com
The following is a listing of the contents of the text file (UPWIP001.TXT).
user
password
cd /web
pwd
ascii
put d:\simoweb1\cbltxn01.htm
binary
put d:\simoweb1\cbltxn01.zip
quit

An FTP Command List
(Next) (Previous) (Table-of-Contents)

The following is a summary of the commonly used FTP Commands.
Command Description
! Preceding a command with the exclamation point will cause the command to execute on the local system instead of the remote system.
? Request assistance or information about the FTP commands. This command does not require a connection to a remote system.
ascii Set the file transfer mode to ASCII (Note: this is the default and transmits seven bits per byte).
bell Turns bell mode on / off. This command does not require a connection to a remote system.
binary Set the file transfer mode to binary (Note: the binary mode transfers all eight bits per byte and must be used to transfer non-ASCII files).
bye Exit the FTP environment (same as quit). This command does not require a connection to a remote system.
cd Change directory on the remote system.
close Terminate a session with another system.
debug Sets debugging on/off. This command does not require a connection to a remote system.
delete Delete (remove) a file in the current remote directory (same as rm in UNIX).
dir Lists the contents of the remote directory.The asterisk (*) and the question mark (?) may be used as wild cards. For example:

dir b* This will display all entries that start with the letter "b". For example, the following will be displayed.
bet, ben, bingo, born, boon, bipartisan, bandit, boy
dir b*n* This will display all entries that start with the letter "b" and have the letter "n" somewhere after the letter "b". For example, the following will be displayed.
ben, bingo, born, boon, bipartisan, bandit
The following will not be displayed.
bet, boy
dir b?n This will display all entries that start with the letter "b", have the letter "n" in the 3rd position and have a three character name. For example, the following will be displayed.
ben
The following will not be displayed.
bet, bingo, born, boon, bipartisan, bandit, boy
dir b?n* This will display all entries that start with the letter "b" and have the letter "n" in the 3rd position. For example, the following will be displayed.
ben, bingo, bandit
The following will not be displayed.
bet, born, boon, bipartisan, boy
get Copy a file from the remote system to the local system.

get filename-1 Copy (or replace) filename-1 from the current remote directory to a file with the same name in the current local directory.
get filename-1 filename-2   Copy (or replace) filename-1 from the current remote directory to filename-2 in the current local directory.
help Request a list of all available FTP commands. This command does not require a connection to a remote system.
lcd Change directory on your local system (same as CD in UNIX).
ls List the names of the files in the current remote directory.
mget Copy multiple files from the remote system to the local system. (Note: You will be prompted for a "y/n" response before copying each file).

mget  *    Copies all the files in the current remote directory to the current local directory, using the same filenames. Note the use of the asterisk (*) as a wild card character.
mkdir Make a new directory within the current remote directory.
mput Copy multiple files from the local system to the remote system. (Note: You will be prompted for a "y/n" response before copying each file).
open Open a connection with another system.
put Copy a file from the local system to the remote system.
pwd Find out the pathname of the current directory on the remote system.
quit Exit the FTP environment (same as "bye"). This command does not require a connection to a remote system.
rmdir Remove (delete) a directory in the current remote directory.
trace Toggles packet tracing. This command does not require a connection to a remote system.

An FTP Extended Command List
(Next) (Previous) (Table-of-Contents)

The following are additional commands that are used when tranferring files between an IBM Mainframe and a Windows or UNIX client swystem. Also, the following includes commands required when working with files containing variable length records.
user
password
CD ..
PWD
VERBOSE
BINARY
LITERAL SITE RDW LRECL=80 RECFM=FB TRACKS PRIMARY=10 SECONDARY=5
PUT c:\SimoDemo\TestLib1\DataFtp1\CARDFILE.DAT SIMOTIME.DATA.CARDFILE
QUIT 

Installing using an RPM file in Ubuntu


If you have an rpm file for a package you wish to install, and if you cannot find a .deb debian package in any of the Ubuntu repositories or elsewhere, you can use the alien package converter application to install the .rpm file.
Alien is a program that converts between the rpm, dpkg, stampede slp, and slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.
Despite the large version number, alien is still (and will probably always be) rather experimental software. It has been used by many people for many years, but there are still many bugs and limitations.
Alien should not be used to replace important system packages, like sysvinit, shared libraries, or other things that are essential for the functioning of your system. Many of these packages are set up differently by Debian and Red Hat, and packages from the different distributions cannot be used interchangably. In general, if you can’t uninstall the package without breaking your system, don’t try to replace it with an alien version.

Instructions for Installing RPM Files Using Alien

Installing Alien

You can install alien itself from the Ubuntu Universe repository by adding the repository to your list of sources and doing:

$sudo apt-get update
$sudo apt-get install alien

Installing the .rpm file

To install the .rpm file, you first need to convert it to a .deb file which can be installed on Ubuntu.
I assume that you downloaded the package to your Desktop (~/Desktop is the directory)
You can convert the .rpm to a .deb by using the following commands.
$cd ~/Desktop
-This will change the directory to your desktop, where you have the .rpm file.
$sudo alien -k name-of-rpm-file.rpm
- This will convert the .rpm to a .deb.
- The “-k” will keep the version number. Otherwise alien adds a “1″ to the version number.
- Tip: Use Smart Tab Completion to avoid mistyping the file names :)
$sudo dpkg -i name-of-deb-file.deb
- This will install the .deb package
Try reading the alien manpage for more details on how to convert other kinds of packages and the options available.

Thursday, June 2, 2011

Virtual MIDI Piano Keyboard

VMPK is a MIDI events generator and receiver

VMPK 0.3.0 VMPK 0.3.0

Introduction

Virtual MIDI Piano Keyboard is a MIDI events generator and receiver. It doesn't produce any sound by itself, but can be used to drive a MIDI synthesizer (either hardware or software, internal or external). You can use the computer's keyboard to play MIDI notes, and also the mouse. You can use the Virtual MIDI Piano Keyboard to display the played MIDI notes from another instrument or MIDI file player. To do so, connect the other MIDI port to the input port of VMPK.
Gymnopédie No. 1 by E. Satie (1866–1925) played by MuseScore and VMPK in Linux
VMPK has been tested in Linux, Windows and Mac OSX, but maybe you can build it also in other systems. If so, please drop a mail to the author.
The Virtual Keyboard by Takashi Iway (vkeybd) has been the inspiration for this one. It is a wonderful piece of software and has served us well for many years. Thanks!
VMPK uses a modern GUI framework: Qt4, that gives excellent features and performance. RtMIDI provides MIDI input/output features. Both frameworks are free and platform independent, available for Linux, Windows and Mac OSX.
The alphanumeric keyboard mapping can be configured from inside the program using the GUI interface, and the settings are stored in XML files. Some maps for Spanish, German and French keyboard layouts are provided, translated from the ones provided by VKeybd.
VMPK can send program changes and controllers to a MIDI synth. The definitions for different standards and devices can be provided as .INS files, the same format used by QTractor and TSE3. It was developed by Cakewalk and used also in Sonar.
This software is in a very early alpha stage. See the TODO file for a list of pending features. Please feel free to contact the author to ask questions, report bugs, and propose new features. You can use the tracking system at SourceForge project site.
Copyright (C) 2008-2010, Pedro Lopez-Cabanillas
Virtual MIDI Piano Keyboard is free software licensed under the terms of the GPL v3 license.
VMPK in Linux VMPK in Mac OSX VMPK in Windows Big VMPK Big VMPK Screenshots gallery

Getting started

MIDI concepts

MIDI is an industry standard to connect musical instruments. It is based on transmitting the actions performed by a musician playing some instrument to another different instrument.  Musical instruments enabled with MIDI interfaces typically have two DIN sockets labeled MIDI IN and MIDI OUT. Sometimes there is a third socket labeled MIDI THRU.  To connect a MIDI instrument to another one, you need a MIDI cable attached to the MIDI OUT socket of the sending instrument, and to the MIDI IN of the receiving one. You can find more information and tutorials like this one all around the Net.
There are also hardware MIDI interfaces for computers, providing MIDI IN and OUT ports, where you can attach MIDI cables to communicate the computer with external MIDI instruments. Without needing hardware interfaces, the computer can also use MIDI software. An example is VMPK, which provides MIDI IN and OUT ports. You can attach virtual MIDI cables to the VMPK's ports, to connect the program to other programs or to the computer's physical MIDI interface ports.  More details about this coming later. You usually want to connect the MIDI output from VMPK to the input of some synthesizer which transforms MIDI into sound. Another common destination for the connection would be a MIDI monitor that translates MIDI events into readable text. This will help you to understand what kind of information is transmitted using the MIDI protocol. In Linux you can try KMidimon and in Windows MIDIOX.
VMPK doesn't produce any sound. You need a MIDI software synthesizer to hear the played notes. I recommend you to try QSynth, a graphical front-end to Fluidsynth. It is also possible to use the "Microsoft GS Wavetable SW Synth" that comes with XP. Of course, an external MIDI hardware synth would be an even better approach.

Keyboard maps and instrument definitions

VMPK can help you to change sounds in your MIDI synthesizer, but only if you provide a definition for the synthesizer sounds first. The definitions are text files with the .INS extension, and the same format used by Qtractor (Linux), and Sonar (Windows).
When you start VMPK the first time, you should open the Preferences dialog and choose a definition file, and then select the instrument name among those provided by the definitions file. There should be one instrument definitions file installed in the VMPK's data directory (typically "/usr/share/vmpk" in Linux, and "C:\Program Files\VMPK" in Windows) named "gmgsxg.ins", containing definitions for the General MIDI, Roland GS and Yamaha XG standards. It is a very simple format, and you can use any text editor to look, change, and create a new one. You can find a library of instruments definitions at the cakewalk ftp server.
Since the release 0.2.5 you can also import Sound Font files (in .SF2 or DLS formats) as instruments definitions, using a dialog available at menu File->Import SoundFont.
Another customization that you may want to tweak is the keyboard mapping. The default layout maps about two and half octaves for the QWERTY alphanumeric keyboard, but there are some more definitions in the data directory, adapted for other international layouts. You can even define your own mapping using a dialog box available in the Edit->Keyboard map menu. There are also options to load and save the maps as XML files. The last loaded map will be remembered the next time you start VMPK. In fact, all your preferences, selected MIDI bank and program, and the controller values will be saved on exit, and restored when you restart VMPK the next time.

MIDI connections and virtual MIDI cables

To connect hardware MIDI devices you need physical MIDI cables. To connect MIDI software you need virtual cables. In Windows you can use some virtual MIDI cable software, like MIDI Yoke, Maple, LoopBe1 or Sony Virtual MIDI Router.
MIDI Yoke setup process will install the driver and a control panel applet to change the number of MIDI ports that will be available (you need to restart the computer after changing this setting). MIDI Yoke works sending every MIDI event written to an OUT port to the corresponding IN port. For instance, VMPK can connect the output to the port 1, and another program like QSynth can read the same events from the port 1.
Using MIDIOX you can add more routes between MIDI Yoke ports and other system MIDI ports. This program also provides other interesting functionalities, like a MIDI file player. You can listen the songs played in a MIDI Synth and at the same time see the played notes (only one channel at a time) in VMPK. To do so, you can use the "Routes" window in MIDIOX to connect the input port 1 to the Windows Synth port. Also, configure the player's MIDI port to send to MIDI Yoke 1. And configure VMPK Input port to read from MIDI Yoke 1. The player will send the events to the out port 1, which will be routed to both the input port 1 and at the same time to the synth port.
In Linux, you have ALSA sequencer to provide the virtual cables. The ports are dynamically created when you start a program, so there is not a fixed number of them like in MIDI Yoke. The command line utility "aconnect" allows to connect and disconnect the virtual MIDI cables between any ports, being hardware interfaces or applications. A nice GUI utility for doing the same is QJackCtl. The main purpose of this program is to control the Jack daemon (start, stop and monitor the state). Jack provides virtual audio cables to connect your sound card ports and audio programs, in a similar way to the MIDI virtual cables, but for digital audio data.
qjackctl connections window QJackCtl connections in Linux

Frequently Asked Questions

How to display 88 keys?

88 is an arbitrary number of keys used by (most) modern piano manufacturers, but organ and synthesizer manufacturers don't always follow this convention. VMPK can be customized to display from 1 to 10 octaves. Using 7 octaves it shows 84 keys, and for 8 octaves it shows 98 keys. There is no way to display exactly 7 and half octaves.

There is no sound

VMPK doesn't produce any sound by itself. You need a MIDI synthesizer, and please read the documentation again.

Some keys are silent

When you select channel 10 on a standard MIDI synth, it plays percussion sounds assigned to many keys but not to all of them. On melodic channels (not channel 10) you can select patches with a limited range of notes. This is known in music as Tessitura.

The "Grab Keyboard" option fails

It is a known issue for Linux users. This feature works well in KDE3/4 desktops using the standard kwin window manager; it also works with Enlightenment and Window Maker, but fails in Metacity and Compiz window managers, common among Gnome setups. It is also known that using this option prevents normal usage of the drop down menus on GTK2 applications. There is no known solution for this issue, except avoiding the broken scenarios if you really need this feature.

Patch names don't match the real sounds

You need to provide an .INS file describing exactly your synthesizer's sound set or soundfont. The included file (gmgsxg.ins) contains definitions for only standard GM, GS and XG instruments. If your MIDI synth doesn't match exactly any of them, you need to get another .INS file, or create it yourself.

Syntax of the Instrument Definition (.INS) files?

One explanation of the INS format is here.

Can I convert my Instrument Definition for vkeybd into an .INS file?

Sure. Use the AWK script "txt2ins.awk". You can even use the utility sftovkb from vkeybd to create an .INS file from any SF2 soundfont, but there is also a function to import the instrument names from SF2 and DLS files in VMPK.
$ sftovkb SF2NAME.sf2 | sort -n -k1,1 -k2,2 > SF2NAME.txt
$ awk -f txt2ins.awk SF2NAME.txt > SF2NAME.ins
You can find the AWK script "txt2ins.awk" installed in the VMPK's data directory.

Download

You can find the latest sources, Windows, and Mac OSX packages at SourceForge project site.
There are also ready to install Linux packages for:
If you distribute VMPK packages for any distro, please drop me an email and I will add a link to your site here.

Installation from sources

Download the sources from http://sourceforge.net/projects/vmpk/files. Unpack the sources in your home directory, and change to the unpacked dir.
$ cd vmpk-x.y.z
You can choose between CMake and Qmake to prepare the build system, but qmake is intended only for testing and development.
$ cmake .
or
$ ccmake .
or
$ qmake
After that, compile the program:
$ make
If the program has been compiled sucessfully, you can install it:
$ sudo make install

Requirements

In order to successfully build and use VMPK, you need Qt 4.4 or newer. (install the -devel package for your system, or download the open source edition from qt.nokia.com, formerly Trolltech.)
RtMIDI is included in the source package. It uses ALSA sequencer in Linux, WinMM in Windows and CoreMIDI in Mac OSX, which are the native MIDI systems in each supported platform.
The build system is based on CMake.
You need also the GCC C++ compiler. MinGW is a Windows port.
Optionally, you can buid a Windows setup program using NSIS.

Notes for windows users

To compile the sources in Windows, you need to download either the .bz2 or .gz archive and uncompress it using any utility that supports the format, like 7-Zip.
To configure the sources, you need qmake (from Qt4) or CMake. You need to set the PATH including the directories for Qt4 binaries, MinGW binaries, and also CMake binaries. The program CMakeSetup.exe is the graphic version of CMake for Windows.

Notes for Mac OSX users

You can find a precompiled universal app bundle, including Qt4 runtime libraries, at the project download area. If you prefer to install from sources, CMake or Qmake can be used to build the application bundle linked to the installed system libraries. You can use Qt4 either from qtsoftware.com or the package distributed by Fink.
The build system is configured to create an universal binary (x86+ppc) into an app bundle. You need the Apple development tools and frameworks, as well as the Qt4 SDK from Nokia.
To compile VMPK using Makefiles, generated by qmake:
$ qmake vmpk.pro -spec macx-g++
$ make
optionally:
$ macdeployqt build/vmpk.app
To compile using Makefiles, generated by CMake:
$ cmake -G "Unix Makefiles" .
$ make
To create Xcode project files:
$ qmake vmpk.pro -spec macx-xcode
or
$ cmake -G Xcode .
If you need something to produce noise, maybe you want to take a look to SimpleSynth, FluidSynth (available from Fink). For MIDI routing, there is also MIDI Patchbay.

Notes for packagers and advanced users

You can ask the compiler for some optimisation when building the program. There are two ways: first, using a predefined build type.
$ cmake . -DCMAKE_BUILD_TYPE=Release
The CMake "Release" type uses the compiler flags: "-O3 -DNDEBUG". Other predefined build types are "Debug", "RelWithDebInfo", and "MinSizeRel". The second way is to choose the compiler flags yourself.
$ export CXXFLAGS="-O2 -march=native -mtune=native -DNDEBUG"
$ cmake .
You need to find the better CXXFLAGS for your own system.
If you want to install the program at some place other than the default (/usr/local) use the following CMake option:
$ cmake . -DCMAKE_INSTALL_PREFIX=/usr
Thanks to:
http://vmpk.sourceforge.net/ 

Monday, May 16, 2011

PCI Express Card and PCI Express Mini Card Connector Pinout

Connector pinout for: PCI Express Card and PCI Express Mini Card

Contents

PCI Express Card

Pin Symbol Type Legend
1 gnd
2 usb d- I/O USB Data
3 usb d+ I/O USB Data
4 cp usb# O Card use USB bus
5 rsvd0 Reserved
6 rsvd1 Reserved
7 smb clk SM Bus Clock
8 smb data SM Bus Data
9 1.5 volt
10 1.5 volt
11 wake# O Wake up main CPU from card
12 3.3 Volt aux Provided when main CPU is off (support for WAKE)
13 pe rst# I Power Good (reset)
14 3.3 Volt
15 3.3 volt
16 clk req# O Clock Request - enable ICS9DB106
17 cp pe# O Card us PCI Express bus
18 refclk- I Clock input from buffer ICS9DB106
19 refclk+ I Clock input from buffer ICS9DB106
20 gnd
21 PERn0 I PCI Express RX -
22 PERp0 I PCI Express RX +
23 gnd
24 PETn0 O PCI Express TX -
25 PETp0 O PCI Express TX +
26 gnd
  • Verified with Congatec design


PCI Express - 1-lane slot

Pin Symbol Type Legend
a01 PRSNT#1 Hot-Plug presence detect
a02 +12V
a03 +12V
a04 gnd
a05 jtag2 JTAG - Clock
a06 jtag3 JTAG - Data In
a07 jtag4 JTAG - Data Out
a08 jtag5 JTAG - Mode Select
a09 3.3 Volt
a10 3.3 Volt
a11 PERST# I Power Good (Reset)
a12 gnd
a13 refclk+ I Clock input from buffer ICS9DB106
a14 refclk- I Clock input from buffer ICS9DB106
a15 gnd
a16 PERp0 I PCI Express RX +
a17 PERn0 I PCI Express RX -
a18 gnd
b01 +12V
b02 +12V
b03 rsvd0 Reserved
b04 gnd
b05 smb clk SM Bus Clock
b06 smb data SM Bus Data
b07 gnd
b08 3.3 Volt
b09 jtag1 JTAG - Reset
b10 3.3 Volt aux Provided when main CPU is off (support for WAKE)
b11 wake# O Wake up main CPU from card
b12 rsvd1 Reserved
b13 gnd
b14 PETp0 O PCI Express TX +
b15 PETn0 O PCI Express TX -
b16 gnd
b17 PRSNT#2 Hot-Plug presence detect
b18 gnd
  • Verified with PCI Express official specification


PCI Express Mini Card

Row Pin Symbol Type Legend Status
0 1 WAKE#
0 3 COEX1 Function is OEM specific changed
0 5 COEX2 Function is OEM specific changed
0 7 CLKREQ# O Request to ICS9DB106 for clock signal, MiniCard can tie to ground. USB-only cards leave this open.
0 9 Gnd
0 11 REFCLK- I Clock input from buffer ICS9DB106
0 13 REFCLK+ I Clock input from buffer ICS9DB106
0 15 Gnd
0 17 Reserved Reserved for future SIM Card pin C8
0 19 Reserved Reserved for future SIM Card pin C4
0 21 Gnd
0 23 PERn0 I PCI Express RX -
0 25 PERp0 I PCI Express RX +
0 27 Gnd
0 29 Gnd
0 31 PETn0 O PCI Express TX -
0 33 PETp0 O PCI Express TX +
0 35 Gnd
0 37 Gnd changed
0 39 3.3Vaux changed
0 41 3.3Vaux changed
0 43 Gnd changed
0 45 Reserved
0 47 Reserved
0 49 Reserved
0 51 Reserved
1 2 3.3 Vaux changed
1 4 Gnd
1 6 1.5 Volt
1 8 UIM PWR O SIM Card
1 10 UIM_DATA I/O SIM Card
1 12 UIM_CLK O SIM Card
1 14 UIM_RESET O SIM Card
1 16 UIM_VPP O SIM Card
1 18 Gnd
1 20 W_DISABLE# I Wireless disable (active low) changed
1 22 PERST# I Power Good (Reset)
1 24 3.3Vaux
1 26 Gnd
1 28 1.5Volt
1 30 SMB CLK I SM Bus Clock
1 32 SMB Data I/O SM Bus Data
1 34 Gnd
1 36 USB_D- I/O USB Data
1 38 USB_D+ I/O USB Data
1 40 Gnd
1 42 LED_WWAN# O Active low, max 9mA
1 44 LED_WLAN# O Active low, max 9mA
1 46 LED_WPAN# O Active low, max 9mA
1 48 1.5Volt
1 50 Gnd
1 52 3.3Vaux changed
  • Verified with PCI Express™ Mini Card Electromechanical Specification, 1.0, with ECN


PCI Express Cards - Compare Electrical Interfaces

Signal ExpressCard Express Slot Express Mini Type Legend
PERn0 Yes Yes Yes I PCI Express RX -
PERp0 Yes Yes Yes I PCI Express RX +
PERST# Yes Yes Yes I Reset (Power Good)
PETn0 Yes Yes Yes O PCI Express TX -
PETp0 Yes Yes Yes O PCI Express TX +
refclk- Yes Yes Yes I Clock input from buffer ICS9DB106
refclk+ Yes Yes Yes I Clock input from buffer ICS9DB106
smb clk Yes Yes Yes I SM Bus Clock
smb data Yes Yes Yes I/O SM Bus Data
wake# Yes Yes Yes O Wake up main CPU from card
CLKREQ# Yes Yes O Clock Request - enable ICS9DB106
usb d- Yes Yes I/O USB Data
usb d+ Yes Yes I/O USB Data
cp pe# Yes O Card us PCI Express bus
cp usb# Yes O Card use USB bus
COEX1 Yes Function is OEM specific
COEX2 Yes Function is OEM specific
LED_WLAN# Yes O Active low, max 9mA
LED_WPAN# Yes O Active low, max 9mA
LED_WWAN# Yes O Active low, max 9mA
UIM PWR Yes O SIM Card
UIM_CLK Yes O SIM Card
UIM_DATA Yes I/O SIM Card
UIM_RESET Yes O SIM Card
UIM_VPP Yes O SIM Card
W_DISABLE# Yes I Wireless disable (active low)
PRSNT#1 Yes I Hot-Plug presence detect
PRSNT#2 Yes O Hot-Plug presence detect
jtag1 Yes I JTAG - Reset
jtag2 Yes I JTAG - Clock
jtag3 Yes I JTAG - Data In
jtag4 Yes O JTAG - Data Out
jtag5 Yes I JTAG - Mode Select
+12V Yes pwr Power 12 Volt
1.5 Volt Yes Yes pwr Power 1.5 Volt
3.3 Volt Yes Yes pwr Power 3.3 Volt
3.3 Volt aux Yes Yes Yes pwr Power 3.3 Volt, also present if main CPU is off, support for WAKE#
GND Yes Yes Yes pwr Ground


References

http://www.allpinouts.org/index.php/PCI_Express_Card_and_PCI_Express_Mini_Card 

-----------

Mini PCI Express Bus Description

A Brief Description of the MiniCard interface. MiniCard is also called Mini PCI Express bus [PCI= Peripheral Component Interface]. The Minicard is a small form factor board used to implement the PCI Express interface on Notebook computers. The card size is 30mm wide by 50.95mm long by 5mm high. The Minicard uses a 52-pin card edge connector, the card pins are fingers at the edge of the card. MiniCard is used to implement both the 1x PCI Express Bus interface and a USB 2.0 interface.

Mini PCI Express Bus Interface IC Manufacturers

Refer to the main PCI Express Bus for a list of manufacturers producing interface IC's
Like other PC buses, there are no glue logic devices just ASICs and chip sets in PCI Express; Similar to PCI. Refer to the LVDS page for additional information on the LVDS electrical interface. This page provides a comparison of Interface Switching levels for different types of electrical standards.

Mini-PCI Express Online Standards and Specifications

PCI: The original specification 'Peripheral Component Interface', [parallel interface]
PCI Express Bus: [used in desktop computers, the physical layer is not compatible with the PCI bus]
PCIe Mini Card Electromechanical Specification [used in Notebook/Laptop computers]

PCISIG {Peripheral Component Interconnect - Special Interest Group}

Mini PCI Express Connector Manufacturers

A Mini-PCI Express connector accepts a 52-pin card edge with one key slot. The Board has fingers at the card edge, the card key is an absence of fingers.

Mini PCI Express Pinout

MiniPCIe Implementation
Mini PCI Express

The Mini-PCI Express 52-pin connector pin out is listed below. I still need to verify the pin out table for errors.
MiniCard Pinout
Pin # Signal Name Pin # Signal Name
51 Reserved 52 +3.3V
49 50 GND
47 48 +1.5V
45 46 LED_WPAN#
43 44 LED_WLAN#
41 42 LED_WWAN#
39 40 GND
37 38 USB_D+
35 GND 36 USB_D-
33 PETp0 34 GND
31 PETn0 32 SMB_DATA
29 GND 30 SMB_CLK
27 GND 28 +1.5V
25 PERp0 26 GND
23 PERn0 24 +3.3Vaux
21 GND 22 PERST#
19 Reserved (UIM_C4) 20 Reserved
17 Reserved (UIM_C8) 18 GND
Mechanical Key
15 GND 16 UIM_VPP
13 REFCLK+ 14 UIM_RESET
11 REFCLK- 12 UIM_CLK
9 GND 10 UIM_DATA
7 CLKREQ# 8 UIM_PWR
5 Reserved 6 1.5V
3 Reserved 4 GND
1 WAKE# 2 3.3V

http://www.interfacebus.com/Mini_PCI_Express_Bus.html

-----------------------------------------------------------------------------

PCI Express Mini Card

Introduced in 2003. Smaller version of PCI Express, intended for notebook computers.

Pinout

Pin Name Pin Name
51 Reserved 52 +3.3Vaux
49 Reserved 50 GND
47 Reserved 48 +1.5V
45 Reserved 46 LED_WPAN#
43 GND 44 LED_WLAN#
41 +3.3Vaux 42 LED_WWAN#
39 +3.3Vaux 40 GND
37 GND 38 USB_D+
35 GND 36 USB_D-
33 PETp0 34 GND
31 PETn0 32 SMB_DATA
29 GND 30 SMB_CLK
27 GND 28 +1.5V
25 PERp0 26 GND
23 PERn0 24 +3.3Vaux
21 GND 22 PERST#
19 Reserved (UIM_C4) 20 W_DISABLE#
17 Reserved (UIM_C8) 18 GND
Mechanical Key
15 GND 16 UIM_VPP
13 REFCLK+ 14 UIM_RESET
11 REFCLK- 12 UIM_CLK
9 GND 10 UIM_DATA
7 CLKREQ# 8 UIM_PWR
5 COEX2 6 1.5V
3 COEX1 4 GND
1 WAKE# 2 3.3Vaux
Note: Pin 17 & 19 are reserved for future UIM interface (if needed).
http://www.hardwarebook.info/PCI_Express_Mini_Card 
----------------------------------------------------------------------------------------------

PCI Express Mini Card (also known as Mini PCI Express, Mini PCIe, and Mini PCI-E) is a replacement for the Mini PCI form factor based on PCI Express. It is developed by the PCI-SIG. The host device supports both PCI Express and USB 2.0 connectivity, and each card uses whichever the designer feels most appropriate to the task. Most laptop computers built after 2005 are based on PCI Express and can have several Mini Card slots.



Top side Bottom side
1   2 3.3V
3 Reserved**** 4 GND
5 Reserved**** 6
1.5V
7 CLKREQ# 8 Reserved**
9 GND 10 Reserved**
11 REFCLK- 12 Reserved**
13 REFCLK+ 14 Reserved**
15   16 Reserved**
Mechanical key
17 Reserved 18 GND
19 Reserved 20 Reserved***
21 GND 22 PERST#
23 PERn0 24 +3.3Vaux
25 PERp0 26 GND
27 GND 28 +1.5V
29 GND 30 SMB_CLK
31 PETn0 32 SMB_DATA
33 PETp0 34 GND
35 GND 36 USB_D-
37 Reserved* 38 USB_D+
39 Reserved* 40 GND
41 Reserved* 42 LED_WWAN#
43 Reserved* 44 LED_WLAN#
45 Reserved* 46 LED_WPAN#
47 Reserved* 48 +1.5V
49 Reserved* 50 GND
51 Reserved* 52 +3.3V
*Reserved for future second PCI Express Lane (if needed)
**Reserved for future Subscriber Identity Module (SIM) interface (if needed)
***Reserved for future wireless disable signal (if needed)
****Reserved for future wireless coexistence control interface (if needed)

http://pinoutsguide.com/Slots/mini_pcie_pinout.shtml