Skip to content

Instantly share code, notes, and snippets.

View dogsbody's full-sized avatar

Dan Benton dogsbody

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dogsbody on github.
  • I am dogsbody (https://keybase.io/dogsbody) on keybase.
  • I have a public key ASAOE7I8ELv7xf2g5HKVPneSAE0lM19uwc8HYbwo9UV9Ago

To claim this, I am signing this object:

@dogsbody
dogsbody / uk_public_holidays.py
Created January 26, 2018 11:07
UK public holidays in Python
from dateutil import rrule
from datetime import date, timedelta, datetime
def get_holidays(a=date.today(), b=date.today()+timedelta(days=365)):
rs = rrule.rruleset()
# Include all potential holidays
rs.rrule(rrule.rrule(rrule.YEARLY, dtstart=a, until=b, bymonth= 1, bymonthday= 1)) # New Years Day
rs.rrule(rrule.rrule(rrule.YEARLY, dtstart=a, until=b, bymonth= 1, bymonthday= 2, byweekday=rrule.MO)) # New Years Day
@dogsbody
dogsbody / zpanel.sh
Last active December 23, 2015 19:29
Script to install zpanel on a OVH VPS
#!/bin/bash
echo "Cleaning up OVH install"
TEMPFILE=`mktemp`
grep -v exclude= /etc/yum.conf > $TEMPFILE
if [ ! -f /etc/yum.conf.orig ]
then
cp /etc/yum.conf /etc/yum.conf.orig
fi
mv $TEMPFILE /etc/yum.conf
@dogsbody
dogsbody / dns-secondaries.sh
Created May 24, 2012 22:17
Create a file from BlueOnyx of all the primary domains hosted to push to a secondary
#!/bin/sh
##############################################################################
# #
# Pushes all the domains to the secondary servers #
# Version 1.20 #
# Lasted Edited on 24 May 2012 #
# Contact Dan Benton at [email protected] #
# Or visit me at http://www.dogsbodytechnology.com/ #
# #