A command-line tool that triggers command when the input (doesn't) comes from STDIN in an interval.

conk

A command-line tool that triggers command when the input (doesn't) comes from STDIN in an interval.

Usage

$ conk -h
A command-line tool that triggers command when the input (doesn't) comes from STDIN in an interval.
If the input comes from STDIN, it fires "--on-notified-cmd" command. Elsewise, it executes "--on-not-notified-cmd".

Usage of ./conk:
   ./conk [OPTIONS]
Options
  -dry-run
        dry-run mode. if this value is true, it notifies the command was triggered, instead of executing commands.
  -interval-sec uint
        [mandatory] interval duration seconds to check the bytes that come from stdin.
  -on-not-notified-cmd string
        [semi-mandatory] command that runs on NOT notified (i.e. when bytes don't come from stdin in an interval). this must be JSON string array. it requires this value and/or "--on-notified-cmd" (default "[]")
  -on-notified-cmd string
        [semi-mandatory] command that runs on notified (i.e. when bytes come from stdin in an interval). this must be JSON string array. it requires this value and/or "--on-not-notified-cmd" (default "[]")
  -on-ticked-cmd string
        command that runs every interval. this must be JSON string array. (default "[]")
  -version
        show version info
Screen.Recording.2021-10-08.at.11.52.21.mov

Releases

https://github.com/moznion/conk/releases

Author

moznion ([email protected])

Owner
moznion
I usually don't read e-mail. If you want to tell me something (e.g. "response an issue just now!"), please send me a message through twitter:@moznion.
moznion
Similar Resources

Go package and associated command line utility to generate random yet human-readable names and identifiers

Go package and associated command line utility to generate random yet human-readable names and identifiers

namegen | What's this? Go package and associated command line utility to generate random yet human-readable names and identifiers. Somewhat inspired b

Oct 19, 2022

The command-line client for Cloudflare Tunnel

Cloudflare Tunnel client Contains the command-line client for Cloudflare Tunnel, a tunneling daemon that proxies traffic from the Cloudflare network t

Feb 10, 2022

Ghdl - A much more convenient way to download GitHub release binaries on the command line, works on Win & Unix-like systems

ghdl Memorize ghdl as github download ghdl is a fast and simple program (and als

Oct 12, 2022

Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

  Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

gore Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. (Screencast taken with cho45/KeyCast) Usage gore Af

Jan 7, 2023

Colorize (highlight) `go build` command output

Colorize (highlight) `go build` command output

colorgo colorgo is a wrapper to go command that colorizes output from go build and go test. Installation go get -u github.com/songgao/colorgo Usage c

Dec 18, 2022

Simple plugin to enable the /flip command inside of Mattermost

Plugin Starter Template This plugin serves as a starting point for writing a Mattermost plugin. Feel free to base your own plugin off this repository.

Nov 4, 2021

command faker

command faker

Dec 28, 2021

Run The World. Command aggregator output. Define many services watch them in one place.

Run The World. Command aggregator output. Define many services watch them in one place.

Feb 2, 2022

Executor - Wrapper for exec.Command for simple using and multi commands executing

executor Examples package main import ( "fmt" "github.com/solar-jsoc/execut

Feb 12, 2022
Comments
  • Support `stdin-placeholder` and `stdin-distinct` option

    Support `stdin-placeholder` and `stdin-distinct` option

    stdin-placeholder option receives a placeholder name that can be used in on-notified-cmd to give the command the arguments that come from STDIN.

    For example,

    $ generator | conk -interval-sec 3 -on-notified-cmd '["echo", "{{__STDIN__}}"]' -stdin-placeholder '{{__STDIN__}}'
    

    if the generator outputs foo\nbar\nbuz\n to STDOUT in 3 seconds, the conk command interpolates those texts in {{__STDIN__}}, like `["echo", "foo", "bar", "buz"].

    And stdin-distinct option accepts the flag to instruct whether it makes the arguments for on-notified-cmd that come from STDIN distinct, i.e. makes them unique.

    $ generator | conk -interval-sec 3 -on-notified-cmd '["echo", "{{__STDIN__}}"]' -stdin-placeholder '{{__STDIN__}}' -stdin-distinct
    

    in these commands, if the generator outputs foo\nbar\nfoo\nfoo to STDOUT in 3 seconds, the conk command interpolates those texts in {{__STDIN__}} with unique arguments, like ["echo", "foo", "bar"] becausefoo` is duplicated.

  • Configure Renovate

    Configure Renovate

    WhiteSource Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/release.yml (github-actions)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation
    • If semantic commits detected, use semantic commit type fix for dependencies and chore for all others
    • Ignore node_modules, bower_components, vendor and various test/tests directories
    • Autodetect whether to pin dependencies or maintain ranges
    • Rate limit PR creation to a maximum of two per hour
    • Limit to maximum 20 open PRs at any time
    • Group known monorepo packages together
    • Use curated list of recommended non-monorepo package groupings
    • Ignore spring cloud 1.x releases
    • Ignore http4s digest-based 1.x milestones
    • Use node versioning for @types/node
    • Limit concurrent requests to reduce load on Repology servers until we can fix this properly, see issue 10133

    🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update module go to 1.19

    Update module go to 1.19

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | go (source) | golang | minor | 1.18 -> 1.19 |


    Release Notes

    golang/go

    v1.19.1

    v1.19.0


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Other Branches

    These updates are pending. To force PRs open, click the checkbox below.

    • [ ] Update actions/checkout action to v3
    • [ ] Update actions/setup-go action to v3
    • [ ] Update goreleaser/goreleaser-action action to v3

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    github-actions
    .github/workflows/release.yml
    • actions/setup-go v2
    • actions/checkout v2
    • goreleaser/goreleaser-action v2
    gomod
    go.mod
    • go 1.18

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
Related tags
batcher collect a data and flush it if the batch is full or the interval is elapsed.

Batcher batcher collect a data and flush it if the batch is full or the interval is elapsed. Installation go get github.com/gotidy/batcher Examples ba

Jan 6, 2022
Testing the use of a golang wrapper around UserMode Linux for making stdin

This code is for testing the use of a golang wrapper around UserMode Linux for making stdin, stdout and stderr available to attach, detach and reattach to from the host using Unix sockets.

Dec 24, 2021
Filter out multiple strings from stdin.

minus The minus tool accepts data from stdin and filters out any arguments passed. It simplifies something like this: some_command | grep -vF thing1 |

Dec 20, 2021
Decrypts and dumps K3s bootstrap data read from stdin.

k3s-dump-bootstrap Decrypts and dumps K3s bootstrap data read from stdin. Note: <token> parameter should be just the bare passphrase, not a full K10-f

Jan 12, 2022
Takes a list of poker hands for two players in STDIN and scores them

Poker Hand Sorter Takes a list of poker hands for two players in STDIN and scores them. Returns the number of hands won by each player. Prerequisites

Jan 16, 2022
DSV Parallel Processor takes input files and query specification via a spec file

DSV Parallel Processor Spec file DSV Parallel Processor takes input files and query specification via a spec file (conventionally named "spec.toml").

Oct 9, 2021
Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file

About hclmergetool Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file Installation Binary Rel

Feb 6, 2022
Input Geojson and utilize Dijkstra's formula to provide the best route between two sets of coordinates

Golang GeoJson Dijkstra Golang GeoJson Dijkstra utilizes GeoJson Feature Collections to find the best the shortest route between two points. Installat

Dec 27, 2022
A command line tool to generate sequence diagrams
A command line tool to generate sequence diagrams

goseq - text based sequence diagrams A small command line utility used to generate UML sequence diagrams from a text-base definition file. Inspired by

Dec 22, 2022
Wordle - Wordle on command line

wordle Play WORDLE on the command line. Installation go install github.com/howey

May 19, 2022