Skip to content
MrM0biPublic

About

A command-line tool to extract and filter CDRs from Cirpack grnti log files.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cgrep

A command-line tool to extract and filter CDRs from Cirpack grnti log files.


Dependencies

For the "grep"-Part in cgrep to work, ripgrep (rg) is required. Please make sure it is installed on the system and in PATH.
Install instructions: https://github.com/BurntSushi/ripgrep/

If no Package for your distribution is available, you can try to use the binary in the ripgrep-AA.B.C-x86_64-unknown-linux-musl.tar.gz version on the git Releases Page

Build

Using system default (probably glibc)
cargo build --release

If the system on which you compile has a newer version of glibc than the one you plan to run cgrep on you can try two things:

  1. Use musl instead of the defualt glibc.
  2. Spin up a Docker container with an envoirement using an older glibc version.

To check your glibc-version: ldd --version

Using musl
  1. Install the MUSL component with rustup:
rustup component add rust-std-x86_64-unknown-linux-musl
  1. Build using it:
cargo build --release --target x86_64-unknown-linux-musl

Using glibc 2.17
  1. Spin up a Docker container. Example Dockerfile:
# Start with a CentOS 7 base image  
FROM centos:7  
  
# Switch to CentOS Vault repositories  
RUN sed -i 's|mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/CentOS-* && \  
   sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*  
  
# Install necessary development tools and Rustup  
RUN yum update -y && \  
   yum groupinstall -y "Development Tools" && \  
   yum install -y wget curl gcc gcc-c++ git make && \  
   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y  
  
# Set Rust environment variables  
ENV PATH="/root/.cargo/bin:$PATH"  
  
# Default command to start a shell  
CMD ["/bin/bash"]
  1. Build Docker image
docker build -t rust-glibc-2.17 .
  1. Run Docker image, Mount your Repo and connect to it interactivly
docker run -it --rm -v "$HOME/Path/to/Repo:/root/RustRepo" rust-glibc-2.17
  1. Build using installed glibc version
cargo build --release

Deploy

To deploy the program, simply upload the binary to a directory listed in PATH.

Note: For the colors to display as expected you need to be using a Terminal that has TrueColor-Support.
You can check if your terminal supports true color by checking the value of the environment variable $COLORTERM on your terminal. A value of truecolor or 24bit indicates that it should work.

About

A command-line tool to extract and filter CDRs from Cirpack grnti log files.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages