Skip to content

Instantly share code, notes, and snippets.

View mchesterkadwell's full-sized avatar

Mary Chester-Kadwell mchesterkadwell

View GitHub Profile
@mchesterkadwell
mchesterkadwell / inspector.py
Last active February 21, 2020 13:08
Inspect a Python object for name, type, class, id, value, if callable, attributes and doc
def inspect(item, dir_=False):
print('--------------------------')
if hasattr(item, '__name__'):
print('Name: '), item.__name__
print(f'Type: {type(item)}'),
if hasattr(item, '__class__'):
print(f'Class: {item.__class__.__name__}')
print(f'Id: {id(item)}')
print(f'Value: {repr(item)}'),
print(f'Callable: {callable(item)}')
@mchesterkadwell
mchesterkadwell / ul-dev-feb-19.txt
Created February 25, 2019 09:56
Experienced Software Developer Feb 2019
Experienced Software Developer - fixed term
An exciting opportunity for an experienced software developer to join an ambitious programme reimagining how the Cambridge University Libraries will archive, preserve and provide access to its treasures for the future.
Job title: Senior Software Developer
Location: Cambridge
Salary: £36,261-£48,677
Reference: VE17544
You will work in an Agile development team and collaborate with academic and non-technical stakeholders. You will be involved in a wide range of projects including implementing a new Archives Management system, building the next generation Digital Library, creating a new Search and Discovery platform and establishing new Digital Preservation capabilities.
@mchesterkadwell
mchesterkadwell / checkchecksum.sh
Created April 4, 2018 08:23
Checks the sha256 checksum of a file against the official checksum provided by the owner
#!/bin/bash
# Quick hack to check the sha256 checksum of a file against the official checksum provided by a vendor
# Apols, code not blessed with an overabundance of checking inputs
# To run as a shell script don't forget to make executable
if [ "$#" -eq "2" ]; then
filename=$1
official_hash=$2
@mchesterkadwell
mchesterkadwell / check-domains.sh
Created April 4, 2018 08:17
Check TSL certificate expiry for a list of domains
#!/bin/bash
#You need to create a file domain_list.txt with a list of domains to check
#Outputs domain and certificate expiry to stdout and a file
#To run as a shell script don't forget to make executable
cat domain_list.txt | xargs -I% sh -c 'echo -n "%, "; echo | openssl s_client -connect %:443 2> /dev/null | openssl x509 -noout -enddate' | tee domain_expiry_check_`date +%d-%m-%Y`.txt
2517,"if @USCongress_GTA doesn't Act Soon, Summer is Coming & even Roman Empire only lasted 300 years, USA is 270ish ehh? Rot within & Barbarians ","Roman Empire, USA"
2516,If #Christ were alive today he'd be jailed in #GuantanamoBay. He was executed by the Roman Empire - a system now exemplified by the USA.,"Roman Empire, USA"
577,If #indyref2 goes ahead can Donald Trump get the Mexicans to raise and thicken Hadrian's wall?,"Hadrian, Trump"
4601,If 2016 US election = The Fall Of the Roman Empire then Trump = Caligula!,"Roman Empire, Trump"
578,"If after Brexit Scotland gains independence & joins EU, we'll need to rebuild Hadrian's Wall (a la Trump) to keep EU hordes from invading.","Hadrian, Trump"
4613,"If America = Roman Empire in decline,\nthen @GOP = barbarians at the gate...and Trump just kicked the gate down.","Roman Empire, Trump"
4621,"If America is currently mimicking the fall of the Roman Empire, is Trump potentially the new Nero? #Trump","Roman Empire, Trump"
4631,If America is like the Roman Empi
@mchesterkadwell
mchesterkadwell / faceDetectionPython3-a.py
Created April 16, 2017 21:16
Python 3 face detector with comments & changes
#!/usr/bin/env python
from SPARQLWrapper import SPARQLWrapper, JSON
import urllib.request, urllib.parse, urllib.error
import os
from PIL import Image
import subprocess
import cv2
import argparse
import time
Are you interested in local history or archaeology?
Would you like a free trip to the British Museum?
The British Museum is looking for people to help with testing a website about local history and archaeology. We can offer you free travel, lunch, an exhibition entrance and an audio guide in return for your participation.
We are looking for people who are:
* Interested in local history or archaeology
* Not heritage professionals
* Confident to use web pages ordinarily
* Able to travel to London on a weekday in January
@mchesterkadwell
mchesterkadwell / loginredirect
Created May 8, 2014 13:34
Inject login redirect uri choice into successful login action
$loginRedirect = new LoginRedirect();
$redirectUri = $loginRedirect->getConfig();
$this->_redirect($redirectUri);