RSS Amplifier

dhilst · Jul 2, 2019

Get your internet IP with this oneliner

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Long time since the last post. Let’s go straight to the point. Ofter we need to know or IP. I got a ISP that loves to change my IP ofentenly. After googling what is my ip for hundren of times I decided to take a better approach Well https://myip.com has an API that is really easy to consume. This oneliner help me lot: curl https://api.myip.com -s | perl -lane 'print $1 if /"ip":"(.*?)"/g' You can…

Long time since the last post. Let’s go straight to the point. Ofter we need to know or IP. I got a ISP that loves to change my IP ofentenly. After googling what is my ip for hundren of times I decided to take a better approach

Well https://myip.com has an API that is really easy to consume. This oneliner help me lot:

curl https://api.myip.com -s | perl -lane 'print $1 if /"ip":"(.*?)"/g'

You can save it as a function

myip() { curl https://api.myip.com -s | perl -lane 'print $1 if /"ip":"(.*?)"/g'; }

And this will save you a lot of boring googling

Cheers,

Read on dhilst.github.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.