{"id":18151287,"url":"https://github.com/msantos/tscat","last_synced_at":"2025-07-05T20:05:39.039Z","repository":{"id":136621833,"uuid":"293258145","full_name":"msantos/tscat","owner":"msantos","description":"Timestamp stdin to stdout/stderr","archived":false,"fork":false,"pushed_at":"2025-03-29T12:05:59.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T13:22:08.232Z","etag":null,"topics":["capsicum","logging","pledge","seccomp","setrlimit","stdio","timestamp"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msantos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-06T11:02:49.000Z","updated_at":"2025-03-29T12:06:03.000Z","dependencies_parsed_at":"2025-03-29T13:20:36.449Z","dependency_job_id":"81937792-4bf8-46f1-ac9d-2f2cba9f15e3","html_url":"https://github.com/msantos/tscat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Ftscat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Ftscat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Ftscat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Ftscat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msantos","download_url":"https://codeload.github.com/msantos/tscat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247568998,"owners_count":20959754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capsicum","logging","pledge","seccomp","setrlimit","stdio","timestamp"],"created_at":"2024-11-02T01:07:15.406Z","updated_at":"2025-04-06T23:29:35.084Z","avatar_url":"https://github.com/msantos.png","language":"C","readme":"# SYNOPSIS\n\ntscat *option* [*label*]\n\n# DESCRIPTION\n\ntscat: timestamp stdin to stdout/stderr\n\ntscat timestamps standard input and writes the output to standard output,\nstandard error or both.\n\n# EXAMPLES\n\n```\n$ echo test | tscat\n2020-10-11T07:09:13-0400 test\n\n$ echo test | tscat foo\n2020-10-11T07:09:15-0400 foo test\n\n# duplicate output to stdout/stderr\n$ echo test | tscat -o 3 foo\n2020-10-11T07:09:15-0400 foo 2020-10-11T07:09:15-0400 foo test\ntest\n\n$ echo test | tscat -o 3 foo \u003e /dev/null\n2020-10-11T07:09:15-0400 foo test\n\n$ echo test | tscat -o 3 foo 2\u003e /dev/null\n2020-10-11T07:09:15-0400 foo test\n```\n\n# Build\n\n```\nmake\n\n# selecting process restrictions\nRESTRICT_PROCESS=seccomp make\n\n#### using musl\nRESTRICT_PROCESS=rlimit ./musl-make\n\n## linux seccomp sandbox: requires kernel headers\n\n# clone the kernel headers somewhere\nexport MUSL_INCLUDE=/tmp\ngit clone https://github.com/sabotage-linux/kernel-headers.git $MUSL_INCLUDE/kernel-headers\n\n# then compile\n./musl-make clean all\n```\n\n# OPTIONS\n\n-o, --output *1|2|3*\n: stdout=1, stderr=2, both=3 (default: 1)\n\n-f, --format *fmt*\n: timestamp format (see strftime(3)) (default: `%F%T%z`)\n\n-W, --write-error *exit|drop|block*\n: behaviour if write buffer is full (default: block)\n\n-h, --help\n: usage summary\n\n# ALTERNATIVES\n\n```shell\n#!/bin/sh\n\nLABEL=\"${1-\"\"}\"\nexec awk -v service=\"$LABEL\" '{\n  t = strftime(\"%FT%T%z\")\n  printf(\"%s %s %s\\n\", t, service, $0) \u003e \"/dev/stderr\"\n  printf(\"%s %s %s\\n\", t, service, $0)\n  fflush()\n}'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsantos%2Ftscat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsantos%2Ftscat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsantos%2Ftscat/lists"}