{"id":15425897,"url":"https://github.com/ultmaster/runexe","last_synced_at":"2025-03-16T19:19:48.632Z","repository":{"id":44589075,"uuid":"163045596","full_name":"ultmaster/runexe","owner":"ultmaster","description":"A *NIX only version for Codeforces Polygon runexe","archived":false,"fork":false,"pushed_at":"2022-07-18T21:53:37.000Z","size":1914,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T05:45:27.744Z","etag":null,"topics":["sandbox"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ultmaster.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-25T04:20:16.000Z","updated_at":"2021-11-16T17:28:35.000Z","dependencies_parsed_at":"2022-09-25T08:02:20.554Z","dependency_job_id":null,"html_url":"https://github.com/ultmaster/runexe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultmaster%2Frunexe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultmaster%2Frunexe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultmaster%2Frunexe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultmaster%2Frunexe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ultmaster","download_url":"https://codeload.github.com/ultmaster/runexe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918629,"owners_count":20368745,"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":["sandbox"],"created_at":"2024-10-01T17:54:01.373Z","updated_at":"2025-03-16T19:19:48.591Z","avatar_url":"https://github.com/ultmaster.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# runexe\n\nModified from the `runexe` written by the famous Mirzayanov from Saratov State U.\n\nThe motivation is to write a cross-platform runner for Hypercube, but as far as\nI'm concerned, there isn't a package for that, until I noticed runexe. \nThey have provided an exe in the polygon package; also a legendary version (old and\nunmaintained) of runexe is on the Github. So I want to modify this, so that the API \nwill eventually match the Windows version, at least for those features I'm going to use.\n\nHere is what I have done:\n\n* Interaction\n* Wrap the old `invocationResult` in `invocationResults`.\n* `SUCCESS` to `SUCCEEDED`.\n* A total refactorization of prettification of the project code.\n* Use `rlimit` to limit the resource.\n* Add `G` as a possible unit for memory.\n* Remove other features that I'm not gonna use and also are confusing me, such as, \n  login switch, environment setup, idleness check (on by default) and etc.\n\nNo security features (restrictions on system calls) are added, as it was not intended\nto build a sandbox for some online judge. However, this could be a good start, if you\nare also seeking some solution in untrusted-code-running-with-restrictions.\n\n## Command line help \n\n```\nRunExe for *NIX, Version 1.0\n\nThis program runs other program(s) for given period of time with specified\nrestrictions.\n\nCommand line format:\n  runexe [\u003cglobal options\u003e] [\u003cprocess properties\u003e] program [\u003cparameters\u003e]\n\nGlobal options:\n  -help         - show help\n  -xml          - print result in xml format (otherwise, use human-readable)\n  -interactor=\"\u003cprocess properties\u003e interactor \u003cparameters\u003e\"\n                  INTERACTOR MODE\n    Launch another process and cross-connect its stdin\u0026stdout with the main\n    program. Inside this flag, you can specify any process-controlling flags:\n    interactor can have its own limits, credentials, environment, directory.\n    In interactor mode, however, -i and -o have no effects on both main\n    program and interactor.\n  -ri=\u003cf\u003e       - in interactor mode, record program input to file \u003cf\u003e.\n  -ro=\u003cf\u003e       - in interactor mode, record program output to file \u003cf\u003e.\n\nProcess properties:\n  -t \u003cvalue\u003e    - time limit. Terminate after \u003cvalue\u003e seconds, you can use\n                  suffix ms to switch to milliseconds. Suffix \"s\" (seconds)\n                  can be omitted.\n  -m \u003cvalue\u003e    - memory limit. Terminate if anonymous virtual memory of the\n                  process exceeds \u003cvalue\u003e bytes. Use suffixes K, M, G to\n                  specify kilo, mega, gigabytes.\n  -d \u003cvalue\u003e    - current directory for the process.\n  -i \u003cfilename\u003e - redirect standard input to \u003cfilename\u003e.\n  -o \u003cfilename\u003e - redirect standard output to \u003cfilename\u003e.\n  -e \u003cfilename\u003e - redirect standard error to \u003cfilename\u003e.\n```\n\n## Reference\n\nThis part is taken from the Windows version and it's only for my reference.\n\n\n```\nrunexe 2.0 version c5a5c20c3bc925a2bbb96cab39d7c21c871d2960 build 138\n\nThis program runs other program(s) for given period of time with specified\nrestrictions.\n\nCommand line format:\n  runexe [\u003cglobal options\u003e] [\u003cprocess properties\u003e] program [\u003cparameters\u003e]\n\nGlobal options:\n  -help         - show help\n  -xml          - print result in xml format (otherwise, use human-readable)\n  -show-kernel-mode-time - include kernel-mode time in human-readable format\n                  (always included in xml)\n  -x            - return process exit code (not implemented)\n  -logfile=\u003cf\u003e  - for runexe developers only\n  -interactor=\"\u003cprocess properties\u003e interactor \u003cparameters\u003e\"\n                  INTERACTOR MODE\n    Launch another process and cross-connect its stdin\u0026stdout with the main\n    program. Inside this flag, you can specify any process-controlling flags:\n    interactor can have its own limits, credentials, environment, directory.\n    In interactor mode, however, -i and -o have no effects on both main\n    program and interactor.\n  -ri=\u003cf\u003e       - in interactor mode, record program input to file \u003cf\u003e.\n  -ro=\u003cf\u003e       - in interactor mode, record program output to file \u003cf\u003e.\n\nProcess properties:\n  -t \u003cvalue\u003e    - time limit. Terminate after \u003cvalue\u003e seconds, you can use\n                  suffix ms to switch to milliseconds. Suffix \"s\" (seconds)\n                  can be omitted.\n  -m \u003cvalue\u003e    - memory limit. Terminate if anonymous virtual memory of the\n                  process exceeds \u003cvalue\u003e bytes. Use suffixes K, M, G to\n                  specify kilo, mega, gigabytes.\n  -D k=v        - environment. If any is specified, existing environment is\n                  cleared.\n  -d \u003cvalue\u003e    - current directory for the process.\n  -l \u003cvalue\u003e    - login name. Create process under \u003cvalue\u003e user.\n  -p \u003cvalue\u003e    - password for user specified in -l. On linux, ignored (but\n                  must be present).\n  -j \u003cfilename\u003e - inject \u003cfilename\u003e DLL into process.\n  -i \u003cfilename\u003e - redirect standard input to \u003cfilename\u003e.\n  -o \u003cfilename\u003e - redirect standard output to \u003cfilename\u003e.\n  -e \u003cfilename\u003e - redirect standard error to \u003cfilename\u003e.\n  -z            - run process in trusted mode.\n  -no-idleness-check - switch off idleness checking.\n```\n\nAnd here is an example of verbose output and xml output.\n\n```\nProgram successfully terminated\n  exit code:    0\n  time consumed: 0.02 sec\n  time passed:  0.17 sec\n  peak memory:  6963200 bytes\n\nInteractor successfully terminated\n  exit code:    0\n  time consumed: 0.00 sec\n  time passed:  0.70 sec\n  peak memory:  27480064 bytes\n```\n\n```\n\u003c?xml version=\"1.1\" encoding=\"UTF-8\"?\u003e\n\u003cinvocationResults\u003e\n\u003cinvocationResult id=\"program\"\u003e\n\u003cinvocationVerdict\u003eSUCCEEDED\u003c/invocationVerdict\u003e\n\u003cexitCode\u003e0\u003c/exitCode\u003e\n\u003cprocessorUserModeTime\u003e15\u003c/processorUserModeTime\u003e\n\u003cprocessorKernelModeTime\u003e62\u003c/processorKernelModeTime\u003e\n\u003cpassedTime\u003e176\u003c/passedTime\u003e\n\u003cconsumedMemory\u003e6909952\u003c/consumedMemory\u003e\n\u003c/invocationResult\u003e\n\u003cinvocationResult id=\"interactor\"\u003e\n\u003cinvocationVerdict\u003eSUCCEEDED\u003c/invocationVerdict\u003e\n\u003cexitCode\u003e0\u003c/exitCode\u003e\n\u003cprocessorUserModeTime\u003e0\u003c/processorUserModeTime\u003e\n\u003cprocessorKernelModeTime\u003e31\u003c/processorKernelModeTime\u003e\n\u003cpassedTime\u003e695\u003c/passedTime\u003e\n\u003cconsumedMemory\u003e27402240\u003c/consumedMemory\u003e\n\u003c/invocationResult\u003e\n\u003c/invocationResults\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultmaster%2Frunexe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fultmaster%2Frunexe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultmaster%2Frunexe/lists"}