Skip to content

Instantly share code, notes, and snippets.

@dnwe
dnwe / mac.log
Created April 27, 2015 21:00
Mac SelectableMessengerTest
% python ../tests/python/proton-test -n 20 '*SelectableMessengerTest*'
proton_tests.messenger.SelectableMessengerTest.testSelectable ........... pass
proton_tests.messenger.SelectableMessengerTest.testSelectable1024 ....... pass
proton_tests.messenger.SelectableMessengerTest.testSelectable16 ......... pass
proton_tests.messenger.SelectableMessengerTest.testSelectable4096 ....... fail
Error during test: Traceback (most recent call last):
File "../tests/python/proton-test", line 355, in run
phase()
File "/Users/username/src/qpid-proton/tests/python/proton_tests/messenger.py", line 1035, in testSelectable4096
self.testSelectable(count=4096)
@dnwe
dnwe / setup-mq-ubuntu.sh
Created April 30, 2015 10:20
simple script to deploy limits.d and sysctl.d files to meet MQ runtime requirements in vagrant image
#!/bin/sh
# write out files to meet MQ runtime requirements
echo '# mqconfig - process-level maximum open files
vagrant soft nofile 10240
vagrant hard nofile 65536
' > /etc/security/limits.d/local-mqm.conf
echo '# mqconfig - system-level maximum open files, semaphores, shared mem etc.
diff --git a/src/node.js b/src/node.js
index c194c23..afc8e23 100644
--- a/src/node.js
+++ b/src/node.js
@@ -473,25 +473,26 @@
function nextTick(callback) {
// on the way out, don't bother. it won't get fired anyway.
if (process._exiting)
return;
// A template build.gradle to invoke the jobdsl plugin on the .groovy files
// which will syntactically validate them and output the generated Jenkins XML
// into the build directory.
repositories {
mavenCentral()
maven { url 'http://repo.jenkins-ci.org/releases/' }
}
dependencies {
compile 'org.jenkins-ci.plugins:job-dsl-core:1.46'
@dnwe
dnwe / kafka_roundtrip.py
Created August 11, 2016 13:57
Simple proof of concept for using kafka-python to talk to IBM Message Hub
#!/usr/bin/python3
"""
Simple proof of concept for using kafka-python to talk to IBM Message Hub
https://gist.github.com/dnwe
http://kafka-python.readthedocs.io/
"""
import os
import ssl
#!/usr/bin/env python
import os
import sys
import fnmatch
import logging
import zipfile
logging.basicConfig(
stream=sys.stdout,
@dnwe
dnwe / count_pdf_pages.py
Created January 8, 2017 10:42
Pure Python script to count the number of pages in a directory of PDF files
#!/usr/bin/env python2
import os
import sys
import re
import fnmatch
import logging
logging.basicConfig(
stream=sys.stdout,
@dnwe
dnwe / disable_commit_agents_docker_container.groovy
Created March 19, 2018 14:06
Jenkins groovy script to remove the "Commit agent's Docker container" setting from all projects
import com.cloudbees.plugins.flow.*;
import com.nirima.jenkins.plugins.docker.DockerJobProperty;
projects = Jenkins.instance.getAllItems();
projects.each { project ->
removed = false
project.properties.find{ it.key instanceof com.nirima.jenkins.plugins.docker.DockerJobProperty.DescriptorImpl }.each { property ->
project.removeProperty(property.value)
removed = true
}
@dnwe
dnwe / consumer-group-commit.go
Created February 19, 2020 16:23
Sarama example to subscribe to a topic and immediately commit the current end offset for the assigned partitions.
package main
import (
"context"
"fmt"
"log"
"os"
"sync"
"github.com/Shopify/sarama"
@dnwe
dnwe / github_enforcer.go
Created March 4, 2020 15:50
Enforces the correct team-ownership, protected branches, status checks etc. permissions across an org/user
package main
import (
"context"
"fmt"
"log"
"net/http"
"net/url"
"os"
"reflect"