Skip to content

Instantly share code, notes, and snippets.


Craig Finch craigafinch

View GitHub Profile
craigafinch / test_google_bigtable_grpc.php
Created June 5, 2020 20:03
A minimal test script to ensure that a PHP server can access data in Google BigTable (tests scopes, credentials, GRPC, and protobuf)
View test_google_bigtable_grpc.php
require 'vendor/autoload.php';
use Google\Cloud\Bigtable\BigtableClient;
$project_id = 'my-project-id';
$instance_id = 'my-instance-id';
$table_id = 'my-table-id';
$credential_file_path = './credential.json';
$transport = 'grpc';
craigafinch / stackdriver-instance-log-filter.txt
Last active March 27, 2018 13:40
Google Stackdriver logging advanced filter to view logs across multiple Compute Engine instances by instance name
View stackdriver-instance-log-filter.txt
textPayload:"execution time"
craigafinch /
Created January 4, 2018 03:09
Export data from MySQL in a form suitable for import into Google Cloud SQL
#!/usr/bin/env python
import subprocess
import os
import datetime
# Get list of views from MySQL
getViews = subprocess.Popen(['mysql', 'core'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
views = getViews.communicate("SHOW FULL TABLES IN core WHERE TABLE_TYPE LIKE 'VIEW';")[0].strip()
craigafinch / gcs.service
Last active August 7, 2019 06:37
A systemd service to manage a Google Cloud Storage bucket mounted with GCSFuse
View gcs.service
Description=Google Cloud Storage FUSE mounter google.service sys-fs-fuse-connections.mount
craigafinch /
Last active September 25, 2017 10:01 — forked from alexaivars/
Use fabric with a vagrant instance
from fabric.api import env, local, run
def vagrant():
fab vagrant uname
Note that the command to run Fabric might be different on different
# change from the default user to 'vagrant'