This guide explains how to create, mount, and maintain a VHDX drive for use with WSL (Windows Subsystem for Linux).
- Windows 10/11 with WSL2 installed
- Administrative access
- PowerShell
- Sufficient disk space
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| PASSWORD_PATH = ".password" | |
| PASSWORD_ID_PATH = ".password_id" | |
| # Make sure to have installed vagrant-triggers plugin | |
| # > vagrant plugin install vagrant-triggers | |
| # After the first `vagrant up` stop the VM and execute the following steps |
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
| // HELPER: #key_value | |
| // | |
| // Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}} | |
| // | |
| // Iterate over an object, setting 'key' and 'value' for each property in | |
| // the object. | |
| Handlebars.registerHelper("key_value", function(obj, options) { | |
| var buffer = "", | |
| key; |
| #!/bin/bash | |
| command="$1" | |
| shift | |
| fileSpec="$@" | |
| sentinel=/tmp/t.$$ | |
| touch -t197001010000 $sentinel | |
| while : | |
| do |
| description "Upstart script to run a nodejs app as a service" | |
| author "Louis Chatriot" | |
| env NODE_BIN=/usr/local/bin/node | |
| env APP_DIR=/path/to/app/dir | |
| env SCRIPT_FILE="scriptfile.js" # Entry point for the nodejs app | |
| env LOG_FILE=/path/to/logfile.log | |
| env RUN_AS="anyuser" # Upstart can only be run nicely as root, need to drop privileges | |
| env SERVER_ENV="anything" # Usual apps can be run in different environments (development, test, production ...) | |
| # I typically use the environment variable NODE_ENV (see below) |
Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
| // Lack of tail call optimization in JS | |
| var sum = function(x, y) { | |
| return y > 0 ? sum(x + 1, y - 1) : | |
| y < 0 ? sum(x - 1, y + 1) : | |
| x | |
| } | |
| sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
| // Using workaround |
| // HELPER: #key_value | |
| // | |
| // Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}} | |
| // | |
| // Iterate over an object, setting 'key' and 'value' for each property in | |
| // the object. | |
| Handlebars.registerHelper("key_value", function(obj, fn) { | |
| var buffer = "", | |
| key; |