Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
var bcrypt = require('bcrypt-nodejs'), | |
sqlite3 = require('sqlite3').verbose(); | |
var file = 'content/data/ghost-dev.db'; | |
var db = new sqlite3.Database(file); | |
var password = 'YOUR_NEW_PASSWD'; | |
bcrypt.hash(password, null, null, function(err, hash) { | |
db.serialize(function() { | |
db.run("UPDATE users SET password = ? WHERE id = ?", hash, 1); |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/app'); | |
var usrSchema = new mongoose.Schema({ | |
user: { type: String, required: true }, | |
password: { type: String, required: true }, | |
DLU: { type: Date } | |
}); | |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
var $ = require('cheerio'), | |
_ = require('underscore'), | |
request = require('request'), | |
// If you want to create a file | |
images = [], | |
path = require('path'), | |
dir = path.join(__dirname,'\Templates'), | |
fs = require('fs'), | |
GetImage = function(file){ | |
var HtmlFile = fs.readFileSync(file).toString(), |
Headless testing
Frameworks, Librerias y Herramientas
var ipp = require('ipp'); //get it from there - https://npmjs.org/package/ipp - $npm install ipp | |
var request = require('request'); //get it from there - https://npmjs.org/package/request - $npm install request | |
var fs = require('fs'); | |
function getPrinterUrls(callback) { | |
var CUPSurl = 'http://localhost:631/printers';//todo - change of you have CUPS running on other host | |
request(CUPSurl, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
var printersMatches = body.match(/<TR><TD><A HREF="\/printers\/([a-zA-Z0-9-^"]+)">/gm);//i know, this is terrible, sorry( | |
var printersUrls = []; |
This article will explain how to set up a secure web server with NodeJS which only accepts connection from users with SSL certificates that you have signed. This is an efficient way to ensure that no other people are able to access the web server, without building a login system which will be significantly weaker.
I will not explain how to create a certificate authority (CA), create certificates or sign them. If you need to read up on this, have a look at this excelent article on how to do it with OpenSSL (Mac and Linux): https://help.ubuntu.com/community/OpenSSL#Practical_OpenSSL_Usage It is also possible to do this on a Mac with the keychain application, and I assume it is possible on a Windows machine aswell.
This architecture will allow you to have one web server communicating with an array of trusted clients, the web server itself can be on the public internet, that will not decrease the level of security, but it will only ser
Before starting, ensure you can ssh user@targetserver
successfully - public/private keys are a smart choice here.
targetserver
Example here assumes all Git repository users are members of a gitusers
group, adjust to suit.
go to https://github.com/maxogden/art-of-node#art-of-node to view the newer versions of this document