Skip to content

Instantly share code, notes, and snippets.

@skyionblue
skyionblue / kubectl.md
Created July 17, 2019 16:58 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@skyionblue
skyionblue / setup-users.groovy
Created June 6, 2019 11:07 — forked from wiz4host/setup-users.groovy
jenkins init.groovy.d script for configuring users
import jenkins.*
import hudson.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import hudson.plugins.sshslaves.*;
import hudson.model.*
import jenkins.model.*
import hudson.security.*
@skyionblue
skyionblue / convert id_rsa to pem
Created May 24, 2019 16:48 — forked from mingfang/convert id_rsa to pem
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem
@skyionblue
skyionblue / Jenkinsfile
Created May 10, 2019 22:15 — forked from chinshr/Jenkinsfile
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
for bucket in $(aws s3api list-buckets --query 'Buckets[*].{Name:Name}' --output text)
do
echo "$bucket:"
region=$(aws s3api get-bucket-location --bucket $bucket --query 'LocationConstraint' --output text | awk '{sub(/None/,"eu-west-1")}; 1')
parts=$(aws s3api list-multipart-uploads --bucket $bucket --region $region --query 'Uploads[*].{Key:Key,UploadId:UploadId}' --output text)
if [ "$parts" != "None" ]; then
IFS=$'\n'
@skyionblue
skyionblue / jxplat.sh
Created March 15, 2019 19:52 — forked from polothy/jxplat.sh
Get various versions given a JX Platform version
#!/bin/bash
# requirements: curl, yq, awk, grep
GREEN='\033[0;32m'
NC='\033[0m' # No Color
if [ -z "$1" ]; then
PLATV=`curl -s https://raw.githubusercontent.com/jenkins-x/jenkins-x-versions/master/charts/jenkins-x/jenkins-x-platform.yml | yq r - version`
else