Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Redis Bash | 144 | 9 months ago | bsd-3-clause | Shell | ||||||
REDIS-BASH - Bash library to access Redis | ||||||||||
Pennant Engine | 3 | a month ago | JavaScript | |||||||
This repository contains the remote code execution engine for the pennant-notebook project. | ||||||||||
Whiskeyha | 2 | 12 years ago | Shell | |||||||
$ redis-bash-cli <PARAMETERS> <COMMAND> <ARGUMENTS>
Parameters:
-h Host - Defaults localhost.
-p Port - Defaults 6379.
-n DB - Select the database DB.
-r N - Repeat command N times.
-a PASSWORD - Authentication password
-i INTERVAL - Interval between commands
Examples:
$ redis-bash-cli -h localhost SET testkey 1234
OK
$ redis-bash-cli -h localhost GET testkey
1234
$ redis-bash-cli -h localhost PING
PONG
$ redis-bash-cli -h localhost -r 5 PING
PONG
PONG
PONG
PONG
PONG
$ redis-bash-cli -h localhost WRONGCOMMAND test
ERR unknown command 'WRONGCOMMAND'
Authenticated requests:
$ redis-bash-cli -h localhost PING
ERR operation not permitted
$ redis-bash-cli -h localhost -a test PING
PONG
$ redis-pubsub-test <PARAMETERS> <CHANNEL>
Parameters:
-h Host - Defaults localhost.
-p Port - Defaults 6379.
CHANNEL - Channel to subscribe
In one shell run the command:
$ redis-pubsub-test test
In another shell run the command:
$ redis-bash-cli -h localhost -p 6379 PUBLISH test "Hello World."
The library have a single function to handle the redis communication.
$ redis-client <FD> <COMMAND>
Using the library:
#!/bin/bash
source redis-bash-lib # include the library
exec 6<>/dev/tcp/localhost/6379 # open the connection
redis-client 6 SET test 1234 # do a SET operation
exec 6>&- # close the connection
This test has no intent to be a complete benchmark, but only to show the diference between both clients.
$ time redis-bash-cli -h 192.168.86.1 -r 10 PING > /dev/null
real0m0.027s
user0m0.000s
sys0m0.024s
$ time redis-cli -h 192.168.86.1 -r 10 PING > /dev/null
real0m0.012s
user0m0.000s
sys0m0.008s