Skip to content

Instantly share code, notes, and snippets.

View dt's full-sized avatar

David Taylor dt

View GitHub Profile
@dt
dt / test
Created February 11, 2022 22:11
// Copyright 2022 The Cockroach Authors.
//
// Licensed as a CockroachDB Enterprise file under the Cockroach Community
// License (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt
package backupccl_test
@dt
dt / google-script-append
Created March 29, 2019 03:42
google append to sheet
var f = SpreadsheetApp.openById('1ZPixvI2lBGPTC-3YmmtbRqEJHU5-A02k9Jfhpw2vw9Q');
var sheet = f.getSheetByName('Sheet1');
function doPost(e) {
Logger.log(e);
console.log(e);
parsedData = JSON.parse(e.postData.contents);
var nextFreeRow = sheet.getLastRow() + 1;
sheet.appendRow([parsedData.co2]);
@dt
dt / co2-sensor-google-log.ino
Last active March 30, 2019 20:58
google logging co2 sensor
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266WebServer.h>
#include <ArduinoOTA.h>
#include "HTTPSRedirect.h"
#include <SoftwareSerial.h>
@dt
dt / gist:0f658f7a96af08cec26af8f0cfb52d08
Created March 26, 2019 12:17
import timings for tpcc 1k
distsql import, csv reader (i.e. master): 55m
I190326 04:27:02.291051 1 ccl/workloadccl/cliccl/fixtures.go:325 starting import of 9 tables
W190326 04:27:02.293200 1 ccl/workloadccl/fixture.go:541 error retrieving automatic stats cluster setting: pq: unknown setting: "sql.stats.automatic_collection.enabled"
I190326 04:27:12.273697 84 ccl/workloadccl/fixture.go:516 imported warehouse (10s, 1000 rows, 0 index entries, 53 KiB)
I190326 04:27:15.543774 85 ccl/workloadccl/fixture.go:516 imported district (13s, 10000 rows, 0 index entries, 1005 KiB)
I190326 04:27:16.486648 90 ccl/workloadccl/fixture.go:516 imported item (14s, 100000 rows, 0 index entries, 7.8 MiB)
I190326 04:29:01.189457 89 ccl/workloadccl/fixture.go:516 imported new_order (1m59s, 9000000 rows, 0 index entries, 126 MiB)
I190326 04:43:08.922034 88 ccl/workloadccl/fixture.go:516 imported order (16m7s, 30000000 rows, 60000000 index entries, 1.8 GiB)
I190326 04:46:40.282246 87 ccl/workloadccl/fixture.go:516 imported history (19m38s, 30000000 row
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266WebServer.h>
#include <ArduinoOTA.h>
#include <SoftwareSerial.h>
byte cmdRead[2] = {0x86, 0x00};
@dt
dt / backup-cockroach.sh
Created July 24, 2018 19:39
daily cockroachdb backup script
#!/bin/bash
set -euxo pipefail
# this script runs backups, creating full backups when run on the configured
# day of the week and incremental backups when run on other days, tracking the
# backups it has created recently to correctly construct the list of path for
# the INCREMENTAL option.
full_day="Sunday" # Must match (including case) the output of `date +%A`.
what="DATABASE mydb" # what to backup.
We can't make this file beautiful and searchable because it's too large.
TsvHttpData-1.0
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/customer.sql 443 rv/C6ONfr0GbLWxU+OiEWQ==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/lineitem.sql 1080 sB5XH/PGvwzhc5tFdEwoYQ==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/nation.sql 244 UcNJfOiDKzURD2mE30xVrA==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/orders.sql 544 VvHfU/2KyB4RPYM+LAdB4A==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/part.sql 437 Suxl0WfMb2NxbbM+TcdMBQ==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/partsupp.sql 518 2v4BEsinf0YT0pUQA6XrPQ==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/region.sql 163 luoOoSlPBa9fZbQTObyS7Q==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/schema/supplier.sql 395 Qkn26eOFJzLdmfV/3AmSiA==
https://roachfixtureswestus.blob.core.windows.net/tpch-csv/sf-1/customer.tbl.1 3032883 XNOiON5TjyD+xRBOypeZRw==
@dt
dt / jump.html
Last active June 16, 2017 18:31
<html><head><meta name="apple-mobile-web-app-capable" content="yes"></head><body><a href="https://freeboard.io/board/3gEwLO">Go</a></body></html>
[17:31:05] ~/go/src/github.com/cockroachdb/cockroach $ dep status | grep google.golang.org/genproto
google.golang.org/genproto * aa2eb68 3
[17:31:15] ~/go/src/github.com/cockroachdb/cockroach $ dep ensure -v google.golang.org/genproto@bb3573be0c484136831138976d444b8754777aff
Root project is "github.com/cockroachdb/cockroach"
110 transitively valid internal packages
125 external packages imported from 81 projects
(0) ✓ select (root)
(1) ? attempt cloud.google.com/go with 1 pkgs; at least 1 versions to try
(1) try cloud.google.com/go@ed63fb27efcf32e25fe7837e4662457d3da4c4f2
[02:01:27] ~/go/src/github.com/cockroachdb/cockroach $ go get -u github.com/golang/dep
[02:01:35] ~/go/src/github.com/cockroachdb/cockroach $ git -C ../../golang/dep rev-parse HEAD
1c168c0d47df7a150c71372b2125e8833f9e63c7
[02:03:32] ~/go/src/github.com/cockroachdb/cockroach $ dep init
...
[02:06:05] ~/go/src/github.com/cockroachdb/cockroach $ cat Gopkg.toml