jq is useful to slice, filter, map and transform structured json data.
brew install jq
| package main | |
| import ( | |
| "bytes" | |
| "io" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "os/exec" |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/containers/image/copy" | |
| "github.com/containers/image/docker" | |
| "github.com/containers/image/manifest" | |
| "github.com/containers/image/signature" | |
| "github.com/containers/image/types" |
| package tar_helper | |
| import ( | |
| "archive/tar" | |
| "compress/gzip" | |
| "errors" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "os" |
| image: gitlab.dev.terastrm.net:4567/terastream/cisco-nso/ci-cisco-nso:4.2.3 | |
| stages: | |
| - build | |
| - mr-robot | |
| variables: | |
| NCS_VERSION: "4.2.3" | |
| DOCKER_REGISTRY: "gitlab.dev.terastrm.net:4567/terastream/cisco-nso" | |
| TARGET_REGISTRY: "repo.dev.terastrm.net:5000/" |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| image2 "github.com/aquasecurity/fanal/artifact/image" | |
| "github.com/aquasecurity/fanal/cache" | |
| "github.com/aquasecurity/fanal/image" | |
| dbTypes "github.com/aquasecurity/trivy-db/pkg/types" | |
| "github.com/aquasecurity/trivy/pkg/log" |
| #!/usr/bin/env bash | |
| set -e | |
| # Proxy minikube to localhost on arbitrary port: | |
| kubectl proxy --port=8080 & | |
| sleep 3 | |
| # Now swagger.json is available at localhost:12345/openapi/v2 | |
| # Save to /tmp/temp/json and serve with e.g. docker swagger-ui container | |
| curl http://localhost:8080/openapi/v2 > /tmp/temp.json | |
| docker container run -d -p 9999:8080 -e SWAGGER_JSON=/var/specs/temp.json -v /tmp/temp.json:/var/specs/temp.json swaggerapi/swagger-ui |
This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.
While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.
| # Source: https://gist.github.com/820aecf0799d679d9082eef00d07b515 | |
| ############################################################################# | |
| # Bitnami Sealed Secrets # | |
| # How To Store Kubernetes Secrets In Git Repositories Without Getting Fired # | |
| # https://youtu.be/xd2QoV6GJlc # | |
| ############################################################################# | |
| # Referenced videos: | |
| # - What Is GitOps And Why Do We Want It?: https://youtu.be/qwyRJlmG5ew |