We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.
- Vagrantfile
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
//Example String to be passed for SHA1 hash generation | |
String targetString = 'eGbq9/2hcZsRlr1JV1PiRackspace Management Interface20010308143725QHOvchm/40czXhJ1OxfxK7jDHr3t'; | |
// Convert to BLOB | |
Blob targetBlob = Blob.valueOf(targetString); | |
// Generate SHA1 digest | |
Blob hashSHA1 = Crypto.generateDigest('SHA1', targetBlob); | |
// For Rackspace Compatiblity encode the binary into BASE 64 | |
// this will result in 28 chars long string | |
String hashBase64SHA1 = EncodingUtil.base64encode (hashSHA1); | |
// should print : "46VIwd66mOFGG8IkbgnLlXnfnkU=" |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |