I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| var crypto = require('crypto') | |
| , key = 'salt_from_the_user_document' | |
| , plaintext = 'password' | |
| , cipher = crypto.createCipher('aes-256-cbc', key) | |
| , decipher = crypto.createDecipher('aes-256-cbc', key); | |
| cipher.update(plaintext, 'utf8', 'base64'); | |
| var encryptedPassword = cipher.final('base64') | |
| decipher.update(encryptedPassword, 'base64', 'utf8'); |
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
| /* node UPNP port forwarding PoC | |
| This is a simple way to forward ports on NAT routers with UPNP. | |
| This is a not-for-production hack that I found useful when testing apps | |
| on my home network behind ny NAT router. | |
| -satori | |
| usage: |
| #!/bin/sh | |
| ## | |
| ## Redhat / Linux / LSB | |
| ## | |
| # chkconfig: 345 85 15 | |
| # description: Startup script for Express / Node.js application with the \ | |
| ## forever module. | |
| ## | |
| ## A modification of https://gist.github.com/1339289 | |
| ## |
| var mongoose = require("mongoose") | |
| , assert = require("assert") | |
| , async = require("async") | |
| , Person | |
| async.series([ | |
| function(callback){ | |
| mongoose.connect("mongodb://localhost/mydb") | |
| mongoose.connection.on("open", callback) | |
| }, |
| /* | |
| * encoder.cpp | |
| * | |
| * Created on: Jul 12, 2012 | |
| * Author : Abhishek Hingnikar | |
| * @TODO: remove the file deps. | |
| * ADD STREAM DEPS so that u can buffer output. | |
| * Structure | |
| * @JSAPI | |
| * ffmpeg{ |
| function alertTerminal(){ | |
| console.log("\007"); | |
| } |