Skip to content

Instantly share code, notes, and snippets.

################### INSTALL METRICSBEAT ######################
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo 'deb https://artifacts.elastic.co/packages/oss-6.x/apt stable main' | sudo tee /etc/apt/sources.list.d/beats.list
sudo apt-get update && sudo apt-get install metricbeat
sudo metricbeat keystore create
echo "${elastic_pw}" | sudo bin/metricbeat-keystore add ES_PASSWORD
# echo "setup.dashboards.enabled: true" >> /etc/metricbeat/metricbeat.yml
cat <<EOT >> /etc/metricbeat/metricbeat.yml
output.elasticsearch:
@doytsujin
doytsujin / root-app.yaml
Created March 15, 2022 14:42 — forked from kusznerr/root-app.yaml
Sample root application for ArgoCD to enable app-of-apps pattern
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: root-app
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: argocd
@doytsujin
doytsujin / app-of-apps.yaml
Created March 15, 2022 14:42 — forked from mikesparr/app-of-apps.yaml
Argo CD App of Apps config
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: applications
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: argocd
@doytsujin
doytsujin / pipeline.groovy
Created March 11, 2022 14:38 — forked from paulchubatyy/pipeline.groovy
Jenkins pipeline to read the repository list for Github Organization and create multibranch pipeline projects for them
import org.kohsuke.github.*
/*
* This pipeline uses the Jenkins Job DSL plugin to create the multi-branch pipelines
* for your Github Organization repositories.
*
* @see https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
*
* It does not consumes 5k requests in 6 minutes, but actually queries the Github API
* for the repositories in organization and creates the Multi-Branch Pipelines in Jenkins.
@doytsujin
doytsujin / v1.groovy
Created March 9, 2022 23:44 — forked from zacker330/v1.groovy
jenkins-k8s-yaml-pipeline.groovy
System.setProperty("org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.defaultImage", "jenkins/jnlp-slave:3.36-2")
pipeline {
agent {
kubernetes {
label 'parent-pod'
containerTemplate(name: 'jnlp', image: "jenkins/jnlp-slave:3.10-1-alpine",args: '${computer.jnlpmac} ${computer.name}')
}
}
stages {
pipeline {
agent { label 'xxx' }
options { timestamps() }
environment {
KW_PROJECT_NAME = 'xxx'
}
stages {
stage('Checkout') {
steps {
@doytsujin
doytsujin / _Jenkins+Script+Console.md
Created March 9, 2022 23:42 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@doytsujin
doytsujin / Failure
Created March 9, 2022 23:42 — forked from doudou/Failure
Failing jenkins pipeline
Started by user admin
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: 296
java.lang.ArrayIndexOutOfBoundsException: 296
at org.codehaus.groovy.classgen.asm.CallSiteWriter.getCreateArraySignature(CallSiteWriter.java:58)
at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:317)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCachedCall(InvocationWriter.java:307)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:397)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:104)
@doytsujin
doytsujin / pipeline.groovy
Created March 9, 2022 23:41 — forked from cyrille-leclerc/pipeline.groovy
Escape character & quotes in Jenkins Pipeline
docker.image('cloudbees/java-build-tools:0.0.6').inside {
sshagent(['github-ssh-credentials']) {
sh """
git version
git config --local user.email \\"cleclerc@cloudbees.com\\"
git config --local user.name \\"Cyrille Le Clerc\\"
git clone git@github.com:cyrille-leclerc/a-test-repo.git
date &> now.txt
@doytsujin
doytsujin / nginxproxy.md
Created March 9, 2022 15:55 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers