Skip to content

Instantly share code, notes, and snippets.

View olorton's full-sized avatar

Oliver Lorton olorton

View GitHub Profile
@olorton
olorton / bleak_error.txt
Created June 22, 2021 16:08
example output of intermittent error with bleak
(oxhome-UL5lUEBP) ~/Code/oxhome $ ./test.py
zsh: permission denied: ./test.py
(oxhome-UL5lUEBP) ~/Code/oxhome $ python ./test.py
Traceback (most recent call last):
File "./test.py", line 18, in <module>
loop.run_until_complete(print_services("208FFF79-B315-4CC9-B842-95DC854B4D6C"))
File "/Users/oliver/.pyenv/versions/3.7.9/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "./test.py", line 13, in print_services
async with BleakClient(device) as client:
@olorton
olorton / keybase.md
Last active February 11, 2020 11:33
keybase.md

Keybase proof

I hereby claim:

  • I am olorton on github.
  • I am olorton (https://keybase.io/olorton) on keybase.
  • I have a public key whose fingerprint is 8ED0 0C15 30A0 71A2 5BC4 B3E8 DAA9 233F DBB8 F006

To claim this, I am signing this object:

Verifying that +olorton is my blockchain ID. https://onename.com/olorton
@olorton
olorton / gist:72bf276ec8541129a42e
Created December 22, 2015 11:49
MySQL 5.6 on CircleCI
- - sudo add-apt-repository 'deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu precise main'
+ - sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
- - export DEBIAN_FRONTEND=noninteractive; sudo apt-get -y install mysql-server
+ - export DEBIAN_FRONTEND=noninteractive; sudo apt-get -y install mysql-server-5.6
@olorton
olorton / gist:a00d9c7b46be582d7dd6
Created November 24, 2014 19:49
Dynamically hide the a website in a directory
<?php
// Your web folder should look like this:
// /change/index.php <-- this file
// /test-123/ <-- The website that you want to test
// Make sure that you have no other files or folders in the root that begin with 'test' (e.g. /testing)
// When you visit /change/ then the test folder will be moved to a new location,
// you will be provided with a link to that new location.
//
// Permissions... The root folder should be writable by the webserver (so it can create new folders), and
@olorton
olorton / provision
Created May 19, 2014 13:39
Anisble provision script
#!/bin/bash
while getopts "v:" OPTION; do
case $OPTION in
v) shift; verbose=true;;
# Unknown option. No need for an error, getopts informs
# the user itself.
\?) exit 1;;
esac
done
@olorton
olorton / wordpress-update-email-notification-cron.php
Created February 8, 2014 14:31
Wordpress cron notification email
<?php
require_once('wp-load.php');
require_once('wp-admin/includes/update.php');
$details = get_preferred_from_update_core();
$to = ''; // Put your email(s) here
$subject = 'Wordpress upgrade notification';