This file contains hidden or 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
~/repos/rqlite-java-http (master)$ mvn compile | |
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] -------------------< com.example:rqlite-java-client >------------------- | |
[INFO] Building rqlite-java-client 1.0-SNAPSHOT | |
[INFO] --------------------------------[ jar ]--------------------------------- | |
[INFO] | |
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ rqlite-java-client --- | |
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! | |
[INFO] skip non existing resourceDirectory /home/philip/repos/rqlite-java-http/src/main/resources |
This file contains hidden or 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
$ cat sql | |
WITH RECURSIVE | |
program AS | |
(SELECT '++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.' AS p, | |
'' AS input, 3 AS width | |
), | |
jumpdepth AS | |
(SELECT 0 AS idx, 0 AS jumpdepth, '' AS jumplist, NULL as jumpback, NULL AS direction, p || '0' AS p, width FROM program | |
UNION ALL | |
SELECT idx+1, CASE SUBSTR(p, idx+1, 1) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder