Skip to content

Instantly share code, notes, and snippets.

@tknerr
tknerr / Notes.md
Last active March 30, 2024 06:56
groovy script classpath problem

I have the following file structure:

Y:\tmp\test
|   main.groovy
|
\---impl
        FooImpl.groovy
@tknerr
tknerr / Vagrantfile
Last active January 28, 2024 09:12
Sample Vagrantfile that works with all providers (virtualbox, aws, managed) and in combination with the vagrant-omnibus plugin
#
# Vagrantfile for testing
#
Vagrant::configure("2") do |config|
# the Chef version to use
config.omnibus.chef_version = "11.4.4"
def configure_vbox_provider(config, name, ip, memory = 384)
config.vm.provider :virtualbox do |vbox, override|
@tknerr
tknerr / README.md
Last active January 23, 2024 16:42
Vagrant with Ansible Provisioner on Windows

Vagrant with Ansible Provisioner on Windows

Long story short, ansible does not work on a Windows control machine, so you basically have to:

  • either run ansible --connection=local ... in the target vm
  • set up a separate control vm where ansible is installed via shell provisioner

Below are Vagrantfile examples for both approaches

Within the Target VM

@tknerr
tknerr / pedantically_commented_playbook.yml
Created October 25, 2016 14:21 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@tknerr
tknerr / ci_jobs.groovy
Created October 6, 2017 10:00
JobDSL example for setting up master / release branch builds + PR builds via bitbucket-branch-source-plugin (using the generated JobDSL)
// define the bitbucket project + repos we want to build
def bitbucket_project = 'awesome'
def bitbucket_repos = ['foo','bar','baz']
// create a pipeline job for each of the repos and for each feature branch.
for (bitbucket_repo in bitbucket_repos)
{
multibranchPipelineJob("${bitbucket_repo}-ci") {
// configure the branch / PR sources
branchSources {
@tknerr
tknerr / AdbCommands
Created April 12, 2023 16:04 — forked from ernestkamara/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
#!/bin/bash
# This is the current stable release to default to, with Omnibus patch level (e.g. 10.12.0-1)
# Note that the chef template downloads 'x.y.z' not 'x.y.z-r' which should be a duplicate of the latest -r
use_shell=0
prerelease="false"
# Check whether a command exists - returns 0 if it does, 1 if it does not
exists() {
@tknerr
tknerr / ci_jobs.groovy
Created January 18, 2018 10:21
Example JobDSL for a multibranchPipelineJob which keeps only the last 10 builds
// define the bitbucket project + repos we want to build
def bitbucket_project = 'myproj'
def bitbucket_repos = ['myrepo1', 'myrepo2']
// create a pipeline job for each of the repos and for each feature branch.
for (bitbucket_repo in bitbucket_repos)
{
multibranchPipelineJob("${bitbucket_repo}-ci") {
// configure the branch / PR sources
branchSources {
@tknerr
tknerr / preapprove.groovy
Created January 31, 2017 09:15
pre-approve all pending script approvals, e.g. from a JobDSL script
import jenkins.*
import jenkins.model.*
Jenkins.instance.getExtensionList('org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval')[0].get().preapproveAll()
@tknerr
tknerr / vagrant-devstack-networking-hints.md
Last active September 30, 2021 06:58
Vagrant / DevStack Network Configuration