This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package store provides a distributed SQLite instance. | |
// | |
// Distributed consensus is provided via the Raft algorithm. | |
package store | |
import ( | |
"bytes" | |
"compress/gzip" | |
"encoding/binary" | |
"errors" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the SQLite file. | |
~ $ sqlite3 test.db | |
SQLite version 3.31.1 2020-01-27 19:55:54 | |
Enter ".help" for usage hints. | |
sqlite> CREATE TABLE test(field1); | |
sqlite> INSERT INTO test | |
...> WITH RECURSIVE | |
...> cte(x) AS ( | |
...> SELECT random() | |
...> UNION ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ $ mkdir h | |
~ $ cd h | |
~/h $ export GOPATH=$PWD | |
~/h $ go version | |
go version go1.18.2 linux/amd64 | |
~/h $ mkdir -p src/github.com/otoolep | |
~/h $ git clone [email protected]:otoolep/hraftd.git | |
Cloning into 'hraftd'... | |
remote: Enumerating objects: 1762, done. | |
remote: Counting objects: 100% (12/12), done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start node: | |
$ rqlited data | |
Create and insert some data: | |
$ curl -XPOST 'localhost:4001/db/execute?pretty&timings' -H "Content-Type: application/json" -d '[ | |
> "CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT, age INTEGER)" | |
> ]' | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// How to set timeout for http.Get() in golang | |
// | |
package main | |
import ( | |
"io" | |
"io/ioutil" | |
"log" | |
"net" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
author: jbenet | |
os x, compile with: gcc -o testo test.c | |
linux, compile with: gcc -o testo test.c -lrt | |
*/ | |
#include <time.h> | |
#include <sys/time.h> | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check out the blog post at: | |
# | |
# http://www.philipotoole.com/influxdb-and-grafana-howto | |
# | |
# for full details on how to use this script. | |
AWS_EC2_HOSTNAME_URL=http://169.254.169.254/latest/meta-data/public-hostname | |
INFLUXDB_DATABASE=test1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import math | |
import requests | |
import sys | |
from time import sleep | |
DATABASE = 'test1' | |
STATUS_MOD = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @scratch /configuration/config.js/1 | |
* == Configuration | |
* config.js is where you will find the core Grafana configuration. This file contains parameter that | |
* must be set before Grafana is run for the first time. | |
*/ | |
define(['settings'], | |
function (Settings) { | |
"use strict"; | |
return new Settings({ |