Skip to content

Instantly share code, notes, and snippets.

View g13013's full-sized avatar

Aboubakr Gasmi g13013

  • Emploitic.com
  • Algiers
View GitHub Profile
@g13013
g13013 / Gemfile
Last active August 29, 2015 14:21 — forked from petems/Gemfile
source "https://rubygems.org"
gem "progressbar"

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@g13013
g13013 / gist:0f0246a181909e259edd
Last active August 29, 2015 14:00
A benchmark that treats a relative path to a file in the same directory, it shows that node`s `path` and `url` APIs in are not always the fastest way.
var Benchmark = require('benchmark');
var path = require('path');
var url = require('url');
var suite = new Benchmark.Suite();
var p1 = 'path/to/file';
var p2 = './another_file';
function a() {
return path.join(p1, '..', p2);
}