- Notifications
You must be signed in to change notification settings - Fork20
HariSekhon/DevOps-Golang-tools
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
All programs have--help
to list the available options.
Hari Sekhon
Cloud & Big Data Contractor, United Kingdom
https://www.linkedin.com/in/HariSekhon
(you're welcome to connect with me on LinkedIn)
Make sure you runmake update
if updating and not justgit pull
as you will often need the latest library submodule and possibly new upstream libraries
All programs and their pre-compiled dependencies can be found ready to run onDockerHub.
List all programs:
docker run harisekhon/go-tools
Run any given program:
docker run harisekhon/go-tools<program><args>
installs git, make, pulls the repo and build the binaries:
curl -L https://git.io/go-bootstrap| sh
or manually:
git clone https://github.com/HariSekhon/DevOps-Golang-tools go-toolscd go-toolsmake
Themake
command automates building the go binaries which can then be copied around to other systems of the samefamily, eg. Linux or Mac.
Alternatively there is shebang magic which means each.go
program can be called directly like a script and it'llruntime compile and execute instantly like a scripted language. This is a neat trick for quick usage and testing builtongo run
, but for frequent use the compiled binaries are usually the way to go.
Detailed Build Instructions are available further down.
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 listeg.$PASSWORD
,$TRAVIS_TOKEN
. These are indicated in the--help
descriptions in brackets next to each option andoften have more specific overrides with higher precedence eg.$AMBARI_HOST
,$HBASE_HOST
take priority over$HOST
.
- Linux:
uniq2.go
- likeuniq
but you don't have to sort first and it preserves the orderingdiffnet.go
- simplifies diff output to show only lines added/removed, not moved, from patch files or stdin(pipe from standarddiff
orgit diff
commands)httpfirst.go
- returns the first http/https url address argument to respond (fastest multi-threaded reply usinggo channels). More sophisticated version isfind_active_server.py
in theDevOps Python tools repo which canhandle 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 isusing. Runtime equivalent of the classic staticldd
command and because the systempldd
command often fails toattach to a processcolors.go
- prints a table of terminal colors and their escape codes for doing fancy shell stuffwelcome.go
- cool spinning welcome message greeting your username and showing last login time and user to put inyour shell's.profile
(there are also Python and Perl versions in myDevOps Python Tools andDevOps Perl Tools repos)
Enter the go-tools directory and run git submodule init and git submodule update to fetch my library repo:
git clone https://github.com/HariSekhon/DevOps-Golang-tools go-toolscd go-toolsgit submodule update --init./compile.sh
The automated build also works on Mac OS X but you'll need to installApple XCode (on recent Macs just typinggit
is enough to trigger Xcode install).
I also recommend you getHomeBrew to install other useful tools and libraries you may need like OpenSSL fordevelopment headers and tools such as wget (these are installed automatically if Homebrew is detected on Mac OS X):
bash-tools/install/install_homebrew.sh
Runmake update
. This will git pull and then git submodule update which is necessary to pick up corresponding libraryupdates.
Patches, improvements and even general feedback are welcome in the form of GitHub pull requests and issue tickets.
The rest of my original source repos arehere.
Pre-built Docker images are available on myDockerHub.
About
DevOps Golang tools
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.