Incentive Pay Considered Harmful – Joel on Software

August 18th, 2014
A good old Joel article on why you shouldn't not treat your engineers like pre-K kids.

Incentive Pay Considered Harmful – Joel on Software

August 18th, 2014
A good old Joel article on why you shouldn't not treat your engineers like pre-K kids.

The Web never forgets: Persistent tracking mechanisms in the wild

July 29th, 2014

The Web never forgets: Persistent tracking mechanisms in the wild

July 29th, 2014

4-20 in Santa Monica Mountains

April 25th, 2014


Sullivan Ridge and Backbone Trail Loop

( Sullivan Ridge Fire road, Mulholland road, Fireroad 30 to The Hub, Backbone trail, J-Drop & back to Sullivan Ridge fire road )

My first GoPro cut!

4-20 in Santa Monica Mountains

April 25th, 2014


Sullivan Ridge and Backbone Trail Loop

( Sullivan Ridge Fire road, Mulholland road, Fireroad 30 to The Hub, Backbone trail, J-Drop & back to Sullivan Ridge fire road )

My first GoPro cut!

The Presenter Manifesto : 8 Distinctions of a World Class Presenter…

October 15th, 2013

The Presenter Manifesto : 8 Distinctions of a World Class Presenter…

October 15th, 2013

The Presenter Manifesto : 8 Distinctions of a World Class Presenter…

October 15th, 2013

Mikrotik + ClouldFlare = DynDNS

October 6th, 2013
At times I want to reach my home computer, so I had a dynamic DNS service that keeps a DNS record ( like myhomeip.dyndns.org) in sync with your home IP address that changes from time to time.

I got fed up with free service from DynDNS: your record will disappear in 30 days unless you login into their site and "confirm" it. DynDNS annoys you on purpose, so you buy their "pro" service. I do not like being annoyed, and I do not see a point of paying for DynDNS service -- their value proposition is weak, as anyone can create a script that updates DNS records.

I have a website that is protected by ClouldFlare service. ClouldFlare offers an API that can be used to update DNS records, so I wrote a script for Mikrotik RouterOS that does just that.



Note that you need RouterOS v6 ( as fetch command supports https only since version 6.0rc12


##############Script Settings##################

:local CFemail "clouldflare email login "
:local CFtkn "api access token"
:local CFzone "clouldflare website, example: example.com"
:local CFid "dns record id, available via rec_load_all API call, example: 12345"
:local CFtype "A"
:local CFttl "300"
:local CFservicemode "0"
:local CFDomain "FQDN DNS record that you will be updating, example: myhomeip.exmaple.com"

############## Build CF API Url ################
:local CFurl "https://www.cloudflare.com/api_json.html\3F"
:set CFurl ($CFurl . "a=rec_edit&tkn=$CFtkn&id=$CFid");
:set CFurl ($CFurl . "&email=$CFemail&z=$CFzone&type=$CFtype");
:set CFurl ($CFurl . "&name=$CFDomain&service_mode=$CFservicemode&ttl=$CFttl");

:local WANInter "name of the outing network interface on mikrotik router, example: ether1-gateway"

###############################################

:local IpCurrent [/ip address get [find interface=$WANInter] address];
:for i from=( [:len $IpCurrent] - 1) to=0 do={
:if ( [:pick $IpCurrent $i] = "/") do={
:local NewIP [:pick $IpCurrent 0 $i];
:if ([:resolve $CFDomain] != $NewIP) do={
:log info "Will update: $NewIP"
/tool fetch mode=https url="$CFurl&content=$NewIP" keep-result=no
:log info "CF Update: $CFDomain - $NewIP"
}
}
}





http://www.cloudflare.com/docs/client-api.html
http://wiki.mikrotik.com/wiki/Manual:Scripting