This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Wrapper script for the letsencrypt client to generate a server certificate in | |
# manual mode. It uses openssl to generate the key and should not modify the | |
# server configuration. It can be called off-side, i.e. not on the destination | |
# server. | |
# | |
# usage: gencert DOMAIN [DOMAIN...] | |
# | |
# This is free and unencumbered software released into the public domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name example.com; | |
root /var/www/drupal8; ## <-- Your only path reference. | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var util = require('util'); | |
var writer = fs.createWriteStream('../log.txt'); | |
fs.watch('.', function (event, filename) { | |
writer.write('================\nEvent: ' + event + '\n'); | |
if (filename) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Watch a directory recursively | |
* | |
* @param {String} dir | |
* @param {Function} cb | |
* | |
* watchRecursive('directory', function(current) { | |
* console.log(current, ' changed'); | |
* }); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!node | |
var fs = require('fs'), | |
path = require('path'), | |
gzip = require('./gzip'); | |
function process(fileBody, options, cb) { | |
if(typeof(fileBody) === 'object') { | |
options = fileBody; | |
fileBody = undefined; | |
cb = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables dc (http://nodejs.org/api/) | |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"), | |
port = process.argv[2] || 1337, // Array ex -> http://nodejs.org/docs/latest/api/process.html#process_process_argv | |
mimeTypes = { | |
// Basic mimes | |
'asc' : 'text/plain', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Restify Server CheatSheet. | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
var restify = require('restify'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m=require; m('http').createServer(function(_, r) {r.end(m('fs').readFileSync("extracted"))}).listen(4444); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// node server instead of xampp ; | |
var http = require('http'); | |
var fs = require('fs'); | |
http.createServer(function (request, response) { | |
var filePath = '.' + request.url; | |
console.log(request.url); | |
fs.readFile(filePath, function(error, content) { | |
response.writeHead(200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 1) run node server.js in root category where installed node | |
* 2) install browser extention | |
* 3) http://localhost:3000/index.html | |
*/ | |
//server settings | |
var serveStatic = require('serve-static'); | |
var connect = require('connect'); | |
var http = require('http'); |
NewerOlder