https://github.com/harisekhon/devops-golang-tools
DevOps Golang tools
https://github.com/harisekhon/devops-golang-tools
devops go golang hacktoberfest http
Last synced: 4 months ago
JSON representation
DevOps Golang tools
- Host: GitHub
- URL: https://github.com/harisekhon/devops-golang-tools
- Owner: HariSekhon
- License: mit
- Created: 2020-04-30T15:16:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-14T19:40:44.000Z (7 months ago)
- Last Synced: 2025-03-14T20:28:10.433Z (7 months ago)
- Topics: devops, go, golang, hacktoberfest, http
- Language: Shell
- Homepage: https://www.linkedin.com/in/HariSekhon
- Size: 556 KB
- Stars: 51
- Watchers: 4
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Hari Sekhon - DevOps Golang Tools
[](https://github.com/HariSekhon/DevOps-Golang-tools/stargazers)
[](https://github.com/HariSekhon/DevOps-Golang-tools/network)
[](https://github.com/boyter/scc/)
[](https://github.com/boyter/scc/)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/LICENSE)
[](https://www.linkedin.com/in/HariSekhon/)
[](https://github.com/HariSekhon/DevOps-Golang-tools/commits/master)[](https://www.codacy.com/gh/HariSekhon/DevOps-Golang-tools/dashboard)
[](https://www.codefactor.io/repository/github/harisekhon/DevOps-Golang-tools)
[](https://lgtm.com/projects/g/HariSekhon/DevOps-Golang-tools/context:golang)
[](https://sonarcloud.io/dashboard?id=HariSekhon_DevOps-Golang-tools)
[](https://sonarcloud.io/dashboard?id=HariSekhon_DevOps-Golang-tools)
[](https://sonarcloud.io/dashboard?id=HariSekhon_DevOps-Golang-tools)
[](https://sonarcloud.io/dashboard?id=HariSekhon_DevOps-Golang-tools)
[](https://sonarcloud.io/summary/new_code?id=HariSekhon_DevOps-Golang-tools)
[](https://lgtm.com/projects/g/HariSekhon/DevOps-Golang-tools/alerts/)[](https://github.com/HariSekhon/DevOps-Golang-tools)
[](https://github.com/HariSekhon/DevOps-Golang-tools)
[](https://hub.docker.com/r/harisekhon/github/)
[](https://github.com/HariSekhon/Dockerfiles)
[](https://hub.docker.com/r/harisekhon/github)[](https://harisekhon.github.io/CI-CD/)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/Jenkinsfile)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/cicd/.concourse.yml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/cicd/.gocd.yml)
[](https://github.com/HariSekhon/TeamCity-CI)[](https://circleci.com/gh/HariSekhon/DevOps-Golang-tools)
[](https://buildkite.com/hari-sekhon/devops-golang-tools)
[](https://ci.appveyor.com/project/HariSekhon/DevOps-Golang-tools/branch/master)
[](https://cloud.drone.io/HariSekhon/DevOps-Golang-tools)
[](https://g.codefresh.io/pipelines/edit/new/builds?id=5fef73e62e168ebc6dd24d07&pipeline=DevOps-Golang-tools&projects=GitHub&projectId=5fef73e62e168ebc6dd24d07&context=github&filter=page:1;pageSize:10;timeFrameStart:week)
[](https://cirrus-ci.com/github/HariSekhon/DevOps-Golang-tools)
[](https://harisekhon.semaphoreci.com/projects/DevOps-Golang-tools)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/buddy.yml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/shippable.yml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/.travis.yml)[](https://dev.azure.com/harisekhon/GitHub/_build/latest?definitionId=13&branchName=master)
[](https://gitlab.com/HariSekhon/DevOps-Golang-tools/pipelines)
[](https://bitbucket.org/harisekhon/devops-golang-tools/addon/pipelines/home#!/)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/cicd/buildspec.yml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/blob/master/cicd/cloudbuild.yaml)[](https://github.com/HariSekhon/DevOps-Golang-tools)
[](https://gitlab.com/HariSekhon/DevOps-Golang-tools)
[](https://dev.azure.com/harisekhon/GitHub/_git/DevOps-Golang-tools)
[](https://bitbucket.org/HariSekhon/DevOps-Golang-tools)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/shellcheck.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/json.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/yaml.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/xml.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/markdown.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/validate.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/kics.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/grype.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/semgrep.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/semgrep-cloud.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/trivy.yaml)[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22GitHub+Actions+Ubuntu%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/mac.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/mac_11.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions/workflows/mac_12.yaml)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Ubuntu%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Ubuntu+20.04%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Ubuntu+22.04%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Debian%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Debian+10%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Debian+11%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Debian+12%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22CentOS%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22CentOS+7%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22CentOS+8%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Fedora%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Alpine%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Alpine+3%22)[](https://github.com/HariSekhon/DevOps-Golang-tools)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+latest%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.9%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.10%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.11%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.12%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.13%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.14%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.15%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.16%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.17%22)
[](https://github.com/HariSekhon/DevOps-Golang-tools/actions?query=workflow%3A%22Golang+1.18%22)[git.io/go-tools](https://git.io/go-tools)
## DevOps Golang Tools
All programs have `--help` to list the available options.
Hari Sekhon
Cloud & Big Data Contractor, United Kingdom
[https://www.linkedin.com/in/HariSekhon](https://www.linkedin.com/in/HariSekhon)
*(you're welcome to connect with me on LinkedIn)***Make sure you run `make update` if updating and not just `git pull` as you will often need the latest library submodule and possibly new upstream libraries**
## Quick Start
### Ready to run Docker image
All programs and their pre-compiled dependencies can be found ready to run on [DockerHub](https://hub.docker.com/r/harisekhon/go-tools/).
List all programs:
```shell
docker run harisekhon/go-tools
```Run any given program:
```shell
docker run harisekhon/go-tools
```### Automated Build from source
installs git, make, pulls the repo and build the binaries:
```shell
curl -L https://git.io/go-bootstrap | sh
```or manually:
```shell
git clone https://github.com/HariSekhon/DevOps-Golang-tools go-tools
cd go-tools
make
```The `make` command automates building the go binaries which can then be copied around to other systems of the same
family, eg. Linux or Mac.Alternatively there is shebang magic which means each `.go` program can be called directly like a script and it'll
runtime compile and execute instantly like a scripted language. This is a neat trick for quick usage and testing built
on `go run`, but for frequent use the compiled binaries are usually the way to go.[Detailed Build Instructions](https://github.com/HariSekhon/DevOps-Golang-tools#detailed-build-instructions) are available further down.
### Usage
All programs come with a `--help` switch which includes a program description and the list of command line options.
Environment variables are supported for convenience and also to hide credentials from being exposed in the process list
eg. `$PASSWORD`, `$TRAVIS_TOKEN`. These are indicated in the `--help` descriptions in brackets next to each option and
often have more specific overrides with higher precedence eg. `$AMBARI_HOST`, `$HBASE_HOST` take priority over `$HOST`.### DevOps Golang Tools - Inventory
- Linux:
- `uniq2.go` - like `uniq` but you don't have to sort first and it preserves the ordering
- `diffnet.go` - simplifies diff output to show only lines added/removed, not moved, from patch files or stdin
(pipe from standard `diff` or `git diff` commands)
- `httpfirst.go` - returns the first http/https url address argument to respond (fastest multi-threaded reply using
go channels). More sophisticated version is `find_active_server.py` in the [DevOps Python tools](https://github.com/HariSekhon/DevOps-Python-tools) repo which can
handle multi-master clusters, tcp sockets, regex etc.
- `pldd.go` - parses `/proc` on Linux to show the runtime `.so` loaded dynamic shared libraries a program pid is
using. Runtime equivalent of the classic static `ldd` command and because the system `pldd` command often fails to
attach to a process
- `colors.go` - prints a table of terminal colors and their escape codes for doing fancy shell stuff
- `welcome.go` - cool spinning welcome message greeting your username and showing last login time and user to put in
your shell's `.profile` (there are also Python and Perl versions in my
[DevOps Python Tools](https://github.com/HariSekhon/DevOps-Python-tools) and
[DevOps Perl Tools](https://github.com/HariSekhon/DevOps-Perl-tools) repos)### Detailed Build Instructions
#### Manual Setup
Enter the go-tools directory and run git submodule init and git submodule update to fetch my library repo:
```shell
git clone https://github.com/HariSekhon/DevOps-Golang-tools go-tools
cd go-tools
git submodule update --init
./compile.sh
```##### Mac OS X
The automated build also works on Mac OS X but you'll need to install [Apple XCode](https://developer.apple.com/download/) (on recent Macs just typing
`git` is enough to trigger Xcode install).I also recommend you get [HomeBrew](https://brew.sh/) to install other useful tools and libraries you may need like OpenSSL for
development headers and tools such as wget (these are installed automatically if Homebrew is detected on Mac OS X):```shell
bash-tools/install/install_homebrew.sh
```### Updating
Run `make update`. This will git pull and then git submodule update which is necessary to pick up corresponding library
updates.### Contributions
Patches, improvements and even general feedback are welcome in the form of GitHub pull requests and issue tickets.
## Star History
[](https://star-history.com/#HariSekhon/DevOps-Golang-tools&Date)
[git.io/go-tools](https://git.io/go-tools)
## More Core Repos
### Knowledge
[](https://github.com/HariSekhon/Knowledge-Base)
[](https://github.com/HariSekhon/Diagrams-as-Code)### DevOps Code
[](https://github.com/HariSekhon/DevOps-Bash-tools)
[](https://github.com/HariSekhon/DevOps-Python-tools)
[](https://github.com/HariSekhon/DevOps-Perl-tools)
[](https://github.com/HariSekhon/DevOps-Golang-tools)### Containerization
[](https://github.com/HariSekhon/Kubernetes-configs)
[](https://github.com/HariSekhon/Dockerfiles)### CI/CD
[](https://github.com/HariSekhon/GitHub-Actions)
[](https://github.com/HariSekhon/Jenkins)### DBA - SQL
[](https://github.com/HariSekhon/SQL-scripts)
### DevOps Reloaded
[](https://github.com/HariSekhon/Nagios-Plugins)
[](https://github.com/HariSekhon/HAProxy-configs)
[](https://github.com/HariSekhon/Terraform)
[](https://github.com/HariSekhon/Packer-templates)
[](https://github.com/HariSekhon/Nagios-Plugin-Kafka)### Templates
[](https://github.com/HariSekhon/Templates)
[](https://github.com/HariSekhon/Template-repo)### Misc
[](https://github.com/HariSekhon/Spotify-tools)
[](https://github.com/HariSekhon/Spotify-playlists)The rest of my original source repos are
[here](https://github.com/HariSekhon?tab=repositories&q=&type=source&language=&sort=stargazers).Pre-built Docker images are available on my [DockerHub](https://hub.docker.com/u/harisekhon/).
