Rust port of pexpect

Overview

rexpect

Build Status crates.io Released API docs Master API docs

Spawn, control, and respond to expected patterns of child applications and processes, enabling the automation of interactions and testing. Components include:

  • session: start a new process and interact with it; primary module of rexpect.
  • reader: non-blocking reader, which supports waiting for strings, regex, and EOF.
  • process: spawn a process in a pty.

The goal is to offer a similar set of functionality as pexpect.

Maintainers wanted

I have created rexpect as a project to learn rust and linux. But now due to some reasons I haven't used Rust in the past 2 years, so I can't keep up with the latest features/crate dependencies

It has become hard now to judge pull requests. If you would be willing to either take over this repo entirely or join in as a maintainer to help evaluate PR please contact me.

Examples

For more examples, check the examples directory.

Basic usage

Add this to your Cargo.toml

[dependencies]
rexpect = "0.4"

Simple example for interacting via ftp:

extern crate rexpect;

use rexpect::spawn;
use rexpect::errors::*;

fn do_ftp() -> Result<()> {
    let mut p = spawn("ftp speedtest.tele2.net", Some(30_000))?;
    p.exp_regex("Name \\(.*\\):")?;
    p.send_line("anonymous")?;
    p.exp_string("Password")?;
    p.send_line("test")?;
    p.exp_string("ftp>")?;
    p.send_line("cd upload")?;
    p.exp_string("successfully changed.\r\nftp>")?;
    p.send_line("pwd")?;
    p.exp_regex("[0-9]+ \"/upload\"")?;
    p.send_line("exit")?;
    p.exp_eof()?;
    Ok(())
}


fn main() {
    do_ftp().unwrap_or_else(|e| panic!("ftp job failed with {}", e));
}

Example with bash and reading from programs

extern crate rexpect;
use rexpect::spawn_bash;
use rexpect::errors::*;


fn do_bash() -> Result<()> {
    let mut p = spawn_bash(Some(2000))?;
    
    // case 1: wait until program is done
    p.send_line("hostname")?;
    let hostname = p.read_line()?;
    p.wait_for_prompt()?; // go sure `hostname` is really done
    println!("Current hostname: {}", hostname);

    // case 2: wait until done, only extract a few infos
    p.send_line("wc /etc/passwd")?;
    // `exp_regex` returns both string-before-match and match itself, discard first
    let (_, lines) = p.exp_regex("[0-9]+")?;
    let (_, words) = p.exp_regex("[0-9]+")?;
    let (_, bytes) = p.exp_regex("[0-9]+")?;
    p.wait_for_prompt()?; // go sure `wc` is really done
    println!("/etc/passwd has {} lines, {} words, {} chars", lines, words, bytes);

    // case 3: read while program is still executing
    p.execute("ping 8.8.8.8", "bytes of data")?; // returns when it sees "bytes of data" in output
    for _ in 0..5 {
        // times out if one ping takes longer than 2s
        let (_, duration) = p.exp_regex("[0-9. ]+ ms")?;
        println!("Roundtrip time: {}", duration);
    }
    p.send_control('c')?;
    Ok(())
}

fn main() {
    do_bash().unwrap_or_else(|e| panic!("bash job failed with {}", e));
}

Example with bash and job control

One frequent bitfall with sending ctrl-c and friends is that you need to somehow ensure that the program has fully loaded, otherwise the ctrl-* goes into nirvana. There are two functions to ensure that:

  • execute where you need to provide a match string which is present on stdout/stderr when the program is ready
  • wait_for_prompt which waits until the prompt is shown again
extern crate rexpect;
use rexpect::spawn_bash;
use rexpect::errors::*;


fn do_bash_jobcontrol() -> Result<()> {
    let mut p = spawn_bash(Some(1000))?;
    p.execute("ping 8.8.8.8", "bytes of data")?;
    p.send_control('z')?;
    p.wait_for_prompt()?;
    // bash writes 'ping 8.8.8.8' to stdout again to state which job was put into background
    p.execute("bg", "ping 8.8.8.8")?;
    p.wait_for_prompt()?;
    p.send_line("sleep 0.5")?;
    p.wait_for_prompt()?;
    // bash writes 'ping 8.8.8.8' to stdout again to state which job was put into foreground
    p.execute("fg", "ping 8.8.8.8")?;
    p.send_control('c')?;
    p.exp_string("packet loss")?;
    Ok(())
}

