Skip to content

Instantly share code, notes, and snippets.

defmodule Board do
defstruct numbers: %{}, hits: %{}, last_match: nil
def parse_xy_val(lines) when is_list(lines) do
board =
lines
|> Enum.with_index()
|> Enum.reduce(%{}, &parse_line_xy_val/2)
%__MODULE__{numbers: board}
begin # start catching exceptions here
Net::LDAP.open(
:host => host,
:port => port,
:auth => {
:method => :simple,
:username => CONFIG['repldn'],
:password => CONFIG['replpw']
}
) do |ldap|
foreground = yes
sslVersion = all
options = NO_SSLv2
[ldaps]
accept = 636
cert = /etc/stunnel/cert.pem
key = /etc/stunnel/key.pem
connect = <%LDAP_SERVER%>
#!/bin/sh
LDAP_SERVER_TOKEN="<%LDAP_SERVER%>"
STUNNEL_CFG="/etc/stunnel/ldap.conf"
# We're use indirect reference, to find out what is
# the ldap server IP:Port
ldap_ip_port_env_name="LDAP_PORT"
if [ ! -z $LDAP_ALIAS ]; then
@bodgix
bodgix / Dockerfile
Created November 14, 2015 13:56
tcpdump
FROM centos:6
MAINTAINER Bogdan Katyński
RUN yum -y install tcpdump
ENTRYPOINT /usr/sbin/tcpdump -i eth0 -s0 -w \
/tcpdump/ldap_$(date '+%F_%T').pcap \
port 389 -p -n
@bodgix
bodgix / Dockerfile
Last active November 14, 2015 13:57
stunnel
FROM centos:6
MAINTAINER Bogdan Katyński
EXPOSE 636
# Install stunnel
RUN yum -y install stunnel
# Create a self-signed keypair
RUN openssl req -x509 \
-newkey rsa:2048 \