Skip to content

Instantly share code, notes, and snippets.

View TheTechOddBug's full-sized avatar

thetechoddbug (José María Gutiérrez) TheTechOddBug

View GitHub Profile
@TheTechOddBug
TheTechOddBug / git-branches-by-commit-date.sh
Created June 22, 2022 17:37 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@TheTechOddBug
TheTechOddBug / Jenkinsfile
Created June 29, 2022 16:00 — forked from flmu/Jenkinsfile
Jenkinsfile that creates dynamically stages from a list
def jobs = ["JobA", "JobB", "JobC"]
def parallelStagesMap = jobs.collectEntries {
["${it}" : generateStage(it)]
}
def generateStage(job) {
return {
stage("stage: ${job}") {
echo "This is ${job}."
@TheTechOddBug
TheTechOddBug / gourcevideo.sh
Created November 20, 2023 01:14 — forked from Gnzlt/gourcevideo.sh
Gource video export command
#!/bin/bash
gource \
-s .03 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
@TheTechOddBug
TheTechOddBug / groovy-create-user.md
Created April 10, 2024 17:29 — forked from imranity/groovy-create-user.md
Jenkins Groovy enable security and create a user in groovy script

This is a snippet that will create a new user in jenkins and if security has been disabled , it will enable it :)

import jenkins.model.*
import hudson.security.*

def instance = Jenkins.getInstance()

def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("MyUSERNAME","MyPASSWORD")
instance.setSecurityRealm(hudsonRealm)
@TheTechOddBug
TheTechOddBug / README.md
Created April 10, 2024 17:30 — forked from mllrjb/README.md
Jenkins init.groovy.d role-based authorization strategy

Usage

Set a system environment variable AUTHZ_JSON_URL that points to a JSON file with the following structure:

{
  "admins": [
    "groupA", 
    "userA"
 ],
@TheTechOddBug
TheTechOddBug / README.md
Created June 5, 2024 17:09 — forked from tomelam/README.md
How to use your Google Custom Search Engine in Chrome's Omnibox

How to use your Google Custom Search Engine in Chrome's omnibox

  • If you don't know what Chrome's omnibox is, see Chrome support.

  • Go to www.google.com/cse and add a Custom Search Engine with all your favorite web sites for one topic of interest to you. Let's suppose the topic of interest is JavaScript.

  • Do a search on your Custom Search Engine and save the URL of the finished search.

  • In Google Chrome, go to 'Settings', then (under 'Search') 'Manage Search Engines...'.

@TheTechOddBug
TheTechOddBug / converting-json-to-openapi-swagger-spec.md
Created October 31, 2024 14:17 — forked from 0xdevalias/converting-json-to-openapi-swagger-spec.md
Exploring tools that allow converting a JSON response automagically into an OpenAPI / Swagger spec.

Converting JSON to OpenAPI / Swagger spec

Exploring tools that allow converting a JSON response automagically into an OpenAPI / Swagger spec.

Test JSON Response

{
    "accounts": {
        "default": {