Skip to content

Instantly share code, notes, and snippets.

@arnobroekhof
arnobroekhof / EmbeddedADS.java
Created September 2, 2013 20:01
Embedded Apache Directory Server
package nl.techop.frontdoor.ldap;
import org.apache.directory.server.core.DefaultDirectoryService;
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.core.partition.Partition;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.protocol.shared.transport.TcpTransport;
@arnobroekhof
arnobroekhof / facter-rest
Last active December 23, 2015 22:59
simple rest api for printing all facts from facter in json format.
#!/usr/bin/env ruby
require 'facter'
require 'json'
require 'sinatra'
ipaddress="172.16.132.2"
# sinatra specific settings
set :sessions, false
# Client
/opt/scc/bin/scc –v <host> -e “* “ –p cp –s \ /var/opt/scc/data/transfer
#Server
/opt/scc-srv/bin/scc-pull –n -L /var/opt/scc-srv/conf/scc-pull-list
@arnobroekhof
arnobroekhof / pre-commit
Created October 15, 2013 20:38
puppet-pre-commit
#!/bin/bash
# pre-commit git hook to check the validity of a puppet manifest
#
# Prerequisites:
# gem install puppet-lint puppet
#
# Install:
# /path/to/repo/.git/hooks/pre-comit
# Source RVM if needed
@arnobroekhof
arnobroekhof / remove_puppet_cert.sh
Created October 16, 2013 21:23
Cobbler delete puppet certificate on pre installation trigger
#!/bin/sh
# make sure the following is in the puppet auth.conf and autosign
# is enabled
#
# path /certificate_status
# auth any
# allow <cobbler_server>
#
#
@arnobroekhof
arnobroekhof / generate_sha512_passwd
Created November 4, 2013 10:45
Generate crypt ( passwd compliant ) sha512 password with python
#!/usr/bin/env python
import crypt
import string
import random
import sys
from optparse import OptionParser
def salt_generator(size=20, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
@arnobroekhof
arnobroekhof / syslog_server.py
Created November 15, 2013 08:28
syslog_server.py
#!/usr/bin/env python
##
## This is a syslog server that is able to receive UDP based syslog
LOG = 'thelogfile.log'
HOST, PORT = "0.0.0.0", 514
import logging
package com.srini.tikacustom;
import java.io.IOException;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
@arnobroekhof
arnobroekhof / db_new_install.rsp
Last active January 3, 2016 12:49
Oracle 11gR2 response file
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_AND_CONFIG
ORACLE_HOSTNAME=localhost.localdomain
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/soa/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
@arnobroekhof
arnobroekhof / create_new_database.rsp
Created January 17, 2014 00:00
Oracle DBCA response file
##############################################################################
## ##
## DBCA response file ##
## ------------------ ##
## Copyright 1998, 2007, Oracle Corporation. All Rights Reserved. ##
## ##
## Specify values for the variables listed below to customize Oracle ##
## Database Configuration installation. ##
## ##
## Each variable is associated with a comment. The comment identifies the ##