I was having some issues involving losing connectivity to a system of mine
due to a dynamic IP. Normally one would just use a dynamic DNS service to
solve the problem, but in this case there were complications that kept that
from being a solution.
So that’s where
Python
comes in. I threw this “solution” (It’s in quotes for a reason) together,
which goes to
my own rudimentary IP-finding site, pulls my address, and returns it to me. Here’s the code:
import urllibimport resite =
urllib.urlopen(“https://danielmiessler.com/ip”).read()grab =
re.findall(‘d{2,3}.d{2,3}.d{2,3}.d{2,3}’,site)address = grab[0]print address
So then in cron.hourly (Gentoo) I can do:
/usr/bin/address | mailx -s “New IP” me@mysecondaddress &>
/etc/cron_output
It’s nasty, but it works. 🙂
[ Jul 15, 2005 ]
A low-back one-piece swimsuit is one of those classic silhouettes that cues confidence. It’s unfussy…
The last New Moon of spring is going to rock our worlds amazingly. For the…
Welcome to Money Diaries where we are tackling the ever-present taboo that is money. We’re…
Year in and year out, the most popular summer nail colors have one thing in…
Finding the perfect skin tint takes a lot of trial and error. A good one…
Any seasoned online shopper will have Memorial Day weekend bookmarked on their calendar. The long…
Leave a Comment