Time-stamp: <2012-03-30 Fri 16:56 README.md>
Author....: 'Mash (Thomas Herbert)
Bacula concurrent jobs multiple storage devices client labeled pools Debian installation and configuration.
Please see http://toshine.org/etc for full article.
server { | |
root /var/www/example.com/static; | |
server_name example.com; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; | |
try_files /maintenance.html @proxy; | |
location @proxy { | |
proxy_pass http://127.0.0.1:10001; |
// One shot request HTTP client - show local/remote addresses | |
// | |
// Attempt to use a modified Agent that has own self.createConnection() | |
// that binds the client socket to a particular address. | |
var assert = require('assert'), | |
dns = require('dns'), | |
http = require('http'), | |
net = require('net'), | |
util = require('util'); |
Time-stamp: <2012-03-30 Fri 16:56 README.md>
Author....: 'Mash (Thomas Herbert)
Bacula concurrent jobs multiple storage devices client labeled pools Debian installation and configuration.
Please see http://toshine.org/etc for full article.
/* | |
Much better approach than trying to connect to a range of ports. | |
*/ | |
var net = require('net'); | |
getFreePort(function(err, port) { | |
if (err) throw err; | |
console.log('Port: ' + port); |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
##what are generators##
yield
a value, the function pauses until .next(modifiedYieldValue)
is calledvar myGen = function*() {
var one = yield 1;
var two = yield 2;
var three = yield 3;
console.log(one, two, three);
// Install packages: | |
// npm install mongodb async | |
// Add index in mongo: | |
// db.ensureIndex('mycollection', { rand: 1 }) | |
var mongodb = require('mongodb') | |
var async = require('async') | |
// Find n random documents by using "rand" field. |
#Inject javascript into HTML pages from console
An easy way to inject Javascripts into the current loaded dom using the developer console in chrome.
jQuery
var script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-1.7.2.min.js';
root /app/public | |
tls /app/_docker/caddy/server.crt /app/_docker/caddy/server.key | |
fastcgi / php:9000 php | |
errors visible | |
rewrite { | |
regexp .* | |
ext / | |
to /index.php?{query} | |
} |