start new:
tmux
start new with session name:
tmux new -s myname
debian@bbb-test:~$ vmstat 1 | |
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | |
r b swpd free buff cache si so bi bo in cs us sy id wa st | |
4 0 0 6088 19916 271064 0 0 25 20 17 32 18 12 69 0 0 | |
0 0 0 6120 19916 271064 0 0 0 0 1334 4098 13 20 67 0 0 | |
0 0 0 6120 19916 271064 0 0 0 0 1554 4046 13 19 68 0 0 | |
0 0 0 6120 19924 271056 0 0 0 16 929 2443 10 8 81 1 0 | |
0 0 0 6120 19924 271064 0 0 0 0 1611 4128 24 20 56 0 0 | |
0 0 0 6120 19924 271064 0 0 0 0 919 2443 6 11 83 0 0 | |
0 0 0 5996 19924 271064 0 0 0 0 1240 3312 29 28 42 0 0 |
export GOROOT=/usr/local/go | |
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH:$WORKSPACE/bin | |
export GOPATH=$WORKSPACE | |
git config url."git@github.com:".insteadOf "https://github.com/" | |
go get github.com/AlekSi/gocov-xml | |
go get github.com/axw/gocov/gocov | |
mkdir -p $GOPATH/src/github.com/NextUserSF/ |
I hereby claim:
To claim this, I am signing this object:
from tastypie import fields | |
from tastypie.authentication import Authentication | |
from tastypie.authorization import Authorization | |
from tastypie.bundle import Bundle | |
from tastypie.exceptions import NotFound | |
from tastypie.resources import Resource | |
# a dummy class representing a row of data | |
class Row(object): |
It is generally desirable to group all the hosts for a specific service into a single dashboard view. For example, all the web servers are in single view while all the database servers are in another view.
This is usually not an issue when you are sending custom metrics using Riemann client. However, there are cases where you are using something that you do not control how the metrics are being sent. i.e., Riemann-tools.
Since Riemann-tools scripts are application agnostic, in order for the dashboard view to group hosts, we must inject some application specific information into the tags field. Tags is a collection of arbitrary strings. In the case of Riemann-tools scripts you can pass in arbitrary strings on the command line.
riemann-health --host 127.0.0.1 --tag "prod" --tag "webserver"
SELECT 'drop table '||n.nspname ||'.'|| c.relname||' CASCADE;' as "Name" | |
FROM pg_catalog.pg_class c | |
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace | |
WHERE c.relkind IN ('r','v','S','') | |
AND n.nspname = 'destination_schema'; | |
SELECT 'create table '||n.nspname ||'.'|| c.relname||' as select * from source_schema.' || c.relname||';' as "Name" | |
FROM pg_catalog.pg_class c | |
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace | |
WHERE c.relkind IN ('r','v','S','') |
SELECT 'UNLOAD (\'select * from '||n.nspname ||'.'|| c.relname||'\') TO \'s3://bucket/' || c.relname || '_\';' as "Name" | |
FROM pg_catalog.pg_class c | |
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace | |
WHERE c.relkind IN ('r','v','S','') | |
AND n.nspname LIKE 'nu_alibris'; | |
SELECT 'COPY ' || n.nspname ||'.'|| c.relname ||' from \'s3://bucket/' || c.relname || '_\';' as "Name" | |
FROM pg_catalog.pg_class c | |
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace |
#!/usr/bin/env python | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the run() method |
# Bind SSL port with PFS-enabling cipher suite | |
bind :443 ssl crt path_to_certificate no-tls-tickets ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-RC4-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES128-SHA:AES256-SHA256:AES256-SHA:RC4-SHA | |
# Distinguish between secure and insecure requests | |
acl secure dst_port eq 443 | |
# Mark all cookies as secure if sent over SSL | |
rsprep ^Set-Cookie:\ (.*) Set-Cookie:\ \1;\ Secure if secure | |
# Add the HSTS header with a 1 year max-age |