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
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} |
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
begin # start catching exceptions here | |
Net::LDAP.open( | |
:host => host, | |
:port => port, | |
:auth => { | |
:method => :simple, | |
:username => CONFIG['repldn'], | |
:password => CONFIG['replpw'] | |
} | |
) do |ldap| |
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
foreground = yes | |
sslVersion = all | |
options = NO_SSLv2 | |
[ldaps] | |
accept = 636 | |
cert = /etc/stunnel/cert.pem | |
key = /etc/stunnel/key.pem | |
connect = <%LDAP_SERVER%> |
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 | |
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 |
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
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 |
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
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 \ |