jenkins_url + /api/json?tree=jobs[name,color]
jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]
| #!/bin/bash | |
| function terraform-install() { | |
| [[ -f ${HOME}/bin/terraform ]] && echo "`${HOME}/bin/terraform version` already installed at ${HOME}/bin/terraform" && return 0 | |
| LATEST_URL=$(curl -sL https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep 'linux.*amd64' |tail -1) | |
| curl ${LATEST_URL} > /tmp/terraform.zip | |
| mkdir -p ${HOME}/bin | |
| (cd ${HOME}/bin && unzip /tmp/terraform.zip) | |
| if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc) ]]; then | |
| echo 'export PATH=${HOME}/bin:${PATH}' >> ~/.bashrc |
src: https://www.stationx.net/nmap-cheat-sheet
| Switch | Example | Description |
| #!/bin/bash | |
| # run this scripts with `bash emoji-info.sh` or `./emoji-info.sh` | |
| usage() { | |
| cat << EOF | |
| usage: $0 [options] <emoji> | |
| Options: | |
| -h Show this message | |
| -o Octal Escape Sequence |
| #!/bin/bash | |
| # run this scripts with `bash emoji-info.sh` or `./emoji-info.sh` | |
| usage() { | |
| cat << EOF | |
| usage: $0 [options] <emoji> | |
| Options: | |
| -h Show this message | |
| -o Octal Escape Sequence |
| FROM golang:1.12-alpine as builder | |
| ARG VERSION=2.3.930.0 | |
| RUN set -ex && apk add --no-cache make git gcc libc-dev curl bash && \ | |
| curl -sLO https://github.com/aws/amazon-ssm-agent/archive/${VERSION}.tar.gz && \ | |
| mkdir -p /go/src/github.com && \ | |
| tar xzf ${VERSION}.tar.gz && \ | |
| mv amazon-ssm-agent-${VERSION} /go/src/github.com/amazon-ssm-agent && \ | |
| cd /go/src/github.com/amazon-ssm-agent && \ | |
| echo ${VERSION} > VERSION && \ | |
| gofmt -w agent && make checkstyle || ./Tools/bin/goimports -w agent && \ |
| # Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates. | |
| # All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"). | |
| # You may not use this file except in compliance with the License. | |
| # A copy of the License is located at | |
| # | |
| # http://aws.amazon.com/apache2.0/ | |
| # | |
| # or in the "license" file accompanying this file. This file is |
| #!/bin/bash | |
| # | |
| # this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe | |
| # mounted at /mnt. It should be run early on the first boot of the system. | |
| # | |
| # Beware, This script is NOT fully idempotent. | |
| # | |
| METADATA_URL_BASE="http://169.254.169.254/2012-01-12" |
| { | |
| "Statement": [ | |
| { | |
| "Sid": "EC2DescribeInstances", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "ec2:DescribeInstances", | |
| "ec2:DescribeTags" | |
| ], | |
| "Resource": [ |