fn main() {
    do_bash_jobcontrol().unwrap_or_else(|e| panic!("bash with job control failed with {}", e));
}

Project Status

Rexpect covers more or less the features of pexpect. If you miss anything I'm happy to receive PRs or also Issue requests of course.

The tests cover most of the aspects and it should run out of the box for rust stable, beta and nightly on both Linux or Mac.

Design decisions

  • use error handling of error-chain
  • use nix (and avoid libc wherever possible) to keep the code safe and clean
  • sadly, expect is used in rust too prominently to unwrap Options and Results, use exp_* instead

Licensed under MIT License

Comments
  • Bump nix from 0.14.1 to 0.25.0

    Bump nix from 0.14.1 to 0.25.0

    Bumps nix from 0.14.1 to 0.25.0.

    Changelog

    Sourced from nix's changelog.

    [0.25.0] - 2022-08-13

    Added

    • Added faccessat (#1780)
    • Added memfd on Android. (#1773)
    • Added ETH_P_ALL to SockProtocol enum (#1768)
    • Added four non-standard Linux SysconfVar variants (#1761)
    • Added const constructors for TimeSpec and TimeVal (#1760)
    • Added chflags. (#1758)
    • Added aio_writev and aio_readv. (#1713)
    • impl From<uid_t> for Uid and From<gid_t> for Gid (#1727)
    • impl From<SockaddrIn> for std::net::SocketAddrV4 and impl From<SockaddrIn6> for std::net::SocketAddrV6. (#1711)
    • Added support for the x86_64-unknown-haiku target. (#1703)
    • Added ptrace::read_user and ptrace::write_user for Linux. (#1697)
    • Added getrusage and helper types UsageWho and Usage (#1747)
    • Added the DontRoute SockOpt (#1752)
    • Added signal::SigSet::from_sigset_t_unchecked(). (#1741)
    • Added the Ipv4OrigDstAddr sockopt and control message. (#1772)
    • Added the Ipv6OrigDstAddr sockopt and control message. (#1772)
    • Added the Ipv4SendSrcAddr control message. (#1776)

    Changed

    • Rewrote the aio module. The new module:
      • Does more type checking at compile time rather than runtime.
      • Gives the caller control over whether and when to Box an aio operation.
      • Changes the type of the priority arguments to i32.
      • Changes the return type of aio_return to usize. (#1713)
    • nix::poll::ppoll: sigmask parameter is now optional. (#1739)
    • Changed gethostname to return an owned OsString.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies rust 
    opened by dependabot[bot] 36
  • Rare inconsistent result.

    Rare inconsistent result.

    While testing gluon with rexpect, there has been one inconsistent test, specicially the hello_world test. It may be a problem of how I used the api or a rare bug with the repl. Rexpect has worked consistently with every other test that's been thrown at it.

    There are a few different variations tried in here, including the original without expecting anything after the first sent import line, expecting a regex, and using execute -- https://github.com/gluon-lang/gluon/pull/478.

    It would be great to get your eyes on this if you spot anything I'm missing while using rexpect :)

    opened by memoryruins 14
  • Need help on converting a bash script into rexpect

    Need help on converting a bash script into rexpect

    Hi @philippkeller

    • And this is the command and logs from realm join command
    #realm join -v --computer-ou="ou=servers,dc=test,dc=com" test.com -U admin_ad
     * Resolving: _ldap._tcp.test.com
     * Performing LDAP DSE lookup on: 100.76.1.18
     * Performing LDAP DSE lookup on: 100.76.1.19
     * Performing LDAP DSE lookup on: 100.64.0.65
     * Successfully discovered: test.com
    Password for admin_ad: admin_ad_password
    
    • This is one-liner bash script I used to join a centos 7 to MS AD domain.
    realm join -v --computer-ou="ou=ma,ou=servers,dc=test,dc=com" test.com -U admin_ad << MYPASSWD
    admin_ad_password
    MYPASSWD
    
    • And this is using rexpect 0.3
    //Run this code with cargo
    // Join test.com AD domain on CentOS 7 with SSSD enabled.
    //  Following is the response from realm command
    //!  realm join -v --computer-ou="ou=unit1,ou=servers,dc=test,dc=com" test.com -U admin_ad
    //!  * Resolving: _ldap._tcp.test.com
    //!  * Performing LDAP DSE lookup on: 100.76.1.18
    //!  * Performing LDAP DSE lookup on: 100.76.1.19
    //!  * Performing LDAP DSE lookup on: 100.58.0.65
    //!  * Successfully discovered: test.com
    //! Password for admin_ad:
    
    extern crate rexpect;
    
    use rexpect::spawn;
    use rexpect::errors::*;
    
    fn  join() -> Result<()> {
        let mut p = spawn("realm join -v --computer-ou=\"ou=ma,ou=servers,dc=test,dc=com\" test.com -U admin_ad", Some(30_000))?;
        p.exp_regex("^Password for .*: ")?;
        p.send_line("admin_ad_password")?;
        p.exp_eof()?;
        Ok(())
    }
    
    
    fn main() {
        join().unwrap_or_else(|e| panic!("Failed to joing test.com AD domain {}", e));
    }
    
    • The error Is there a way to skip first 5 lines from realm command output ?
    >target/debug/joinad
    thread 'main ' panicked at 'Failed to joing test.com AD domain EOF (End of File): Expected Regex: "^Password for .*: " but got EOF after reading " * Resolving: _ldap._tcp.test.com
    
    • I inserted "p.wait_for_prompt()?;" before " p.exp_regex" but I got compilation error saying no wait_for_promp method for ptysession ...
    opened by tjyang 13
  • Help with maintainance?

    Help with maintainance?

    @philippkeller It seems like this project is not being actively maintained anymore. Would you like help with maintenance or would you prefer that this was forked an maintained by someone else?

    opened by petreeftime 12
  • draft of a possible solution to the #14 issue and changes in public interface

    draft of a possible solution to the #14 issue and changes in public interface

    Hi @philippkeller, In the #22 I put an example in what way may be changed the interface of ReadUntil. And today I went through the use cases of exp function and noticed that in all cases there's no need for all the data find function gives so I went slightly further and check what can be done.

    The main idea behind this PR is to provide a cleaner calls of read_until function. The example when we match string and return the buffer before and the string itself but we know the string already since we did a match by that so the second part is always needless.

    A bunch of examples

    let mut p = spawn("cat", Some(1000)).expect("cannot run cat");
    p.send_line("lorem ipsum dolor sit amet")?;
    assert_eq!("lorem ipsum dolor sit ", p.exp_string("amet")?);
    
    let f = io::Cursor::new("2014-03-15");
    let mut r = NBReader::new(f, None);
    let re = Regex::new(r"-\d{2}-").unwrap();
    assert_eq!(
        ("2014".to_string(), "-03-".to_string()),
        r.read_until(&re).expect("regex doesn't match")
    );
    
    let f = io::Cursor::new("abcdef");
    let mut r = NBReader::new(f, None);
    assert_eq!(
        "ab".to_string(),
         r.read_until(&NBytes(2)).expect("2 bytes")
    );
    

    The resolution of #14 could looks like

    we have an index of the ReadUntil element by which we get successful match, and the copy of the buffer on which it be called so if the user want he can repeat the match on the buffer.

    let until = vec![ReadUntil::NBytes(30), ReadUntil::String("Hi".to_string())];
    if let Ok(buffer, index)= = p.exp(until.as_slice()) {
       let res = &until[index]
          .clone()
          .string_needle()
          .unwrap()
          .find(&buffer, true)
          .unwrap();
    }
    

    This is a draft and it's affected by a linter which I am sorry about.

    All tests are passed.

    opened by zhiburt 12
  • Moving repository to CLI-WG org?

    Moving repository to CLI-WG org?

    Hi!

    In the last meetup of the CLI WG it came up that we want to make this crate to the CLI WG org.

    The benefits that we would get from that would be the increased bus factor. I know we have three or four people that currently maintain this crate, and we wouldn't even increase that number any further when moving to the CLI WG org, but we would get the option of the WG having access to the repository settings and if it happens that we (the current maintainers) are all unresponsive, the WG can install new maintainers.

    Please lets have a discussion about that.

    @petreeftime suggested that after the maintainership thing got cleared up, we can talk about moving to a more permanent place (https://github.com/philippkeller/rexpect/issues/43#issuecomment-1242927575) ... and that's what I'm trying here now! :laughing: @souze is also a maintainer IIRC and of course @philippkeller has the final say as the owner of the repository!

    opened by matthiasbeyer 11
  • RFC: Create another dir to host Cargo.toml file and directory layout to test/learn examples

    RFC: Create another dir to host Cargo.toml file and directory layout to test/learn examples

    Hi @matthiasbeyer

    As a rexpect beginner, I had to create my own dir structure and file to really run/test/learn rexpect crate.

    • Can this be part of rexpect src tree ?
    [me@ipa01 rexpect]$ pwd
    /home/me/github/rexpect
    [me@ipa01 rexpect]$ tree contrib -L 4
    contrib
    └── examples
        ├── Cargo.toml
        └── src
            └── bin
                ├── bash_read.rs
                ├── bash.rs
                ├── exit_code.rs
                ├── ftp.rs
                ├── repl.rs
                └── tcp.rs
    
    3 directories, 7 files
    [me@ipa01 rexpect]$
    
    
    opened by tjyang 10
  • Add bors

    Add bors

    This adds bors.


    What you'd need to do: Go to https://bors.tech, add this repository (if you haven't done yet) and ensure the settings from this comment.

    opened by matthiasbeyer 10
  • Configure Renovate

    Configure Renovate

    Mend 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

    • Cargo.toml (cargo)
    • .github/workflows/ci.yml (github-actions)
    • .github/workflows/commit-lint.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 Renovate detects semantic commits, it will 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 10 open PRs at any time.
    • Group known monorepo packages together.
    • Use curated list of recommended non-monorepo package groupings.
    • A collection of workarounds for known problems with packages.

    🔡 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

    With your current configuration, Renovate will create 2 Pull Requests:

    Update Rust crate thiserror to 1.0.37
    • Schedule: ["at any time"]
    • Branch name: renovate/thiserror-1.x
    • Merge into: master
    • Upgrade thiserror to 1.0.37
    Update swatinem/rust-cache action to v2
    • Schedule: ["at any time"]
    • Branch name: renovate/swatinem-rust-cache-2.x
    • Merge into: master
    • Upgrade swatinem/rust-cache to v2

    ❓ 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 Mend Renovate. View repository job log here.

    opened by renovate[bot] 8
  • bash_read.rs: use rexpect::error::Error;  --> could not find `error` in `rexpect`

    bash_read.rs: use rexpect::error::Error; --> could not find `error` in `rexpect`

    I am learning rexpect via *.rs in examples dir.

    • With following Cargo.toml and needed directory layout, I was able to run command like "cargo run --bin bash_read" to see if it works.

    [me@ipa01 examples]$ cat Cargo.toml [package] name = "rexpect-examples" version = "0.1.0" authors = ["rexpect authors"] description = "Cargo.toml to compile rexpect examples in batch" license = "MIT" homepage = "https://github.com/rust-cli/rexpect" readme = "README.md" categories = ["command-line-utilities" ] keywords = ["rexpect", "rust", "bash"]

    [dependencies] rexpect = "0.4.0" [me@ipa01 examples]$

    [me@ipa01 examples]$ tree -L 23 . ├── Cargo.lock ├── Cargo.toml └── src └── bin └── bash_read.rs

    2 directories, 3 files [me@ipa01 examples]$

    • Output of "cargo run --bin bash_read" command

    [me@ipa01 examples]$ cargo run --bin bash_read Compiling memchr v2.5.0 Compiling libc v0.2.135 Compiling cc v1.0.73 Compiling gimli v0.26.2 Compiling version_check v0.9.4 Compiling adler v1.0.2 Compiling cfg-if v1.0.0 Compiling nix v0.14.1 Compiling rustc-demangle v0.1.21 Compiling fastrand v1.8.0 Compiling remove_dir_all v0.5.3 Compiling regex-syntax v0.6.27 Compiling void v1.0.2 Compiling cfg-if v0.1.10 Compiling bitflags v1.3.2 Compiling miniz_oxide v0.5.4 Compiling error-chain v0.12.4 Compiling backtrace v0.3.66 Compiling object v0.29.0 Compiling aho-corasick v0.7.19 Compiling addr2line v0.17.0 Compiling tempfile v3.3.0 Compiling regex v1.6.0 Compiling rexpect v0.4.0 Compiling rexpect-examples v0.1.0 (/home/me/github/rexpect/contrib/examples) error[E0432]: unresolved import rexpect::error --> src/bin/bash_read.rs:2:14 | 2 | use rexpect::error::Error; | ^^^^^ could not find error in rexpect

    For more information about this error, try rustc --explain E0432. error: could not compile rexpect-examples due to previous error [me@ipa01 examples]$

    • src/bin/bash_read.rs is unchanged examples/bash_read.rs.
    opened by tjyang 7
  • Let bors cut body after <details>

    Let bors cut body after

    This was set to "---" because I thought it would make life easier for contributors to use the markdown line "---".

    It turned out, though, that dependabot uses a <details> tag and puts a lot of HTML in there. We really don't want that in our merge messages.

    So this patch changes bors configuration to cut the merge message after the <details> tag.

    opened by matthiasbeyer 6
Releases(v0.5.0)
  • v0.5.0(Oct 20, 2022)

    Changes

    • Replace error-chain with thiserror
    • Make any_exp return results deterministically
    • Fix argument tokenization
    • Update to nix 0.25

    Fixes

    • Fix https link to pexpect docs
    • Many clippy fixes
    • Remove unnecesary closures
    • Fix EOF detection on nightly
    • Fix examples

    PR List

    • minor spelling fixes by @BeldrothTheGold in https://github.com/rust-cli/rexpect/pull/31
    • Add dependabot configuration by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/45
    • Remove lockfile by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/46
    • cargo-fmt in CI and format code by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/52
    • Add commit linting by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/56
    • Update Badges by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/55
    • Add cut_body_after setting by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/54
    • Add cargo-deny by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/53
    • Add https to the pexpect link by @badhrink in https://github.com/rust-cli/rexpect/pull/41
    • Add clippy by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/57
    • Replace error-chain with thiserror by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/59
    • Cleanup examples by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/60
    • Format README by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/61
    • Remove unnecessary boilerplate from doc examples by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/62
    • Make exp_any return the earliest result by @souze in https://github.com/rust-cli/rexpect/pull/64
    • Ignore dependabot by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/65
    • Fix argument tokenization by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/66
    • Add cargo-test job by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/67
    • Remove maintenance notice by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/51
    • Remove unnecessary immediately invoked closures by @souze in https://github.com/rust-cli/rexpect/pull/73
    • Fix sporadic test failure by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/75
    • Let bors cut body after
      by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/74
    • Update nix 0.25 by @matthiasbeyer in https://github.com/rust-cli/rexpect/pull/76
    • Update to v0.5.0 by @petreeftime in https://github.com/rust-cli/rexpect/pull/78

    New Contributors

    • @BeldrothTheGold made their first contribution in https://github.com/rust-cli/rexpect/pull/31
    • @matthiasbeyer made their first contribution in https://github.com/rust-cli/rexpect/pull/45
    • @badhrink made their first contribution in https://github.com/rust-cli/rexpect/pull/41
    • @souze made their first contribution in https://github.com/rust-cli/rexpect/pull/64
    • @petreeftime made their first contribution in https://github.com/rust-cli/rexpect/pull/78
    Source code(tar.gz)
    Source code(zip)
Owner
Philipp Keller
Python, Javascript, and now trying Rust
Philipp Keller
Dog command for *nix systems, Rust port of dog.

dog-rs Dog command for *nix systems, Rust port of dog. Because there is a cat command, should be a dog command too. It was written completely using VS

Juanjo Salvador 2 Sep 29, 2021
Rust port of InfectedRose.Interface

Rust port of Wincent's InfectedRose.Interface. It is not finished; only adding to the database is possible at the moment, editing and removing is not,

zaop 3 Feb 2, 2022
This is a command line port of the game Wordle in Rust

Wordle.rs Welcome to Wordle.rs! This is a command line port of the game Wordle in Rust. I built this in order to get more familiar with programming in

Brock Herion 5 Apr 8, 2022
A Rust port of the command line program playing with the cutscenes files (USM) from Genshin Impact.

GI-cutscenes : Rust Remix A command line program playing with the cutscene files (USM) from Genshin Impact, reimplemented in Rust. Much like its origi

Lymkwi 5 Nov 6, 2022
Rust port of https://github.com/hunar4321/life_code with some fun features.

Smarticles A Rust port of Brainxyz's Artificial Life simulator with some fun features. A simple program to simulate primitive Artificial Life using si

Chevy Ray Johnston 15 Dec 24, 2022
png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance.

png_defringe_rs png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance. U

null 2 Nov 17, 2022
`ggllama` is a Rust port of ggerganov's llama.cpp.

Notice llama-rs beat me to the punch. I'll be contributing to that instead. The original README is preserved below. ggllama ggllama is a Rust port of

Philpax 6 Mar 15, 2023
A port of everything to Rust 🦀

everything.rs Do you ever feel like washing your hands after a coding session, disgusted at having to use essential Unix utilities with not the tinies

null 8 Apr 17, 2023
🧮 Boolean expression evaluation engine. A Rust port of boolrule.

coolrule My blog post: Porting Boolrule to Rust Boolean expression evaluation engine (a port of boolrule to Rust). // Without context let expr = coolr

Andrew Healey 3 Aug 21, 2023
Truly universal encoding detector in pure Rust - port of Python version

Charset Normalizer A library that helps you read text from an unknown charset encoding. Motivated by original Python version of charset-normalizer, I'

Nikolay Yarovoy 29 Oct 9, 2023
port sniffer, multithreading

SniffSniff I am trying to learn Rust programming language. Here is a small project that sniffs the ports of a given host. I want to give some info wha

Furkan Demir 5 Mar 5, 2023
A command-line tool to easily kill processes running on a specified port.

killport killport is a command-line utility for killing processes listening on specific ports. It's designed to be simple, fast, and effective. The to

Francisco Jiménez Cabrera 6 Mar 29, 2023
A simple demo to bind a TCP port with k8s exec channel.k8s.io websocket API.

k8s-webterm-connector Tired with web terminals? Let's use it with CLI! This is just a simple demo to bind a TCP port with k8s exec websocket API, whic

Chielo 4 Aug 11, 2023
A port of sug0/go-glitch

Glitch This is a simple port of https://github.com/sug0/go-glitch to rust. What is the deal with the expressions? You can think of the image as a func

Helba 9 Apr 27, 2024
Rust-advent - Learning Rust by solving advent of code challenges (Streaming live on Twitch every Monday)

Rust advent ?? ?? Learning Rust by implementing solutions for Advent of Code problems. ?? HEY, we are live-streaming our attempts to solve the exercis

Luciano Mammino 20 Nov 11, 2022
Rust-clippy - A bunch of lints to catch common mistakes and improve your Rust code

Clippy A collection of lints to catch common mistakes and improve your Rust code. There are over 450 lints included in this crate! Lints are divided i

The Rust Programming Language 8.7k Dec 31, 2022
Rust-battery - Rust crate providing cross-platform information about the notebook batteries.

battery Rust crate providing cross-platform information about the notebook batteries. Table of contents Overview Supported platforms Install Examples

svartalf 326 Dec 21, 2022
A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

Sebastián Romero Cruz 1 Apr 10, 2022
Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

Cryptex 13 Dec 6, 2022