Skip to content

Instantly share code, notes, and snippets.

@m4ldonado
m4ldonado / main.tf
Last active November 27, 2018 00:51
terraform main.tf example
# main.tf file based on the exercises in the up and running book. This file is for me to grep through
# In reality this would be split up into different files!
data "aws_availability_zones" "available" {}
variable "server_port" {
description = "The port the server will use for HTTP requests"
#If you delete the default line it'll prompt on creation
# either way you can run with terraform plan -var server_port="8080"
# for passwords and such - you can ommit the default and get terraform to use it by
# setting TF_VAR_variable_name
@m4ldonado
m4ldonado / create_ldap_user.py
Created March 4, 2018 21:41
create an ldap user with python
#!/usr/bin/env python
from ldap3 import Server, Connection, ALL
ldap_url = ''
admin_dn = ''
admin_pass = ''
new_user_dn = ''
server = Server(ldap_url, use_ssl=True, port=636, get_info=ALL)
conn = Connection(server, admin_dn, admin_pass)
@m4ldonado
m4ldonado / ldap_search.pl
Created March 4, 2018 21:33
search ldap with perl
#!/usr/bin/perl
use Net::LDAP;
$ldap_url = '';
$ldap_base_dn = '';
$ldap = Net::LDAP->new($ldap_url);
$mesg = $ldap->bind;
dn: cn=rfc2307bis,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: rfc2307bis
###
# Extracted from: http://tools.ietf.org/html/draft-howard-rfc2307bis-02
###
# Builtin
#attributeType ( 1.3.6.1.1.1.1.0 NAME 'uidNumber'
# DESC 'An integer uniquely identifying a user in an
# administrative domain'