Skip to content

Instantly share code, notes, and snippets.

@slumos
Created January 20, 2012 19:44
Show Gist options
  • Select an option

  • Save slumos/1649188 to your computer and use it in GitHub Desktop.

Select an option

Save slumos/1649188 to your computer and use it in GitHub Desktop.
Generate a cron offset from an IP address (puppet template)
<%
seed = IPAddr.new(ipaddress).to_i
minutes_offset = (seed % 60) * 2
hour = (minutes_offset / 60) % 24
minute = minutes_offset % 60
-%>
<%= minute %> <%= hour %> * * * the-job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment