ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - bbense/elixgrep: An elixir framework to implement concurrent versions of common unix utilities, grep, find, etc..
An elixir framework to implement concurrent versions of common unix utilities, grep, find, etc.. - bbense/elixgrep
Visit Site

GitHub - bbense/elixgrep: An elixir framework to implement concurrent versions of common unix utilities, grep, find, etc..

GitHub - bbense/elixgrep: An elixir framework to implement concurrent versions of common unix utilities, grep, find, etc..

Elixgrep

alt text

A project to learn elixir by building a grep that will cause the fan on my laptop to turn on when it runs. It has since expanded to a general purpose program for running a function on many files and returning the results.

Currently supports a simple string search in a list of files and directories. It will expand to search all regular files in the subtree of any directory you give it. It also has the ablity to load elixir code plugins to implement a general map/reduce (in the Hadoop sense).

Usage

   Usage:
        exilgrep [string] [files and/or directories]
 
      Options:
        -h, [--help]                # Show this help message and quit.
        -c, [--count] filecount     # Number of files to search in parallel.
                                    # Default is 512.
        -p, [--plugin] elixir_code  # Basename of a plugin to implement 
                                    # other functions. 
 
      Description:
        Prints all the lines in file containing string ( default) 

        Runs a version of map/reduce on the file list given on the command
        line. Requires an elixir module that implements two functions. 

        gr_map(options,path) -> {path,[]}
        gr_reduce(options) Expects to recieve two kinds of messages 
                    { item: { path, []}}
                    { finalize: } -> Should output results and exit.

Build

Run mix escript.build to create the elixgrep executable.

WARNING

This program can easily drive the load on your machine to the number of availiable cores if you point it at a large enough set of files. If you do decide to use it on a production server, use the count option to limit it's use of resources.

Plugins

There are currently two plugins available:

grep

 elixgrep -p grep [PCRE regexp] [files/directories]

This plugin will list out all the files and lines that match the regex, it only examines files one line per time so it won't match multiline regex.

find

This plugin will search for files based on either their basename or File.stat output.

elixgrep -p find [regex] [files/directories]

Without any attribute arguements, the plugin uses the given regex to match against the basename of the files.

 elixgrep -p find --mtime target_file [verb] [files/directories]

You can use the keywords of the File.Stat structure as command line arguments and it will search on that attribute. Currently it only supports the time values --atime, --ctime, --mtime

The verbs you can use with the time stat options are:

  • newer Find files newer than the target file.

  • older Find files older than the target file.

  • around Find files that are within --delta seconds of the target file. The default delta is 24 hours.

To Do

Add other attributes/verbs to find plugin, Figure out how to use a date string instead of target file in attributes. Add 1h30m type parsing to --delta option.ß

Expand plugins to implement a tripwire, access monitoring, etc..

Work on creating a plugin path discovery mechanism.

Figure out how plugins can implement plugin specific help.

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory