Skip to content

Instantly share code, notes, and snippets.

@cidermole
cidermole / jenkins-agent.service
Last active Aug 23, 2021
Systemd service file for Jenkins agent on Ubuntu 20.04 Focal Fossa
View jenkins-agent.service
# Steps to install Jenkins Agent using JNLP connection on Ubuntu 20.04 Focal Fossa
#
# * create an Agent node on the web GUI: https://wiki.jenkins.io/display/JENKINS/Step+by+step+guide+to+set+up+master+and+agent+machines+on+Windows
# * $ sudo apt-get install -y openjdk-14-jre-headless
# * $ sudo adduser jenkins
# * $ curl http://jenkins-master.internal/jnlpJars/agent.jar -o /home/jenkins/agent.jar
# * create systemd service: place this file in /lib/systemd/system/jenkins-agent.service
# * $ sudo systemctl enable myservice
# * $ sudo systemctl start jenkins-agent
View signatures.groovy
//
// Obtain class member signatures as required for Jenkins whitelists
// as used in the Script Security plugin,
// https://github.com/jenkinsci/script-security-plugin
//
// Usage example: $ groovy signatures.groovy java.lang.String
//
def resolveArrayType(typeName) {
def arrNames = [
@cidermole
cidermole / rbtree.hpp
Created Jun 10, 2016 — forked from upsuper/rbtree.hpp
A Red-Black Tree implemented in C++ (need C++11)
View rbtree.hpp
#ifndef RBTREE_RBTREE_H_
#define RBTREE_RBTREE_H_
#include <cstddef>
#include <cassert>
#include <utility>
namespace upsuper {
namespace learning {
View TestWCJava2.java
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Random;
public class TestWCJava2 {
@cidermole
cidermole / Makefile
Last active Jan 3, 2016
Problem in C++ function template instantiation from class template
View Makefile
MAIN = program
OBJECTS = main.o myclass.o
all : $(MAIN)
$(MAIN) : $(OBJECTS)
g++ -o $@ $(OBJECTS)
%.o : %.cpp
g++ -c $<