A simple redirect service
Node.js, MongoDB
-
Get dependencies
In ./node:
npm install
-
Make a copy of ./node/server.config and edit it
port = port on which the server will be listening
name = hostname; localhost will NOT work
db = MongoDB connection string
-
Add a set of login credentials
In ./node:
nodejs -e "require('mongoose').connect('database'); require('./auth.js').create('username', 'password');"
-
Run the server
nodejs server.js <your.config>
You may require root priviledges if you're listening on a port < 1024 (e.g. 80)
-
Log on
http://admin\.\<name.of.server>[:<port>]/
-
Create/edit/delete redirects
Each redirect has a hex code
-
Try them out
http://<name.of.server>[:<port>]/<code>
If no code is specified, a random one will be used
-
Have fun!
A lightweight daemon that forwards data from MongoDB to RabbitMQ
boost, MongoDB C++ Driver (26compat), RabbitMQ C AMQP client library
-
Get dependencies, compile dependencies
-
Compile main.cpp
Remember to set the lib and include paths to include the dependencies if you haven't installed them for system-wide availability
-
Make a copy of ./wabbit/wabbit.config and edit it
seconds = how often to check and forward data, if any
database = MongoDB host
query = MongoDB collection (e.g. <database>.<collection>)
hostname, port = RabbitMQ server
vhost = RabbitMQ vhost name
username, password = optional, RabbitMQ login credentials
queue = RabbitMQ queue name
skip = optional, fields to skip when forwading data, whitespace-separated
-
Start wabbit
./wabbit <your.config>
You can run as many instances as you want; it would be a good idea to have different config files for them
You can check for errors in the system log:
grep wabbit /var/log/syslog
Configuration errors are non-recoverable; other errors will NOT prevent it from running and attempting to forward data with the set frequency
-
Control wabbit
killall -SIGHUP wabbit
HUP will cause wabbit to reload the configuration file; same as above, a config error will cause it to stop
killall -SIGTERM wabbit
TERM will cause wabbit to stop gracefully as soon as possible