Get you ip address like whatismyip.com

2008-11-30 2 min read Bash Uncategorized

For last couple of days, I was thinking of putting this. I was thinking of some way to get the IP address of the client directly rather than going through some site or parsing the content. So <a href="http://amit-agarwal.co.in/mystuff/getip.php" target="_blank">here it is.

Now the trick here is simple. There are two ways to get the IP address of the client in the php script and thus a simple script like the below would capture both of them.

Continue reading

parse and paste text

0001-01-01 1 min read Bash

Lot of times, I copy the text but before pasting want to remove a word or make some other changes or add “wget” to the URL, quite common. So, I came up with this alias

replace='echo $(xclip -i)|sed 's/text//'|xclip -o'

and this depends on xlip, which you can install with

 

dnf install xclip
Newer posts