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
// for all builds from build-flow-plugin whose parameters include a GIT_BRANCH paramater, | |
// change the displayName to include branch and build number | |
import com.cloudbees.plugins.flow.*; | |
jobs = Jenkins.instance.getAllItems(BuildFlow); | |
jobs.each { it -> | |
it.builds.each { b -> | |
GIT_BRANCH = b.envVars['GIT_BRANCH'] | |
( GIT_BRANCH =~ /(?:refs\/remotes\/)?(.+)/ ).each { full,branch -> |
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
// scan all jobs and check if the last build was aborted (e.g. maintenance) | |
// and output user / timestamp | |
jobs = Jenkins.instance.getAllItems() | |
lastabort = null | |
jobs.each { j -> | |
if (j instanceof com.cloudbees.hudson.plugins.folder.Folder) { return } | |
numbuilds = j.builds.size() | |
if (numbuilds == 0) { return } | |
lastbuild = j.builds[numbuilds - 1] |
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/bash | |
# License: MIT | |
# You can find a copy of the license here: http://opensource.org/licenses/MIT | |
# This simple script lets you change the LDAP admin password from | |
# a console on the LDAP server. | |
cd /tmp | |
set -o errexit | |
PASSWORD=$(slappasswd -h {SSHA}) |
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
# test LDAPS connection using TLS 1.1 and internal CA certificate validation. | |
require 'rubygems' | |
require 'net/ldap' | |
# refs: | |
# https://gist.github.com/jeffjohnson9046/7012167 | |
# https://github.com/ruby-ldap/ruby-net-ldap/blob/master/lib/net/ldap.rb | |
def get_ldap_response(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
#!/usr/bin/env python | |
import ldap, sys | |
LDAP_SERVER = 'ldaps://ldap.example.com:636' | |
LDAP_BASE = 'dc=example,dc=com' | |
try: | |
conn = ldap.initialize(LDAP_SERVER) | |
except ldap.LDAPError, e: |
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
install | |
#cmdline | |
text | |
skipx | |
reboot --eject | |
# we're using a VM | |
unsupported_hardware | |
# please remember to change this |
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
#!/usr/bin/env python | |
# simple script to test that email (internal relay) is working. | |
import smtplib | |
import argparse | |
from uuid import uuid4 | |
from email.mime.text import MIMEText | |
def smtp_mail(subject, message, addr_from, addr_to, smtp_host): | |
msg = MIMEText(message.encode('utf-8'), 'plain', 'utf-8') |
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
dn: cn=config | |
changetype: modify | |
add: olcTLSCipherSuite | |
olcTLSCipherSuite: SECURE256:-VERS-SSL3.0 |
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
# decorators to leverage cache based on conditional view processing. | |
# cache_condition decorator based on django.views.decorators.http.condition | |
# cache_last_modified, cache_etag shortcuts. | |
# settings.py | |
# ----------- | |
# you may or may not want this. | |
# CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True |
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
# | |
# discover all url patterns in django project | |
# | |
def discover_urls(urllist, parent): | |
for entry in urllist: | |
item = parent.setdefault(entry.regex.pattern, {}) | |
if hasattr(entry, 'url_patterns'): | |
discover_urls(entry.url_patterns, item) |