Giter Site home page Giter Site logo

cacathead / catbox Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 250 KB

A light process isolation sandbox used for Competitive Programming contest

Home Page: https://docs.rs/catj/

License: MIT License

Rust 95.22% C++ 1.52% Shell 0.76% C 1.29% Java 0.49% TypeScript 0.72%
codeforces competettive-programming process-isolation sandbox cacathead

catbox's Introduction

CatJ

CI

A light process isolation sandbox used for Competitive Programming contest.

Features

  • cgroups: Record cpu and memory usage (may fall back to getrusage)
  • mount and chroot: Created an isolated file system
  • setrlimit: Set resource limits (cpu, address size, stack size, file size)
  • setuid and setgid: Run submission under another user and group
  • ptrace: Filter submission syscall

Note

To enable all of above features, it is highly recommended to use it under the root user, otherwise it may fall back automatically.

Installation

# Install using cargo
$ cargo install catj

# Or you can download binary with installation script
$ curl -fsSL https://bina.egoist.sh/CaCatHead/CatBox | sh

# Check installation
$ catj --version
catj 0.2.3

# Init cgroup for current user
$ ./init.sh $USER

Usage

# Compile C++ source code
$ catj compile ./fixtures/aplusb/source/ac.cpp -o a.out

# Run a.out
$ catj run --stdin ./fixtures/aplusb/testcases/1.in --read . -- ./a.out
2

# Generate report
$ catj --report run --stdin ./fixtures/aplusb/testcases/1.in --stdout ./sub.out --read . -- ./a.out
# or
$ catj -r run -i ./fixtures/aplusb/testcases/1.in -o ./sub.out -R . -- ./a.out
Status     0
Signal     ✓
Time       1 ms
Time user  1 ms
Time sys   0 ms
Memory     0 KB

License

MIT License © 2023 XLor

catbox's People

Contributors

yjl9903 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.