Want to create a calculated item with last("X") / last("Y")
.
When Y = 0
, the result should be 0.
last("X") * (1 - count("Y",#1,0)) / (last("Y") + count("Y",#1,0))
Want to create a calculated item with last("X") / last("Y")
.
When Y = 0
, the result should be 0.
last("X") * (1 - count("Y",#1,0)) / (last("Y") + count("Y",#1,0))
This is a script written in Python intended to run alongside a Bitcoin node and export statistics for monitoring purposes. It assumes the existence of bitcoin-cli in the PATH and access to the RPC interface over localhost.
It tracks stuff like: block height, difficulty, number of peers, network hash rate, errors, uptime in seconds, mempool size, size of recent blocks, number of transactions within blocks, chaintips, total bytes received and sent, and transaction inputs and outputs. These Bitcoin metrics are refreshed once every 5 minutes.
Prometheus is a monitoring system and time-series database.
CREATE AGGREGATE vector_sum ( | |
sfunc = AXH_Vector_Sum, | |
basetype = int[], | |
stype = int[], | |
initcond = '{0}' | |
); | |
DROP FUNCTION IF EXISTS AXH_Vector_Sum(int[], int[]); | |
CREATE OR REPLACE FUNCTION AXH_Vector_Sum(int[], int[]) | |
RETURNS int[] AS $$ |
Make sure you have done sudo apt-get update
and sudo apt-get upgrade
on your fresh install. This guide is geared toward Ubuntu 14.04 LTS (Trusty Tahr). Most of the guide will work for earlier versions of Ubuntu with some slight changes, but 14.04 is advised.
sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
set -e | |
set -x | |
cd | |
sudo apt-get update -y | |
sudo apt-get install \ |
class MyCustomCell < UITableViewCell | |
# This method is used by ProMotion to instantiate cells. | |
def initWithStyle(style_name, reuseIdentifier: reuseIdentifier) | |
super | |
stylish | |
self | |
end | |
# A delegate method when the user clicks the Row(it's blue by default) |
upstream unicorn { | |
server unix:/tmp/unicorn.<%= application %>.sock fail_timeout=0; | |
} | |
server { | |
listen 80 default deferred; | |
# server_name example.com; | |
root <%= current_path %>/public; | |
if (-f $document_root/system/maintenance.html) { |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
Backbone.Model::nestCollection = (attributeName, nestedCollection) -> | |
#setup nested references | |
for item, i in nestedCollection | |
@attributes[attributeName][i] = nestedCollection.at(i).attributes | |
#create empty arrays if none | |
nestedCollection.bind 'add', (initiative) => | |
if !@get(attributeName) | |
@attributes[attributeName] = [] | |
@get(attributeName).push(initiative.attributes) |