Skip to content

Instantly share code, notes, and snippets.

@klittlepage
klittlepage / subset_sum.py
Created August 2, 2016 05:20
A pythonic example of solving the subset sum problem in pseudo polynomial time via dynamic programming
#!/usr/bin/env python
"""
A pythonic example of solving the subset sum problem in pseudo polynomial time
via dynamic programming.
"""
def subset_sum(integers, target_sum=0):
"""
Returns a boolean indicating whether the given list of integers contains a
@klittlepage
klittlepage / ddclient.conf
Last active June 4, 2021 13:23
A ddclient config file for use with Cloudflare. See https://gist.github.com/klittlepage/7243505 for a Cloudflare patch to the 3.8.1 version of ddclient.
daemon=1800 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=root # mail all msgs to root
mail-failure=root # mail failed update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
ssl=yes # use ssl-support. Works with
# ssl-library
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
cache=/tmp/ddclient.cache
@klittlepage
klittlepage / ddclient-3.8.1-cloudflare-30-10-2013.patch
Created October 31, 2013 02:25
A patch for ddclient 3.8.1 based off of http://blog.peter-r.co.uk/cloudflare-ddclient-patch.html to add support for Cloudflare. Note: this patch sets SSL_verify_mode => SSL_VERIFY_NONE() in the interest of getting things working on a freenas box short of tinkering with the distribution's certificate bundle (The Right Way). See line 132. A sample…
--- ddclient-3.8.1/ddclient 2011-07-11 15:04:21.000000000 -0600
+++ ddclient 2013-10-30 19:51:54.056629680 -0600
@@ -1,4 +1,3 @@
-#!/usr/bin/perl -w
#!/usr/local/bin/perl -w
######################################################################
# $Id: ddclient 130 2011-07-11 21:02:07Z wimpunk $
@@ -13,12 +12,18 @@
# Support for multiple IP numbers added by
# Astaro AG, Ingo Schwarze <ischwarze-OOs/4mkCeqbQT0dZR+AlfA@public.gmane.org> September 16, 2008

Keybase proof

I hereby claim:

  • I am klittlepage on github.
  • I am klittlepage (https://keybase.io/klittlepage) on keybase.
  • I have a public key whose fingerprint is 4637 1022 13BB E1A0 9801 A960 B601 7485 726C 9B4C

To claim this, I am signing this object: