To get your public IP you can use websites like www.whatismypublicip.com/Â or just google for it (http://lmgtfy.com/?q=public+ip)
But you can also get your public IP via the following Linux shell  command (the smart way :-D):
$> curl ifconfig.me/all
This gives you an output like that:
ip_addr: 31.18.198.134 remote_host: ip123456.dynamic.kabel-deutschland.de user_agent: curl/7.35.0 port: 47745 lang: connection: keep_alive: encoding: mime: */* charset: via: forwarded:
Or for IP address only output:
$> curl ifconfig.me/ip
Example output:
31.32.33.242
To install curl you have to run:
$> sudo apt-get install curl
Under CentOs you can call:
$> /sbin/ifconfig
another easy one is:
dig +short myip.opendns.com @resolver1.opendns.com