If you want to disable ping response in your ubuntu to protect your machine.You can try following commands in terminal.

First of all,open up a terminal window from Applications->Accessories menu and run this to get super user privilege:

sudo -i

Then:
Method 1:
run this command to disable ping response:

echo  1  > /proc/sys/net/ipv4/icmp_echo_ignore_all

and you can type this to re-enable:

echo  0  > /proc/sys/net/ipv4/icmp_echo_ignore_all

Method 2:
run this to disable ping response:

iptables  -I  INPUT  -i  ech0  -p   icmp  -s  0/0  -d  0/0   -j  DROP

and this to allow ping response:

iptables  -I  INPUT  -i  ech0  -p   icmp  -s  0/0  -d  0/0   -j  ACCEPT

Hope this help!