Skip to content

Instantly share code, notes, and snippets.

@raidzero
raidzero / passgen.c
Created March 3, 2014 20:59
Password generator. Takes password requirements as arguments using getopt()
/*
* USAGE: passgen [-u UPPER] [-l LOWER] [-n NUMBER] -s [SPECIAL] -a LENGTH
* The approach is take the desired length, and set aside positions in the result
* string for the required characters, then fill in the other positions
* with random characters
*/
#include <stdio.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
module.exports = {
DB1: redis.createClient(),
DB2: redis.createClient(),
DB3: redis.createClient(),
init: function(next) {
var select = redis.RedisClient.prototype.select;
require('async').parallel([
select.bind(this.DB1, 1),
select.bind(this.DB2, 2),
select.bind(this.DB3, 3)