npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rabbit-pipe

v0.2.5

Published

Collection of programs and scripts to interact with RabbitMQ through pipes.

Downloads

25

Readme

Travis CI

Overview

Allows interaction between a unix pipe and a rabbit queue. Useful for parallization across hosts.

Installation

npm install -g rabbit-pipe

Usage

  Usage: rabbit-pipe [options]

  Options:

    -V, --version                     output the version number
    -q, --queue <queue>               Queue name to use
    -P, --producer                    Signal that we're producing
    -C, --consumer                    Signal that we should consume
    -l, --queue-length [queuelength]  Maximum number of items in the queue
    -f, --queue-freq [queuefreq]      How often to check the queue length (ms)
    -H, --host [host]                 Rabbit host to use (default: localhost)
    -u, --user [user]                 User to use for connecting to RabbitMQ
    -p, --pass [pass]                 Pass to use for connecting to RabbitMQ
    -n, --num [num]                   Number of messages to grab concurrently ( prefetch in rabbit parlance )
    -h, --help                        output usage information

Examples

Producer

Example: Put each IPv4 address in a queue; Limits queue length to 1000, and checks the queue length every 100ms.

$ masscan 0.0.0.0/0 -sL | rabbit-pipe -P -q ips -l 1000 -f 100

Example: Put each filename into a rabbit queue named files. Try and keep a limit of 1000 messages in the queue at one time, and check the queue length every 100ms.

$ find / -type f | rabbit-pipe -P -q files -l 1000 -f 100

Example: Generate the sha512 hashes of each file on disk and send them to a queue named hashes. Limit to 10000 messages in the queue at once, and check the queue length every second.

$ find / -type f 2>/dev/null | xargs -I{} shasum -a 512 {} 2>/dev/null | awk '{print $1}' | rabbit-pipe -P -q hashes -l 10000 -f 1000

Example: Watch a file ( syslog ) and send each line to a queue named syslog. Limit to 1000 messages in the queue, confirm the length of the queue once each second, and login to the RabbitMQ host with the credentials someuser and somepass.

$ tail -f /var/log/syslog | rabbit-pipe -P -q syslog -l 1000 -f 1000 -u someuser -p somepass

Consumer

Example: Read from a queue of ips and see if you can ping that address.

$ rabbit-pipe -C -q ips | xargs -I{} ping -c 1 {}

Example: Read filenames or urls from a queue, execute mplayer <file|url>.

$ rabbit-pipe -C -q music | xargs -I{} mplayer {}

Example: Read log lines from a log queue, append them to a file.

$ rabbit-pipe -C -q logs >> ./log-from-rabbit.log

Example: Read bad words from a queue and see if they exist in git commit history. Grab 100 words at a time.

$ rabbit-pipe -C -q badwords -n 100 | xargs -I{} git log --grep {}