A shell script to install VPN using SoftEther and Transmission CLI Torrent Client on Ubuntu 14.04 for use on Digital Ocean
- Execution for installation and setup
sudo su| // This file is part of github.com/Trrnts/Trrnts - an upcoming alternative to The Pirate Bay. | |
| var bencode = require('bencode'), | |
| dgram = require('dgram'), | |
| hat = require('hat'), | |
| _ = require('lodash'), | |
| redis = require('../redis')(), | |
| geoip = require('geoip-lite'); | |
| // Put in a function. The returned function won't ever throw an error. This is |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| var collectionNames = db.getCollectionNames(), stats = []; | |
| collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
| stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
| for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |
| function convertTimestamp(timestamp) { | |
| var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds | |
| yyyy = d.getFullYear(), | |
| mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0. | |
| dd = ('0' + d.getDate()).slice(-2), // Add leading 0. | |
| hh = d.getHours(), | |
| h = hh, | |
| min = ('0' + d.getMinutes()).slice(-2), // Add leading 0. | |
| ampm = 'AM', | |
| time; |
| var mongoose = require('mongoose'); | |
| var Schema = mongoose.Schema; | |
| var assert = require('assert') | |
| console.log('\n==========='); | |
| console.log(' mongoose version: %s', mongoose.version); | |
| console.log('========\n\n'); | |
| var dbname = 'testing_geojsonPoint'; |
Handlebars.js is a template framework for Javascript environments. It allows the construction of HTML elements using HTML and expressions wrapped in {{ }}
One of the conditional block helpers Handlebars offers is the {{#if}}.
For example:
<div class="entry">| # Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software. | |
| # To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module | |
| # This module "secure-link" helps you to protect links from stealing away. | |
| # | |
| # NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg | |
| cd /usr/src | |
| wget http://nginx.org/download/nginx-1.5.13.tar.gz | |
| tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz |