Skip to content

Instantly share code, notes, and snippets.

View marcelaraujo's full-sized avatar

Marcel Araujo marcelaraujo

View GitHub Profile
@marcelaraujo
marcelaraujo / macos-port-forward.sh
Created November 30, 2020 10:22 — forked from gregjhogan/macos-port-forward.sh
local port forwarding on macOS
#!/bin/bash
ifconfig lo0 alias 127.0.1.1
ifconfig lo0 alias 127.0.10.1
# clear rules
pfctl -F all -f /etc/pf.conf
# set rules
echo "
@marcelaraujo
marcelaraujo / kill_all.groovy
Last active October 21, 2020 14:30 — forked from steven-terrana/kill_all.groovy
[Kill All Builds] kill all queued and running jobs #Jenkins
import java.util.ArrayList
import hudson.model.*;
// Remove everything which is currently queued
def q = Jenkins.instance.queue
for (queued in Jenkins.instance.queue.items) {
q.cancel(queued.task)
}
// stop all the currently running jobs
@marcelaraujo
marcelaraujo / jenkins-list-credentials.groovy
Last active September 9, 2020 09:19
List Jenkins Credentials
import com.cloudbees.plugins.credentials.CredentialsNameProvider
import com.cloudbees.plugins.credentials.Credentials
import com.cloudbees.plugins.credentials.CredentialsProvider
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey
import org.jenkinsci.plugins.plaincredentials.StringCredentials
import org.jenkinsci.plugins.plaincredentials.FileCredentials
String checksum( String input ) {

OpenSSL Playground

Verify downloaded file
➜  openssl dgst -sha256 openssl-1.1.1.tar.gz
SHA256(openssl-1.1.1.tar.gz)= 2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d
➜  cat openssl-1.1.1.tar.gz.sha256
2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d
RSA Public Key pad and encrypt
import hudson.model.User
import jenkins.model.Jenkins
import hudson.security.HudsonPrivateSecurityRealm
import hudson.security.HudsonPrivateSecurityRealm.Details
def instance = Jenkins.getInstance()
def realm = instance.getSecurityRealm()
def users = realm.getAllUsers()
def generator = { int n ->
FROM php:7.3-alpine
# This image is ready to build projects using technologies:
# - PHP7 (with Lumen)
# - Angular v8
# Check stack details in: https://confluence.agile.corp.edp.pt/display/TNG/PHP7
ENV COMPOSER_VERSION=1.9.3 \
COMPOSER_CACHE_DIR=/tmp/.composer/cache \
#!/bin/bash
mkdir -p ssl
cat << EOF > ssl/req.cnf
[req]
req_extensions = v3_req
distinguished_name = req_distinguished_name
[req_distinguished_name]
[ v3_req ]
#!/bin/bash
mkdir -p ssl
cat << EOF > ssl/req.cnf
[req]
req_extensions = v3_req
distinguished_name = req_distinguished_name
[req_distinguished_name]