Skip to content

Instantly share code, notes, and snippets.

@chaitanyakommoju
chaitanyakommoju / jenkins-decrypt.groovy
Created February 11, 2023 05:04 — forked from tuxfight3r/jenkins-decrypt.groovy
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'
@chaitanyakommoju
chaitanyakommoju / readme.md
Created November 20, 2022 19:33 — forked from sohlich/readme.md
Let's encrypt - generate SSL certificate manually via Cerbot DNS Challenge

Install Certbot

OSX

$ brew install certbot

Linux

Let's Encrypt certbot ACME client manual DNS challenge

certbot certonly [--dry-run] --manual --preferred-challenges dns-01 \
--domain example.com --domain www.example.com [...]

For each host passed via --domain, Let's Encrypt will prompt the user to create an _acme-challenge TXT record (_acme-challenge.example.com, _acme-challenge.www.example.com, etc.) with a specific value.

@chaitanyakommoju
chaitanyakommoju / jenkins-set-digitalocean-plugin-parameters.groovy
Created October 8, 2022 13:23 — forked from ivan-pinatti/jenkins-set-digitalocean-plugin-parameters.groovy
Jenkins - Set Digitalocean slaves plugin parameters via groovy script - #jenkins #groovy #jenkins-digitalocean #jenkins-slaves #jenkins-slave
#!groovy
// imports
import com.dubture.jenkins.digitalocean.DigitalOceanCloud
import com.dubture.jenkins.digitalocean.SlaveTemplate
import jenkins.model.Jenkins
// parameters
def slaveTemplateParameters = [
idleTerminationInMinutes: '10',
@chaitanyakommoju
chaitanyakommoju / jenkins-set-global-shared-library.groovy
Created October 8, 2022 13:22 — forked from ivan-pinatti/jenkins-set-global-shared-library.groovy
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
@chaitanyakommoju
chaitanyakommoju / jenkins-add-username-with-password-credential.groovy
Created October 8, 2022 13:22 — forked from ivan-pinatti/jenkins-add-username-with-password-credential.groovy
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
@chaitanyakommoju
chaitanyakommoju / jenkins-add-ssh-keypair-with-password-credential.groovy
Created October 8, 2022 13:20 — forked from ivan-pinatti/jenkins-add-ssh-keypair-with-password-credential.groovy
Jenkins - Add SSH keypair with password credential via groovy script - #jenkins #groovy #ssh #credential
#!groovy
// imports
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.Domain
import com.cloudbees.plugins.credentials.impl.*
import hudson.util.Secret
import java.nio.file.Files
@chaitanyakommoju
chaitanyakommoju / S3-Static-Sites.md
Created August 4, 2022 20:11 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

--------------------
Exit Commands
--------------------
:q Quit (a warning is printed if a modified file has not been saved)
:q! Quit (no warning)
:wq Write file to disk and quit the editor (a warning is printed if a modified other files)
### Commands ###
[command] [number] [moiton]
:q! - exit
:wq - exit save changes
:set number / :set nonumber - lines numbering
:!command - executes an external command
:command - executes an internal command