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 | |
# addDays takes a Unix timestamp (in seconds) and returns a new timestamp | |
# with numDays added to it. | |
function addDays() { | |
local ts=$1 | |
local days=$2 | |
echo $((ts + days * 86400)) | |
} |
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 CONTINUOUS QUERY downsample_to_final ON nexus | |
BEGIN | |
SELECT | |
LAST("analog_input_temperature_value") AS "analog_input_temperature_value", | |
LAST("analog_input_ai0_value") AS "analog_input_ai0_value", | |
LAST("analog_input_ai1_value") AS "analog_input_ai1_value", | |
LAST("analog_input_ai2_value") AS "analog_input_ai2_value", | |
LAST("analog_input_ai3_value") AS "analog_input_ai3_value", | |
LAST("battery_level") AS "battery_level", | |
LAST("clock") AS "clock", |
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
❯ julia | |
_ | |
_ _ _(_)_ | Documentation: https://docs.julialang.org | |
(_) | (_) (_) | | |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help. | |
| | | | | | |/ _` | | | |
| | |_| | | | (_| | | Version 1.2.0 (2019-08-20) | |
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release | |
|__/ | |
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 | |
commit="$1" | |
for tag in $(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname)'); do | |
t1="$t2" | |
t2="$(echo $tag | awk -F/ '{print $3}')" | |
if [ -z $t1 ]; then | |
continue |
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 | |
# Source this script from within any directory within a valid potential | |
# GOPATH and it will set it. It looks for the first parent directory | |
# named "go" or "Go" and sets GOPATH to it. | |
c=$(pwd)/dummy | |
while : | |
do | |
d=$(basename $(dirname $c)) |
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/sh | |
echo "drop database foo; create database foo" | influx | |
influx -database foo -execute "insert regextest,tag1=test value=1" | |
echo "select value from regextest" | influx -database foo | |
echo "select value from /regextest/" | influx -database foo |
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/sh | |
# base directory where cluster configs will be created | |
BASEDIR="/tmp/influxdb-cluster" | |
# delete the base dir if it exists | |
if [ -d "$BASEDIR" ]; then | |
rm -rf $BASEDIR | |
fi |
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
================== | |
WARNING: DATA RACE | |
Write by goroutine 17: | |
github.com/influxdb/influxdb/cmd/influxd/run_test.configureLogging() | |
/home/dgnorton/i/go/src/github.com/influxdb/influxdb/cmd/influxd/run/server_helpers_test.go:424 +0x247 | |
github.com/influxdb/influxdb/cmd/influxd/run_test.NewCluster() | |
/home/dgnorton/i/go/src/github.com/influxdb/influxdb/cmd/influxd/run/server_helpers_test.go:452 +0x59d | |
github.com/influxdb/influxdb/cmd/influxd/run_test.TestCluster_DatabaseCommands() | |
/home/dgnorton/i/go/src/github.com/influxdb/influxdb/cmd/influxd/run/server_cluster_test.go:53 +0x5f | |
testing.tRunner() |
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 main | |
import ( | |
"log" | |
"os" | |
) | |
func main() { | |
if err := os.Mkdir("data", 0777); err != nil { | |
log.Fatal(err) |
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/sh | |
total=0 | |
# loop through all package directories in the project | |
for dir in $(go list ./...); do | |
# prepend $GOPATH src directory | |
dir="$GOPATH/src/$dir" | |
# count lines of Go code in the directory | |
cnt=$(cloc ${dir}/* | egrep "^Go" | awk '{printf $5}') | |
# print the result |
NewerOlder