Skip to content

Instantly share code, notes, and snippets.

View Wonno's full-sized avatar
⚠️
Attention

Wonno Wonno

⚠️
Attention
View GitHub Profile
@wmertens
wmertens / ssh-crypt.bash
Last active February 2, 2024 10:01
ssh-crypt: bash function to encrypt using ssh-agent and openssl
#!/usr/bin/env bash
#
# ssh-crypt
#
# Bash function to encrypt/decrypt with your ssh-agent private key.
# Requires the commands gzip, ssh-add, ssh-keygen and openssl.
#
# Uses bash-specific extensions like <<<$var to securely pass data.
#
# Wout.Mertens@gmail.com 2021-11-11 - MIT Licensed
@ggarcia24
ggarcia24 / pipeline.gdsl
Last active March 1, 2024 13:54
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@mosquito
mosquito / README.md
Last active May 19, 2024 11:04
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@dcode
dcode / 0-SSH-Proxy-Setup.adoc
Last active December 29, 2022 17:14
SSH Proxy Setup Instructions

SSH Proxy Setup

@martinda
martinda / git-merge-before-build.dsl
Created April 6, 2016 23:40
Jenkins Pipeline DSL code to demonstrate git merge before build
// Jenkins Pipeline DSL to demonstrate git merge before build
node {
String path = '/tmp/jenkins/upstream-repo'
sh "rm -rf ${path}"
ws(path) {
sh 'git --version'
sh 'git init'
sh 'touch README.md; git add README.md; git commit -m "init"'
sh 'git checkout -b pull-requests/1/from'
sh 'touch file.txt; git add file.txt; git commit -m "Add file"'
@jumanjiman
jumanjiman / harden.sh
Last active February 1, 2024 14:27
hardening script for an alpine docker container
#!/bin/sh
# Copyright 2020 Paul Morgan
# License: GPLv2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
import jenkins.model.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import org.jenkinsci.plugins.plaincredentials.*
import org.jenkinsci.plugins.plaincredentials.impl.*
import hudson.util.Secret
import hudson.plugins.sshslaves.*
@tuxfight3r
tuxfight3r / jenkins-decrypt.groovy
Created September 23, 2015 11:36
Decrypting Jenkins Password
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@GMaissa
GMaissa / Jenkins-docker-wheezy-installer
Last active January 6, 2016 11:16
Installation script for Jenkins+Docker on Debian Wheezy
# Update wheezy kernel as it requires at least a kernel 3.11.x
echo "deb http://http.debian.net/debian wheezy-backports main" >> /etc/apt/sources.list
aptitude update
aptitude install -y -t wheezy-backports linux-image-amd64
mv /etc/grub.d/06_OVHkernel /root/
update-grub
reboot
# Install jenkins
echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list