This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Go 1.4 | |
CGO_ENABLED=0 GOOS=linux go get -a -installsuffix cgo -ldflags '-s' github.com/elastic/logstash-forwarder | |
# Go 1.3 | |
CGO_ENABLED=0 GOOS=linux go get -a -ldflags '-s' github.com/elastic/logstash-forwarder | |
# GOOS is the OS target of the binary | |
# -a forces recompilation of all components | |
# you can replace get with build and the GitHub URL with a path to the directory with the code | |
# the -s ld option strips the symbols from the binary making it smaller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ for d in $(for g in $(find "$GOPATH" -name .git); do r=${g%.git}; b=$(cd $r && git rev-parse --abbrev-ref HEAD); if [[ $b == HEAD ]]; then echo "$r"; fi; done | grep -v -F '/atomisthq/'); do echo "$d"; (cd "$d" && git fetch && git checkout master && git rebase); done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for c in stable beta alpha; do | |
for ra in $(curl -s "https://coreos.com/dist/aws/aws-$c.json" | jq --raw-output 'del(.release_info) | del(."us-gov-west-1") | map_values(.hvm) | to_entries | .[] | "\(.key):\(.value)"'); do | |
r=$(echo "$ra" | cut -d : -f 1) | |
a=$(echo "$ra" | cut -d : -f 2) | |
echo "$c $r $a" | |
aws --region "$r" ec2 describe-images --image-id "$a" | jq '.Images[].Name?' | |
done | |
done | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
) | |
func f() (e error) { | |
tmpDir, tmpErr := ioutil.TempDir("", "prefix") | |
if tmpErr != nil { | |
return nil, tmpErr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up the path to the local repository | |
local-repository: | |
path: "${user.home}/.atomist/repository" | |
# Set up remote repositories to query for Rug archives. Additionally one of the | |
# repositories can also be enabled for publication (publish: true). | |
remote-repositories: | |
maven-central: | |
publish: false | |
url: "http://repo.maven.apache.org/maven2/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up the path to the local repository | |
local-repository: | |
path: "${user.home}/.atomist/repository" | |
# Set up remote repositories to query for Rug archives. Additionally one of the | |
# repositories can also be enabled for publication (publish: true). | |
remote-repositories: | |
maven-central: | |
publish: false | |
url: "http://repo.maven.apache.org/maven2/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# link-image post one-liner for codeship | |
# Codeship sets CI_REPO_NAME and CI_COMMIT_ID, you must set DOCKER_IMAGE and ATOMIST_TEAM | |
# ATOMIST_TEAM should be your Atomist workspace/team ID | |
curl -s -f -X POST -H "Content-Type: application/json" \ | |
--data-binary "{\"git\":{\"owner\":\"${CI_REPO_NAME%/*}\",\"repo\":\"${CI_REPO_NAME#*/}\",\"sha\":\"$CI_COMMIT_ID\"},\"docker\":{\"image\":\"$DOCKER_IMAGE\"},\"type\":\"link-image\"}" \ | |
https://webhook.atomist.com/atomist/link-image/teams/$ATOMIST_TEAM | |
# Or, if you prefer to call a function, use this instead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as k8s from "@kubernetes/client-node"; | |
import { DeepPartial } from "ts-essentials"; | |
const serviceAccount: DeepPartial<k8s.V1ServiceAccount> = { | |
apiVersion: "v1", | |
kind: "ServiceAccount", | |
metadata: { | |
name: "noaccess", | |
}, | |
}; | |
const role: DeepPartial<k8s.V1Role> = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash kubernetes functions | |
# kubectl with kubeconfig | |
function k () { | |
kubectl --kubeconfig=kubeconfig "$@" | |
} | |
# exec shell in pod | |
function k8sh () { | |
local p="$1" | |
shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# test kaniko under gvisor | |
declare Pkg=kgtest | |
declare Version=0.1.0 | |
set -o pipefail | |
# usage: msg MSG | |
function msg () { |
OlderNewer