UNINCORPORATED FACTS
- _tickCallback processes the process.nextCallback queue
- setTimeout cannot have a timeout smaller than 1
- domains make changes
There are two important things to remember about the Node event loop. The
var http = require('http'); | |
var server = http.createServer(function(req, res) { | |
// console.log(req); // debug dump the request | |
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object) | |
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 | |
console.log("Authorization Header is: ", auth); |
/** | |
* Allow other processes to execute while iterating over | |
* an array. Useful for large arrays, or long-running processing | |
* | |
* @param {Function} fn iterator fed each element of the array. | |
* @param {Function} next executed when done | |
*/ | |
Array.prototype.nonBlockingForEach = function(fn, next) { | |
var arr = this; | |
var i = 0; |
var phantom = require('phantom'); | |
var async = require('async'); | |
var pagesToCall = [ | |
['http://www.google.com', 8000], | |
['http://www.allthingsd.com', 8001], | |
['http://www.wired.com', 8002], | |
['http://www.mashable.com', 8003], | |
['http://www.stackoverflow.com', 8004] | |
]; |
{ | |
"title": "Apache and Tomcat Logs", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "apache !tomcat !static", | |
"alias": "", | |
"color": "#7EB26D", | |
"id": 0, |
#!/bin/bash | |
# | |
# Startup script for Nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Tengine is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /usr/local/tengine/conf/nginx.conf | |
# pidfile: /usr/local/tengine/logs/nginx.pid | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: nginx-conf | |
data: | |
nginx.conf: | | |
user nginx; | |
worker_processes 3; | |
error_log /var/log/nginx/error.log; | |
events { |
Follow instructions here