Skip to content

Instantly share code, notes, and snippets.

View MMcM's full-sized avatar

Mike McMahon MMcM

  • San Francisco, CA
View GitHub Profile
@MMcM
MMcM / gist:5208966
Last active December 15, 2015 05:29
Akiban Server add-on documentation

Akiban Server is an add-on for providing a cloud data service for real-time object access and complex queries.

Data access is provided via JSON encoding of entities or SQL for advanced queries.

Akiban Server is accessible via REST over HTTP or SQL using the Postgres network protocol. A Ruby client library is supported for ActiveRecord.

Provisioning the add-on

Akiban Server can be attached to a Heroku application via the CLI:

@MMcM
MMcM / workspaces_251_putentities_json.log
Created March 29, 2013 12:37
Log entries for this space
Started POST "/workspaces/251/putentities.json" for 66.31.108.252 at 2013-03-29 12:18:32 +0000
Processing by WorkspacesController#putentities as JSON
Parameters: {"entities"=>"{\n \"foo\": {\n \"attributes\": {\n \"id\": {\n \"scalar\": \"adf38f62-b760-4c74-bddd-f9494e653ace\",\n \"type\": \"integer\",\n \"spinal_pos\": 0\n }\n },\n \"entity\": \"0647b2ff-bc3e-41fd-a93f-57a06a3e4544\"\n }\n}", "id"=>"251"}
Completed 200 OK in 41ms (Views: 0.3ms | ActiveRecord: 20.7ms)
Started POST "/workspaces/251/putentities.json" for 66.31.108.252 at 2013-03-29 12:26:29 +0000
Processing by WorkspacesController#putentities as JSON
Parameters: {"entities"=>"{\n \"bar\": {\n \"attributes\": {\n \"id\": {\n \"scalar\": \"adf38f62-b760-4c74-bddd-f9494e653ace\",\n \"type\": \"integer\",\n \"spinal_pos\": 0,\n \"validation\": [\n {\n
@MMcM
MMcM / workspaces_265.log
Created March 29, 2013 19:56
Relevant log entries
Started POST "/workspaces/265/putentities.json" for 75.147.9.1 at 2013-03-29 19:53:25 +0000
Processing by WorkspacesController#putentities as JSON
Parameters: {"entities"=>"{\n \"new-entity\": {\n \"attributes\": {\n \"id\": {\n \"scalar\": \"0dc48feb-6109-414e-8db6-ee1a6d60e8b9\",\n \"type\": \"integer\",\n \"spinal_pos\": 0\n }\n },\n \"entity\": \"0a1a43b1-fe28-4bf0-8ad2-5fb2c41a62b1\"\n }\n}", "id"=>"265"}
Completed 200 OK in 35ms (Views: 0.3ms | ActiveRecord: 19.4ms)
Started POST "/workspaces/265/putentities.json" for 75.147.9.1 at 2013-03-29 19:53:34 +0000
Processing by WorkspacesController#putentities as JSON
Parameters: {"entities"=>"{\n \"old-entity\": {\n \"attributes\": {\n \"id\": {\n \"scalar\": \"0dc48feb-6109-414e-8db6-ee1a6d60e8b9\",\n \"type\": \"integer\",\n \"spinal_pos\": 0\n }\n },\n \"entity\": \"0a1a4
@MMcM
MMcM / layer.log
Created September 24, 2013 18:49
Log excerpts for 14 sysbench OLTP queries
SELECT c FROM sbtest1 WHERE id=501119
Project_Default(Field(2))
GroupLookup_Default(sbtest.sbtest1 -> sbtest.sbtest1)
HKeyRow_Default(sbtest.sbtest1, 501119)
SELECT c FROM sbtest1 WHERE id=496896
Project_Default(Field(2))
GroupLookup_Default(sbtest.sbtest1 -> sbtest.sbtest1)
HKeyRow_Default(sbtest.sbtest1, 496896)
@MMcM
MMcM / fdb_sql_protobuf.py
Last active December 27, 2015 06:29
Using FDB SQL STORAGE_FORMAT to allow read access from Python
from google.protobuf import descriptor
from google.protobuf import descriptor_pb2
from google.protobuf import descriptor_pool
from google.protobuf import message
from google.protobuf import reflection
import fdb
from directory import directory
@MMcM
MMcM / check_pdo.php
Last active January 3, 2016 11:49
Check PHP PDO connectivity.
<?php
$dbh = new PDO("pgsql:host=localhost port=15432 dbname=system");
$stmt = $dbh->prepare('SELECT version()');
$stmt->execute();
$row = $stmt->fetch();
echo $row[0] . "\n";
?>
@MMcM
MMcM / ReadRows.java
Last active August 29, 2015 13:56
Reading and writing Tuple format rows directly
package test;
import com.foundationdb.Database;
import com.foundationdb.FDB;
import com.foundationdb.KeyValue;
import com.foundationdb.Transaction;
import com.foundationdb.directory.DirectoryLayer;
import com.foundationdb.directory.DirectorySubspace;
import com.foundationdb.async.AsyncIterable;
import com.foundationdb.async.AsyncUtil;
@MMcM
MMcM / 00-HOWTO.md
Last active August 29, 2015 13:57
Using DD-WRT to build a demo cluster firewall

Demo Firewall

Features

  • WiFi AP & NAT firewall. (192.168.10.x)
  • Radio initially off; front button (Cisco logo) turns on.
  • Isolated VLAN on Port 4. (192.168.11.x)
  • HAProxy load balancer. (192.168.10.2)
  • PXE on vlan2 netboots Ubuntu 12.04 LTS installer.
  • Linksys WRT54GS!
@MMcM
MMcM / extendedcommand
Created May 27, 2014 13:50
CM10 on MK802
run_program("/sbin/cp", "-R", "/cache/recovery", "/tmp/recovery");
ui_print("ROM Manager Version 5.0.2.0");
ui_print("Septiembre 12, 2012");
ui_print("Preparing to install ROM...");
run_program("/sbin/mount", "/sdcard");
format("/system");
format("/data");
format("/cache");
assert(install_zip("/sdcard/cm10_a10_20121011.zip"));
assert(install_zip("/sdcard/gapps-jb-20121011-signed.zip"));
@MMcM
MMcM / 00-README.md
Created July 2, 2014 14:17
Problem with closed sockets in CC3000 library

Problem sequence:

  • Server completes request and sends close.
  • Client interrupt handler sets closed_sockets.
  • Application closes socket before reading all input and so without calling connected when empty.
  • Closed flag is still set on unused connection.
  • New connection (CC3000 does not cycle socket numbers -- so almost always 0 again).
  • Server is slow to respond so no input available.
  • connected has closed and none available, so not connected.
  • Connection failed.