Skip to content

Instantly share code, notes, and snippets.

View seanburlington's full-sized avatar

Sean Burlington seanburlington

View GitHub Profile
from machine import Pin, PWM
import time
# Set up LED pins
seg1 = Pin(13, Pin.OUT)
seg2 = Pin(12, Pin.OUT)
seg3 = Pin(11, Pin.OUT)
seg4 = Pin(10, Pin.OUT)
seg5 = Pin(9, Pin.OUT)
@seanburlington
seanburlington / clean-takout-photos.sh
Last active February 13, 2022 20:53
Google Photos Takeout Cleanup
#!/bin/bash
set -euo pipefail
find ~/Pictures -type f -printf "%f\n" | sort | uniq > ~/picture-names
cd /media/sean/Backup/burlington.me.uk-takeout
number=02
@seanburlington
seanburlington / GForms.html
Last active June 24, 2020 10:29 — forked from Miouyouyou/GForms.html
Quick and dirty Hugo Shortcode for Google Forms
<iframe src="https://docs.google.com/forms/d/e/{{ .Get "src" }}/viewform?embedded=true" width="{{ .Get "width" }}" height="{{ .Get "height" }}" frameborder="0" marginheight="0" marginwidth="0">{{ .Get "alt" }}</iframe>
@seanburlington
seanburlington / self-signed-certificate-with-custom-ca.md
Last active April 21, 2020 12:41 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="moment.min.js"></script>
<script src="moment-timezone.js"></script>
<script>
$(document).ready(function(){
@seanburlington
seanburlington / unicode-excel-csv.php
Last active March 31, 2020 08:54
Function to open an Excel generated CSV using unicode
<?php
# http://www.practicalweb.co.uk/blog/2008/05/18/reading-a-unicode-excel-file-in-php/
function fopen_utf8($filename){
$encoding='';
$handle = fopen($filename, 'r');
$bom = fread($handle, 2);
// fclose($handle);
rewind($handle);
@seanburlington
seanburlington / search-skype.sh
Created October 22, 2014 11:11
search skype chats
#!/bin/bash
export username=skype.name
sqlite3 -column ~/.Skype/$username/main.db \
"SELECT displayname, from_dispname, datetime(Messages.timestamp, 'unixepoch') as date, body_xml
FROM Messages, Conversations
WHERE Conversations.id=Messages.convo_id and body_xml like '%$searchterm%'
ORDER BY Messages.timestamp;"
@seanburlington
seanburlington / search-skype-today.sh
Last active August 29, 2015 14:07
Search across skype chats
export username=skype.name
export thedate=$(date +%Y-%m-%d)
sqlite3 ~/.Skype/${username}/main.db \
"SELECT displayname, datetime(Messages.timestamp, 'unixepoch') as date, body_xml
FROM Messages, Conversations
WHERE Conversations.id=Messages.convo_id and date(Messages.timestamp, 'unixepoch') == '${thedate}' and author='${username}'
ORDER BY Messages.timestamp;"
@seanburlington
seanburlington / github-list.sh
Created September 18, 2014 15:03
List a git directory with last commit details (like github does)
#!/bin/bash
FILES=`ls -Atc`
MAXLEN=0
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done
for f in $FILES; do
@seanburlington
seanburlington / gist:5832654
Created June 21, 2013 17:00
bash script to drop all tables from a database need tidying up still
#!/bin/bash
MUSER="$1"
MPASS="$2"
MDB="$3"
HOST=$4
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)