Coder Social home page Coder Social logo

cmd's Introduction

cmd Build Status Build Status Build status Coverage Status

Handmade cmd for day-to-day plumbing.

Installation

~ $ go get -u github.com/rjeczalik/cmd/...

cmd/notify GoDoc

Listens on filesystem changes and forwards received mapping to user-defined handlers.

Documentation

godoc.org/github.com/rjeczalik/cmd/notify

Usage

~ $ notify -c 'echo "Hello from handler! (event={{.Event}}, path={{.Path}})"'
2015/02/17 01:17:40 received notify.Create: "/Users/rjeczalik/notify.tmp"
Hello from handler! (event=create, path=/Users/rjeczalik/notify.tmp)
...
~ $ cat > handler <<EOF
> echo "Hello from handler! (event={{.Event}}, path={{.Path}})"
> EOF

~ $ notify -f handler
2015/02/17 01:22:26 received notify.Create: "/Users/rjeczalik/notify.tmp"
Hello from handler! (event=create, path=/Users/rjeczalik/notify.tmp)
...

cmd/dln GoDoc

Prints derivative computed out of line-separated numbers.

Documentation

godoc.org/github.com/rjeczalik/cmd/dln

Usage

~ $ curl -sS http://cdimage.ubuntu.com/daily-live/current/vivid-desktop-amd64.iso -o vivid-amd64.iso &
[1] 21496
~ $ while sleep 1; do du -BK vivid-amd64.iso ; done | dln
1008
1172
1548
2332
3200
4756
6572
7056
7052
7048
7060
7036
7048
7056
^C

cmd/hist GoDoc

Prints histogram for line-separated data points. It sorts the result set by the number of occurances in descending order.

Documentation

godoc.org/github.com/rjeczalik/cmd/hist

Usage

~ $ log=https://gist.githubusercontent.com/rjeczalik/f18349ad629f07d19839/raw/b8089282fdd5a8ea8589fe33bc88cc6d29db7026/lazyvm.log
~ $ curl -sS $log | dln | hist
  0	962	░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1	5	
 18	3	
  3	2	
  9	1	
  6	1	
 49	1	
 23	1	
 22	1	
 21	1	
 59	1	
 11	1	
 78	1	
  4	1	
 42	1	
  2	1
~ $ curl -sS $log | dln | hist -slice 1:
  1	5	░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
 18	3	░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  3	2	░░░░░░░░░░░░░░░░░░░░░░░░░
  9	1	░░░░░░░░░░░░
  6	1	░░░░░░░░░░░░
 49	1	░░░░░░░░░░░░
 23	1	░░░░░░░░░░░░
 22	1	░░░░░░░░░░░░
 21	1	░░░░░░░░░░░░
 59	1	░░░░░░░░░░░░
 11	1	░░░░░░░░░░░░
 78	1	░░░░░░░░░░░░
  4	1	░░░░░░░░░░░░
 42	1	░░░░░░░░░░░░
  2	1	░░░░░░░░░░░░

cmd/prepend GoDoc

Command prepend inserts data read from stdin or an input file at the begining of the given file.

If data to prepend is passed both via stdin and input file, first the given file is prepended with data read from stdin, then from input file.

The prepend command does not load the files contents to the memory, making it suitable for large files. Writes issued by the prepend command are atomic, meaning if reading from stdin or input file fails the original file is left untouched.

Documentation

godoc.org/github.com/rjeczalik/cmd/prepend

Usage

~ $ cat > preamble.txt <<EOF
> // Copyright (c) 2015 Your Team. All right reserved.
> // Use of this source code is governed by the X license
> // that can be found in the LICENSE file
>
> EOF

~ $ preprend -u -f preamble.txt *.go

cmd/draft-init GoDoc

Command draft-init is a conveniance wrapper for draft init and docker login commands, which is used to configure both - draft and docker - using GCP's service account json key file.

Documentation

godoc.org/github.com/rjeczalik/cmd/draft-init

Installation

$ go get -u github.com/rjeczalik/cmd/draft-init

Usage

Usage of draft-init:
  -docker
    	Initialize docker only.
  -domain string
    	Base domain for applications.
  -dry
    	Print commands only.
  -f string
    	Service account JSON key file.
  -gcr string
    	Container registry host. (default "gcr.io")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.