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
require 'gsl' | |
require 'time' | |
module Diskalerter | |
class ThresholdEstimator | |
attr_reader :timestamps, :signal, :threshold, :now | |
# timestamps - a list of timestamps in epoch milliseconds | |
# signal - a list of values for the provided timestamps | |
# threshold - the "exhaustion" threshold (e.g., 100 for a percentage signal) |
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
[StatsdInput] | |
address = "localhost:8125" | |
[StatAccumInput] | |
type = "StatAccumInput" | |
ticker_interval = 1 | |
emit_in_fields = true | |
percent_threshold = 95 | |
[statmetric_atlas_encoder] |
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
~/safecast/safecastapi staging-postgis-setup* 43s | |
❯ dropdb safecast_test | |
~/safecast/safecastapi staging-postgis-setup* | |
❯ rake db:test:prepare | |
[RailsAdmin] RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it. | |
rake aborted! | |
ActiveRecord::StatementInvalid: PG::Error: ERROR: PostGIS is already installed in schema 'postgis', uninstall it first | |
: CREATE EXTENSION IF NOT EXISTS postgis | |
/Users/mat/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.21/lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in `exec' |
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
safecast_development=# create extension if not exists postgis; | |
ERROR: PostGIS is already installed in schema 'postgis', uninstall it first | |
safecast_development=# drop extension postgis; | |
ERROR: extension "postgis" does not exist |
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
on slashCommand(cmd) | |
tell application "System Events" | |
delay 0.1 | |
key code 44 | |
delay 0.1 | |
keystroke cmd | |
delay 0.1 | |
keystroke return | |
end tell | |
return 0 |
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 | |
aws ec2 describe-instances |\ | |
jq -r '.Reservations[].Instances[] | | |
select(.State.Code == 16) | | |
[ | |
( .Tags[] | select(.Key == "Name") | .Value ), | |
( .Tags[] | select(.Key == "cost-center") | .Value), | |
.InstanceId, | |
.InstanceType |
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
~ | |
❯ curl -v https://api.stellar.org | |
* Rebuilt URL to: https://api.stellar.org/ | |
* Hostname was NOT found in DNS cache | |
* Trying 108.162.204.108... | |
* Connected to api.stellar.org (108.162.204.108) port 443 (#0) | |
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | |
* Server certificate: *.stellar.org | |
* Server certificate: COMODO RSA Domain Validation Secure Server CA | |
* Server certificate: COMODO RSA Certification Authority |
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/env bash | |
echo a | |
echo b | |
echo ---- | |
echo c | |
echo d | |
echo ---- | |
echo |
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
# -*- mode: toml -*- | |
# vi: set ft=toml : | |
[hekad] | |
base_dir = "/tmp" | |
[on_space] | |
type = "TokenSplitter" | |
delimiter = " " |
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/env bash | |
URL="http://a0.awsstatic.com/pricing/1/ec2/ri-v2/linux-unix-shared.min.js" | |
(echo 'function callback(data) { console.log(JSON.stringify(data)); }'; curl -s "$URL") |\ | |
node |\ | |
jq -r '.config.regions[] | | |
select(.region == "us-east-1") | | |
.instanceTypes[] | | |
[ |