Skip to content

Instantly share code, notes, and snippets.


Tim Richardson timrichardson

View GitHub Profile
View gist:1fd8ad33215377d849cb54266148beb1
to return to the repo files,
git clean -fdx
View gist:e08ed9343b5542426c8cebba7385a9bf
--- TLP 1.2.2 --------------------------------------------
+++ Configured Settings: /etc/default/tlp
timrichardson /
Last active Jan 2, 2020
Modern way to edit gmail signatures with python3 and the gmail API
from string import Template
import time
import pytest
from google.oauth2 import service_account
from googleapiclient.discovery import build
from googleapiclient.errors import *
from google.auth.exceptions import *
import easygui
import pandas as pd
timrichardson / 0_reuse_code.js
Created Jul 22, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
timrichardson /
Last active Jan 27, 2019
Use Python, OAuth2 and Google APIs to mass-update gmail signatures of a Google Apps for Work domain. Using a google service account for the credential.
# python 2.7
# *********************************************************************************************************
# Please see
# for a modern way of doing this, using the current API and python 3
timrichardson /
Created Apr 30, 2015
Some examples of Unleashed API in Python 3.4
__author__ = 'tim'
import requests.auth
import binascii
import hashlib
import hmac
import prefs
import json
# tested only with python 3.4
timrichardson / 0_ Gmail API for Service Accounts Python 2.7.
Last active Apr 28, 2020
Access gmail via gmail api, Service Account method (applicable if you have Google Apps admin access)
View 0_ Gmail API for Service Accounts Python 2.7.
smtp mail sending in cPython blocks the GIL.
This code is tested on python 2.7.8 and I'm using it with web2py
If you use Google Apps for your domain email and if you have admin access, you can easily use the gmail api.
Because you have admin access, you can create a "service account" in the Google Developer Console.
This makes authentication easy.
There are other authorisation methods when you don't have admin access, but they require interaction from the user via a browser.
To use this, you need to install these modules (From PyPI):
timrichardson / KOUNTA_SAASU_EXPORT
Last active Aug 29, 2015
web-scraping technique to bulk export Kounta daily cash closings to Saasu. Currently there is no public Kounta API.
There is no API available for Kounta. Well, Kounta says there is one if you ask; I've asked a few times and was ignored.
This is a webscraping solution to mass exporting of daily takings reports into Saasu.
You can’t perform that action at this time.