(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# Redis Debug Config to match on normal and warning Redis log lines. | |
input { | |
stdin { codec => "plain" } | |
} | |
filter { | |
grok { | |
# Extends the normal redis pattern to account for warnings as well. | |
match => [ "message", "\[%{POSINT:pid}\] %{REDISTIMESTAMP:timestamp} # %{LOGLEVEL:level} %{GREEDYDATA:mymessage}"] | |
match => [ "message", "\[%{POSINT:pid}\] %{REDISTIMESTAMP:timestamp} \* %{GREEDYDATA:mymessage}"] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
language: node_js | |
node_js: ["0.11", "0.10"] | |
env: | |
CODECLIMATE_REPO_TOKEN: <your_token> | |
before_script: | |
- npm install -g istanbul | |
- npm install -g mocha | |
- npm install -g codeclimate-test-reporter |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
#!/usr/bin/python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2013 <[email protected]>. | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2013-11-01 | |
# |
The new Docker daemon uses port: 2376 with TLS enable by default. Sometimes I want to play with curl
on the old plain http port 2375. The trick is: use socat
in a container to proxy the unix socket
to a real port.
docker run -d \
--volume /var/run/docker.sock:/var/run/docker.sock \
--name docker-http \
deb socat -d -d TCP-L:2375,fork UNIX:/var/run/docker.sock
import javax.crypto.*; | |
import javax.crypto.spec.GCMParameterSpec; | |
import java.nio.ByteBuffer; | |
import java.security.SecureRandom; | |
import java.util.Arrays; | |
public class AESGCMUpdateAAD2 { | |
// AES-GCM parameters | |
public static final int AES_KEY_SIZE = 128; // in bits |
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
import scalaz.\/ | |
import scalaz.syntax.either._ | |
object Example2 { | |
// This example simulates error handling for a simple three tier web application | |
// | |
// The tiers are: | |
// - the HTTP service | |
// - a user authentication layer | |
// - a database layer |
package controllers.api | |
import play.api.mvc.{ Controller, Action } | |
import models._ | |
import dao._ | |
object Discussion extends Controller with TokenAuthentication { | |
def index = withAPIToken { user => { request => | |
Ok(Json.toJson(DiscussionDAO.all)) |