Coder Social home page Coder Social logo

iq-scm / nhi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from strang1ato/nhi

0.0 0.0 0.0 4.01 MB

:tv: Automatically capture all potentially useful information about each executed command (as well as its output) and get powerful querying mechanism

License: GNU General Public License v3.0

Shell 6.75% C 43.91% Go 46.91% Makefile 2.43%

nhi's Introduction

workflow Gitter chat Tweet

nhi is a revolutionary tool which automatically captures all potentially useful information about each executed command and everything around, and delivers powerful querying mechanism.

nhi keeps records of:

  • command
  • output of command
  • exit status of command
  • working directory at the end of command execution
  • start time of command
  • finish time of command
  • shell prompt at the time of command execution
  • (and much more in the future ๐Ÿ˜„)

nhi also keeps records of information about shell session in general.

These features allow retrievement of commands executed in past and whole shell sessions, as well as all other useful information in a convenient way.

nhi daemon is based on eBPF - a technology built into linux kernel. Usage of eBPF guarantee a great performance and low overhead of the tool, because tracing is being safely done inside kernel.

nhi does not affect behaviour of any program/process (and OS in general).

Watch the introductory video to see how nhi works in practice.

Usage

For the full documentation, read the nhi(1) man page.

For quick reference, use nhi --help flags.

Requirements

bash or zsh, x86_64 architecture, systemd and linux kernel 5.8+. Some major distributions that ship with the linux kernel 5.8+:

  • Debian 11
  • Ubuntu 20.10+
  • Fedora 33+

xterm based terminals are highly recommended. (If you don't know whether your terminal emulator is xterm based or not, it most likely is xterm based. xterm is a standard for terminal emulators.)

Installation

Ubuntu 21.10+

Step 1: Ubuntu has oddly compiled bash and zsh binaries which are missing some data required by nhi. To install shells that are compiled "normally", like on every other distro run:

sudo apt-get remove zsh-common
sudo add-apt-repository ppa:strang1ato/default-bash-and-zsh
sudo apt-get update
sudo apt-get install --reinstall bash

and if you were using zsh:

sudo apt-get install zsh

From now bash and zsh will be upgraded/installed only from the newly added repository.

Step 2: Run:

sudo add-apt-repository ppa:strang1ato/nhi
sudo apt-get update
sudo apt-get install nhi

Step 3: Add to the end of your .bashrc:

source /etc/nhi/nhi.bash

And if you use zsh add to the end of your .zshrc:

source /etc/nhi/nhi.zsh

Step 4: Restart your computer.

Other distributions

Step 1: Install objdump, awk, sqlite3, libsqlite3-dev and libbpf-dev (example for linux debian systems):

sudo apt-get install binutils gawk sqlite3 libsqlite3-dev libbpf-dev

Step 2: Download all seven files from the latest release, and put them in a new empty directory.

Step 3: Go to the new directory and run:

sudo -E bash ./install

Step 4: Restart your computer.

Testing

In order to check if you installed nhi succesfully open new terminal window and execute for example:

echo nhi test

and

nhi fetch {-1}

If you see "nhi test" once again, it means that nhi is properly installed.

Contributions

Contributions are welcome! Any tips and suggestions are appreciated. If you found any bug feel free to submit a new issue.

nhi's People

Contributors

strang1ato 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.