{"id":20122877,"url":"https://github.com/freaky/comlim","last_synced_at":"2026-05-13T19:32:28.836Z","repository":{"id":142942523,"uuid":"145925893","full_name":"Freaky/comlim","owner":"Freaky","description":"Run subprocesses with resource limits","archived":false,"fork":false,"pushed_at":"2018-08-24T01:23:27.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T20:30:49.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Freaky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-08-24T01:23:13.000Z","updated_at":"2018-08-24T01:23:28.000Z","dependencies_parsed_at":"2023-06-25T21:18:23.990Z","dependency_job_id":null,"html_url":"https://github.com/Freaky/comlim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Freaky/comlim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcomlim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcomlim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcomlim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcomlim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freaky","download_url":"https://codeload.github.com/Freaky/comlim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcomlim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32997576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T19:41:36.358Z","updated_at":"2026-05-13T19:32:28.816Z","avatar_url":"https://github.com/Freaky.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Comlim\n\nA subprocess command builder/runner with a focus on enforcing limits to\nruntime, memory use, CPU use, and command output.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'comlim'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install comlim\n\n(Then get upset when you realise I haven't pushed this to the masses yet).\n\n## Usage\n\nLimit stdout and stderr to a total of 1KiB.\n\n```ruby\nQuietRunner = Comlim.output(1024)\n```\n\nLimit it to 32MiB of memory.\n\n```ruby\nMemLimitedRunner = QuietRunner.memory(1024 * 1024 * 32)\n```\n\n2 seconds of CPU should be plenty:\n\n```ruby\nCpuMemLimitedRunner = MemLimitedRunner.cputime(2)\n```\n\n4 seconds of runtime, followed by summary execution:\n\n```ruby\nRestrictedRunner = CpuMemLimitedRunner.walltime(4)\n```\n\nUse it to run inline Ruby:\n\n```ruby\nRubyRunner = RestrictedRunner.command('ruby').arg('-e')\n```\n\nAnd finally use it to run some potentially runaway process:\n\n```ruby\nresult = RubyRunner.arg('loop { puts \"SMASH THE STATE!\" }')\npp result\n# =\u003e #\u003cstruct Comlim::Result\n# =\u003e pid=95544,\n# =\u003e status=#\u003cProcess::Status: pid 95544 exit 1\u003e,\n# =\u003e exitstatus=1,\n# =\u003e exitreason=Comlim::ExitReason::OutputExceeded,\n# =\u003e stdout=\n# =\u003e  \"SMASH THE STATE!\\n\" +\n# =\u003e  \"SMASH THE STATE!\\n\" +\n# =\u003e  ...\n# =\u003e  [SUBVERSIVE MESSAGE REDACTED]\n# =\u003e stderr=\"\",\n# =\u003e walltime=0.1225816321093589\u003e\n```\n\nBwahahaha.  Ahem.\n\n## Status\n\nEh, it probably mostly works on my machine.  I guess?\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/Freaky/comlim.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Fcomlim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreaky%2Fcomlim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Fcomlim/lists"}