Musings of an aging computer nerd hitting 0x32
Articles

read more
Day 294 coffee froth 365

via Instagram ift.tt/L6JKK9 January 15, 2014 at 10:16PM http://flic.kr/p/jeSzv9, January 15, 2014 at 10:18PM
Articles

read more
Day 293 Canal lights 365

via Instagram ift.tt/1dNSjkc January 14, 2014 at 08:25PM http://flic.kr/p/jdf5gW, January 14, 2014 at 08:28PM
Articles

read more
Day 292 Leeds walk about 365

via Instagram ift.tt/KWyXSO January 13, 2014 at 09:14PM http://flic.kr/p/jbM1ab, January 13, 2014 at 09:21PM
Articles
read more
No static external IP on Raspberry Pi
My Internet provider doesn't supply me with a static IP address with my broadband, so my Raspberry Pi external web address can wander if my router or connectigets reset. There are third party sites which will provide you with a static URL which follows your wandering IP address but its fun to do it yourself.
To keep me updated on the current IP I wrote a Ruby script which I run via crontab to check and Tweet me is the IP address changes.
You can clone the script at Github https://github.com/alastairhm/myip it uses a Ruby Twitter API library which can be found at https://github.com/sferik/twitter to do the direct message with the new IP.
Full details about getting your Twitter API keys can be found at https://dev.twitter.com/
Doodle's Geek Monkey by Alastair Montgomery
To keep me updated on the current IP I wrote a Ruby script which I run via crontab to check and Tweet me is the IP address changes.
#!/usr/bin/rubyrequire 'open-uri'require 'twitter'twitDM = "twitter_username"remote_ip = open('http://whatismyip.akamai.com').readold_ip = File.open('remote_ip.txt', 'r').readif (remote_ip != old_ip) thenFile.open('remote_ip.txt', "w") { |file| file.write(remote_ip)}client = Twitter::REST::Client.new do |config|config.consumer_key = "xxxx"config.consumer_secret = "xxxx"config.access_token = "xxxx"config.access_token_secret = "xxxx"endclient.update("D #{twitDM} My IP address is now #{remote_ip}")elseputs "IP addresses match"end
You can clone the script at Github https://github.com/alastairhm/myip it uses a Ruby Twitter API library which can be found at https://github.com/sferik/twitter to do the direct message with the new IP.
Full details about getting your Twitter API keys can be found at https://dev.twitter.com/
Doodle's Geek Monkey by Alastair Montgomery





