Skip to content

Instantly share code, notes, and snippets.

View 2color's full-sized avatar
🎁
Building

Daniel Norman 2color

🎁
Building
View GitHub Profile

Keybase proof

I hereby claim:

  • I am 2color on github.
  • I am 2color (https://keybase.io/2color) on keybase.
  • I have a public key whose fingerprint is EF85 B9E9 3F47 D488 56BF 37AF C466 A8FA 57F3 9905

To claim this, I am signing this object:

@2color
2color / nginx.conf
Created October 18, 2017 06:56 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
Emoji Meaning
⚠️ WIP
Done
Not Done
🎆 Serendipitous
@2color
2color / postgres_queries_and_commands.sql
Created September 6, 2017 13:19 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@2color
2color / gist:2070f7870cc237ea7ab72e5276b149ff
Created September 5, 2017 14:47 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@2color
2color / notes.md
Last active October 30, 2017 10:32
Prometheus Queries
  • Get rid of pushgateway
  • Saturation - Load testing to determine upper threshold (up 10 rq/sec)
  • Imminent
  • Should we use summeries
    • Historical
    • There might be situation where you don't care about aggregation
  • Historgrams
    • Use up to 10 bukcets
    • Some use cases if you don't know the
  • Aggregations, quantile, timewindow at query time
@2color
2color / questions.md
Last active July 10, 2017 21:30
Prometheus Question

Prometheus Questions

  • metric names
    • Should the same metrics, e.g. requests_total be used across all http services or should one introduce a prefix for services?
    • What are the scaling considerations for an approach as the above
    • What if there's a load balancer and services where a request would be increase two counter, e.g. nginx_lb_requests_total and some_service_requests_total?
  • Series churn
  • When series churn happens and you have two time series, e.g. http_requests_total{code="200"} and http_requests_total{code="500"} are two new series created when the new prometheus container scrapes that target (not sure if same storage is mounted in k8s)?
@2color
2color / Button.jsx
Last active February 16, 2017 09:49 — forked from eloypnd/Button.jsx
Theme defaults with styled components
import styled from 'styled-components'
import themeVars from 'theme.variables'
const Button = styled.button`
background-color: ${({theme}) => theme.button.backgroundColor};
border: none;
border-radius: ${({theme}) => theme.button.radius}px;
color: white;
cursor: pointer;
padding: ${({theme}) => theme.button.padding}rem;
@2color
2color / session.js
Created February 3, 2017 14:13
redux-observable sessionStorage epic example
import { Observable } from 'rxjs'
import 'rxjs/add/observable/of'
import 'rxjs/add/operator/map'
import 'rxjs/add/operator/merge'
import { createAction } from 'redux-actions'
export const SESSION_STORAGE_KEY = 'SESSION_STORAGE_KEY'
export const GET_SESSION_REQUESTED = 'payout/GET_SESSION_REQUESTED'
export const GET_SESSION_FOUND = 'payout/GET_SESSION_FOUND'