Skip to content

Instantly share code, notes, and snippets.

View ivan-pinatti's full-sized avatar
👨‍💻

Ivan Pinatti ivan-pinatti

👨‍💻
View GitHub Profile
### Keybase proof
I hereby claim:
* I am ivan-pinatti on github.
* I am ivan_pinatti (https://keybase.io/ivan_pinatti) on keybase.
* I have a public key ASDyj7x9361CdeHUdXBn8HLZmOXsPqA7Xs85zjo1pfOKbgo
To claim this, I am signing this object:
@ivan-pinatti
ivan-pinatti / bash-skeleton.sh
Created December 22, 2020 16:23
BASH Script Skeleton - #bash #script #shell #skeleton
#!/usr/bin/env bash
: ' Insert the description of the script here
# exit(s) status code(s)
0 - success
1 - fail
'
# check if debug flag is set
@ivan-pinatti
ivan-pinatti / git-sanity-check.sh
Created June 3, 2019 15:56
Git - Check stale branches and alert on Slack - #git #stale #branches #slack #sanity
#!/usr/bin/env bash
: ' Script that checks stale branches based on a specific date on a git
repository and send an alert message on a Slack channel
'
# check if debug flag is set
if [ "${DEBUG}" = true ]; then
@ivan-pinatti
ivan-pinatti / jenkins-set-global-shared-library.groovy
Created May 21, 2018 18:39
Jenkins - Set Global Share Library plugin parameters via groovy script - #jenkins #groovy #library #shared #sharedLibrary
#!groovy
// imports
import hudson.scm.SCM
import jenkins.model.Jenkins
import jenkins.plugins.git.GitSCMSource
import org.jenkinsci.plugins.workflow.libs.*
import org.jenkinsci.plugins.workflow.libs.LibraryConfiguration
import org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever
@ivan-pinatti
ivan-pinatti / jenkins-set-bitbucket-cloud-endpoint.groovy
Created May 21, 2018 14:50
Jenkins - Set Bitbucket Cloud Endpoint plugin parameters via groovy script to manage hooks - #jenkins #groovy #bitbucket #bitbucketcloud #bitbucketendpoint #hooks #webhooks
#!groovy
// imports
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.Domain
import com.cloudbees.plugins.credentials.impl.*
import hudson.util.Secret
import jenkins.model.Jenkins
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.*
@ivan-pinatti
ivan-pinatti / jenkins-add-username-with-password-credential.groovy
Created May 21, 2018 14:49
Jenkins - Add Username with password credential via groovy script - #jenkins #groovy #username #password #credential #usernameWithPassword
#!groovy
// imports
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.Domain
import com.cloudbees.plugins.credentials.impl.*
import hudson.util.Secret
import jenkins.model.Jenkins
// parameters
@ivan-pinatti
ivan-pinatti / jenkins-set-system-message.groovy
Created May 21, 2018 14:24
Jenkins - Set Jenkins system message via groovy script - #jenkins #groovy #system #message
#!groovy
// imports
import jenkins.model.Jenkins
// parameters
def systemMessage = "Insert your Jenkins system message here."
// get Jenkins instance
Jenkins jenkins = Jenkins.getInstance()
@ivan-pinatti
ivan-pinatti / docker-client-check-tls.sh
Created January 31, 2018 21:54
Check TLS in a remote Docker service - #docker #docker-tls #tls #ubuntu #docker-client
#!/usr/bin/env bash
: ' Script to validate a remote Docker service running with TLS
It assumes that the server was configured using my other script hosted in
Gist through the link;
https://gist.github.com/ivan-pinatti/6ad05557e526f1f32ca357d15139df83
Usage:
@ivan-pinatti
ivan-pinatti / docker-configure-tls.sh
Last active January 13, 2024 19:32
Enable TLS in Docker service running in Ubuntu - #docker #docker-tls #tls #ubuntu
#!/usr/bin/env bash
: ' Script that enables TLS for Docker service in Ubuntu 16.x
This script is intended to be run as root
It;
- Generates the keys
- Creates the daemon.json Docker config file
@ivan-pinatti
ivan-pinatti / import-mysql.sh
Last active April 19, 2021 03:55
Import MySQL database with optimized options - #mysql #database #import #bash
#!/usr/bin/env bash
: ' A simple MySQL import script with optimized options
'
# check if debug flag is set
if [ "${DEBUG}" = true ]; then
set -x # enable print commands and their arguments as they are executed.