Sunday, December 4, 2016

Installing MkDocs on Fedora 25


As mentioned in previous posts, I've been helping the OpenIndiana project with updating their end user systems documentation. The existing documentation site uses a WIKI, but it's been neglected for several years and has become outdated. With the OpenIndiana distribution experiencing something of a renaissance over the past year, the poor state of the end user documentation has become all the more apparent.

To that end, I've assisted the project with a documentation revitalization initiative. We now have an MkDocs site served from Github pages (https://docs.openindiana.org) and all documentation now resides on GitHub (https://github.com/OpenIndiana/oi-docs). Using Travis-CI, the site gets automatically pushed whenever we make a commit. It's a splendid example of continuous integration.

Currently we're in the process of reviewing and migrating content from the old WIKI to the new platform, but that's going to take some time to complete. Hopefully within the next year we'll complete this effort.

To assist with this process I have been using a Lenovo W500 laptop running Linux Mint 17.2 KDE as my primary workstation. It works pretty well for writing documentation, but it's not really optimal for spending long hours running virtual machines and writing documentation. A newer and more powerful system with a mechanical keyboard is far more ideal.

To that end I picked up an ASROCK Deskmini which is running a new Intel i3-6100 dual core with hyperthreading. This system is significantly faster than my old laptop with it's rather dated core 2 duo. To that I have added a nice Samsung 24 inch wide screen LCD monitor and a Tesoro mechanical keyboard (with Cherry brown switches). I love the new system. It's fast, modern, and powerful. It's quite energy efficient as well.

While the old laptop was running Linux Mint 17.2, I've been wanting to move away from the Debian world and back into the Redhat based world. While I love Linux Mint and will sorely miss it, I'm doing this because where I work we're primarily a Redhat shop and I need to get up to speed supporting a Redhat based environment.

I would have installed Centos 7 on the new machine, but discovered the hardware is too new for Centos 7. It would not install. Fortunately the KDE spin of Fedora 25 installed without much fuss.

So, here we are on a nice shiny new system running Fedora 25 and now we need to install a few things to optimize it as a documentation generating platform.


First....I gotta have Chromium. Firefox just isn't going to cut it.

sudo dnf install chromium


Next on the list is Vim. While Kate is nice, I feel more at home in Vim.

sudo dnf install vim


To write docs, I'm going to need a few more things as well. We're going to need GIT, Ruby Gems, and MkDocs along with the bootswatch themes.

We'll start with Ruby Gems and GIT.

sudo dnf install rubygems git


Now for MkDocs and the bootswatch themes:

sudo pip install mkdocs mkdocs-bootswatch


And so I can validate the markdown used for MkDocs, I'll also install MarkDown Lint.

sudo gem install mdl


There you go. Everything which is required for writing docs for the OpenIndiana Project. If you care to join in on the fun, shoot us an email: Docs AT OpenIndiana.org

Wednesday, August 24, 2016

Installing MKDOCS on Linux Mint 18

The OpenIndiana Project is migrating over to MKDOCS as it's documentation platform and I have been using it for a few months now on both OpenIndiana Hipster as well as on Linux Mint 17.2 and 17.3. Installing all the pieces can sometimes incur some pain, but I have documented the process and it generally goes pretty well.

This past week however, I built a new machine and installed the beta of Linux Mint 18 with KDE 5. So naturally I tried to install MKDOCS...which didn't go so well.

Initially I tried doing a 'sudo pip install mkdocs' and that failed at several different points. And somehow pip was having troubles installing a prerequisite (setuptools). Also, PIP was complaining about being outdated, but I could not get past the 2nd set of errors:

error: invalid command 'bdist_wheel'

So, then I tried installing the native packaged version and found it was so old (version .014) that it did not properly render the site theme.

In the end the solution was to install the python 3 version of pip and use pip3 to install the software. I still had to upgrade setuptools first though. Not sure what that is all about as I have installed MKDOCS a dozen times on OpenIndiana and Linux Mint 17.x and never run into it before. And PIP was still complaining about being outdated, so I upgraded it.

If you follow the steps below, it should all work just fine for you.

$ sudo pip3 install setuptools
$ sudo pip3 install --upgrade pip
$ sudo pip3 install mkdocs

$ mkdocs --version
mkdocs, version 0.15.3

Sunday, August 21, 2016

OpenIndiana on VMware ESXI

While a little dated (circa 2012), I found some very interesting information about installing and running OpenIndiana on VMware ESXI. It covers the following topics:

  • Background information about OpenIndiana and OS installation
  • Network configuration and Setting up storage
  • Presenting storage to your Hosts with iSCSI and/or NFS
  • Performance testing

For more information see the following blog posts:

OpenIndiana Installation walkthrough - Part 1

OpenIndiana Installation walkthrough - Part 2

OpenIndiana Installation walkthrough - Part 3

OpenIndiana Installation walkthrough - Part 4

Sunday, April 24, 2016

Installing Awestruct on Linux Mint 17.x

Installing Awestruct on Linux Mint 17.x

Installing Awestruct on Linux Mint 17.x

Introduction

The instructions from the Awestruct website assume quite a bit of existing knowledge. As a result, many of steps lack all the necessary information to complete the task. The notes below may help to fill in some of the blanks and should help you get things going.

Prerequisites

Install GIT & Curl

If you haven’t already done so, install GIT so you can version control your project. Curl will be used to install RVM (assuming you select method # 2 below).

sudo apt-get install git curl
Install a Ruby build environment

To use Awestruct, you essentially need to install a complete Ruby build environment. The latest version of Awestruct requires Ruby version 2.0 (or greater), and to build these things, you also require ruby2.0-dev (or greater).

Installing a Ruby development environment

There are 2 ways to approach this task:

Method # 1 - System Level

  • Using this method, you will be installing or upgrading your Ruby environment at the system level, which will affect all users of the machine.

    • This method also requires the use of sudo for installing gems, etc.

You can search the apt cache to see what versions are available by doing an apt-cache search ruby2 You can check your existing version of Ruby using ruby -v and listing installed gems with gem2.0 list.

The following commands should get things installed OK.

sudo apt-get install ruby2.0 ruby2.0-dev

Next install Awestruct:

sudo gem2.0 install awestruct

Method # 2 - User Level - (preferred method)

  • Use RVM (Ruby Version Manager)

This is probably the best way to manage a Ruby build environment as it installs everything right into your own home directory. Not only that, but you are then able to install gems without having to elevate permissions using sudo.

To get this to work correctly, I had to do a number of things.

Install the RVM key
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
Install RVM
curl -L https://get.rvm.io | bash -s stable --ruby=2.3.0

Here is what things looked like when I installed RVM on Linux Mint 17.3.

$~> curl -L https://get.rvm.io | bash -s stable --ruby=2.3.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    724      0 --:--:-- --:--:-- --:--:--   724
100 22865  100 22865    0     0  51150      0 --:--:-- --:--:-- --:--:-- 51150
Downloading https://github.com/rvm/rvm/archive/1.27.0.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.27.0/1.27.0.tar.gz.asc
gpg: Signature made Tue 29 Mar 2016 09:49:47 AM EDT using RSA key ID BF04FF17
gpg: Good signature from "Michal Papis (RVM signing) <mpapis@gmail.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 409B 6B17 96C2 7546 2A17  0311 3804 BB82 D39D C0E3
     Subkey fingerprint: 62C9 E5F4 DA30 0D94 AC36  166B E206 C29F BF04 FF17
GPG verified '/home/mike/.rvm/archives/rvm-1.27.0.tgz'

Installing RVM to /home/mike/.rvm/
    Adding rvm PATH line to /home/mike/.profile /home/mike/.mkshrc /home/mike/.bashrc /home/mike/.zshrc.
    Adding rvm loading line to /home/mike/.profile /home/mike/.bash_profile /home/mike/.zlogin.
Installation of RVM in /home/mike/.rvm/ is almost complete:

  * To start using RVM you need to run `source /home/mike/.rvm/scripts/rvm`
    in all your open shell windows, in rare cases you need to reopen all shell windows.

# Michael,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: https://rvm.io/help and https://twitter.com/rvm_io
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
Searching for binary rubies, this might take some time.
No binary rubies available for: mint/17.3/x86_64/ruby-2.3.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for mint.
Installing requirements for mint.
Updating system...........
Installing required packages: libreadline6-dev, zlib1g-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgmp-dev, libgdbm-dev, libncurses5-dev, automake, libtool, bison, libffi-dev............|
Requirements installation successful.
Found user configured '-j' flag in 'rvm_make_flags', please note that RVM can detect number of CPU threads and set the '-j' flag automatically if you do not set it.
Installing Ruby from source to: /home/mike/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu(s)...
ruby-2.3.0 - #downloading ruby-2.3.0, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.5M  100 13.5M    0     0  2905k      0  0:00:04  0:00:04 --:--:-- 2906k
ruby-2.3.0 - #extracting ruby-2.3.0 to /home/mike/.rvm/src/ruby-2.3.0....
ruby-2.3.0 - #configuring..........................................................
ruby-2.3.0 - #post-configuration..
ruby-2.3.0 - #compiling.................................................................................
ruby-2.3.0 - #installing...........................
ruby-2.3.0 - #making binaries executable..
Installed rubygems 2.5.1 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.3.0 - #gemset created /home/mike/.rvm/gems/ruby-2.3.0@global
ruby-2.3.0 - #importing gemset /home/mike/.rvm/gemsets/global.gems...............................................
ruby-2.3.0 - #generating global wrappers........
ruby-2.3.0 - #gemset created /home/mike/.rvm/gems/ruby-2.3.0
ruby-2.3.0 - #importing gemsetfile /home/mike/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.0 - #generating default wrappers........
ruby-2.3.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
Creating alias default for ruby-2.3.0...

  * To start using RVM you need to run `source /home/mike/.rvm/scripts/rvm`
    in all your open shell windows, in rare cases you need to reopen all shell windows.
Sourcing the RVM directory

When you installed RVM, one of the things the installer did was add a path statement to the end of your .bashrc file.

#export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

Personally I didn’t have much luck getting this to work unless I explicitly sourced it each and every time I opened a new shell.

Well, that’s far too much work (and something I won’t always remember to do), so I ended up replacing it with the following function. Comment out the line installed by RVM and following that line, paste in the function shown below.

# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then

# First try to load from a user install
  source "$HOME/.rvm/scripts/rvm"

elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then

# Then try to load from a root install
  source "/usr/local/rvm/scripts/rvm"

else

  printf "ERROR: An RVM installation was not found.\n"

fi

Now source your ~/.basrc or restart your shell. From this point forward, you should never have to do this again.

To help you determine whether RVM has been properly sourced, perform a which ruby or which gem. The which command will return the respective path to the binary executable (which in this case, should be to your ~/.rvm directory).

Now that we have a build environment established, and the path to the ~/.rvm directory has been sourced, we can go ahead with installing Awestruct and Bundler.

Installing Awestruct, Bundler, and Rake

gem install awestruct bundler rake

On my system (Linux Mint 17.3), this installed a whole lot of things.

$~> gem install awestruct bundler rake
Fetching: tilt-2.0.2.gem (100%)
Successfully installed tilt-2.0.2
Fetching: netrc-0.11.0.gem (100%)
Successfully installed netrc-0.11.0
Fetching: mime-types-2.99.1.gem (100%)
Successfully installed mime-types-2.99.1
Fetching: unf_ext-0.0.7.2.gem (100%)
Building native extensions.  This could take a while...
Successfully installed unf_ext-0.0.7.2
Fetching: unf-0.1.4.gem (100%)
Successfully installed unf-0.1.4
Fetching: domain_name-0.5.20160310.gem (100%)
Successfully installed domain_name-0.5.20160310
Fetching: http-cookie-1.0.2.gem (100%)
Successfully installed http-cookie-1.0.2
Fetching: rest-client-1.8.0.gem (100%)
Successfully installed rest-client-1.8.0
Fetching: rack-1.6.4.gem (100%)
Successfully installed rack-1.6.4
Fetching: parallel-1.8.0.gem (100%)
Successfully installed parallel-1.8.0
Fetching: ast-2.2.0.gem (100%)
Successfully installed ast-2.2.0
Fetching: ansi-1.5.0.gem (100%)
Successfully installed ansi-1.5.0
Fetching: ruby-ll-2.1.2.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ruby-ll-2.1.2
Fetching: oga-1.3.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed oga-1.3.1
Fetching: multi_json-1.11.2.gem (100%)
Successfully installed multi_json-1.11.2
Fetching: little-plugger-1.1.4.gem (100%)
Successfully installed little-plugger-1.1.4
Fetching: logging-2.1.0.gem (100%)
Successfully installed logging-2.1.0
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.10
Fetching: rb-inotify-0.9.7.gem (100%)
Successfully installed rb-inotify-0.9.7
Fetching: rb-fsevent-0.9.7.gem (100%)
Successfully installed rb-fsevent-0.9.7
Fetching: listen-3.1.1.gem (100%)
Successfully installed listen-3.1.1
Fetching: haml-4.0.7.gem (100%)

HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:

* Support for Ruby 1.8.6 dropped
* Support for Rails 2 dropped
* Sass filter now always outputs <style> tags
* Data attributes are now hyphenated, not underscored
* html2haml utility moved to the html2haml gem
* Textile and Maruku filters moved to the haml-contrib gem

For more info see:

http://rubydoc.info/github/haml/haml/file/CHANGELOG.md

Successfully installed haml-4.0.7
Fetching: guard-compat-1.2.1.gem (100%)
Successfully installed guard-compat-1.2.1
Fetching: thor-0.19.1.gem (100%)
Successfully installed thor-0.19.1
Fetching: shellany-0.0.1.gem (100%)
Successfully installed shellany-0.0.1
Fetching: slop-3.6.0.gem (100%)
Successfully installed slop-3.6.0
Fetching: method_source-0.8.2.gem (100%)
Successfully installed method_source-0.8.2
Fetching: coderay-1.1.1.gem (100%)
Successfully installed coderay-1.1.1
Fetching: pry-0.10.3.gem (100%)
Successfully installed pry-0.10.3
Fetching: nenv-0.3.0.gem (100%)
Successfully installed nenv-0.3.0
Fetching: notiffany-0.0.8.gem (100%)
Successfully installed notiffany-0.0.8
Fetching: lumberjack-1.0.10.gem (100%)
Successfully installed lumberjack-1.0.10
Fetching: formatador-0.2.5.gem (100%)
Successfully installed formatador-0.2.5
Fetching: guard-2.13.0.gem (100%)
Successfully installed guard-2.13.0
Fetching: http_parser.rb-0.6.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed http_parser.rb-0.6.0
Fetching: eventmachine-1.2.0.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed eventmachine-1.2.0.1
Fetching: em-websocket-0.5.1.gem (100%)
Successfully installed em-websocket-0.5.1
Fetching: guard-livereload-2.5.2.gem (100%)
Successfully installed guard-livereload-2.5.2
Fetching: git-1.3.0.gem (100%)
Successfully installed git-1.3.0
Fetching: asciidoctor-1.5.4.gem (100%)
Successfully installed asciidoctor-1.5.4
Fetching: awestruct-0.5.7.gem (100%)
Successfully installed awestruct-0.5.7
Parsing documentation for tilt-2.0.2
Installing ri documentation for tilt-2.0.2
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for mime-types-2.99.1
Installing ri documentation for mime-types-2.99.1
Parsing documentation for unf_ext-0.0.7.2
Installing ri documentation for unf_ext-0.0.7.2
Parsing documentation for unf-0.1.4
Installing ri documentation for unf-0.1.4
Parsing documentation for domain_name-0.5.20160310
Installing ri documentation for domain_name-0.5.20160310
Parsing documentation for http-cookie-1.0.2
Installing ri documentation for http-cookie-1.0.2
Parsing documentation for rest-client-1.8.0
Installing ri documentation for rest-client-1.8.0
Parsing documentation for rack-1.6.4
Installing ri documentation for rack-1.6.4
Parsing documentation for parallel-1.8.0
Installing ri documentation for parallel-1.8.0
Parsing documentation for ast-2.2.0
Installing ri documentation for ast-2.2.0
Parsing documentation for ansi-1.5.0
Installing ri documentation for ansi-1.5.0
Parsing documentation for ruby-ll-2.1.2
Installing ri documentation for ruby-ll-2.1.2
Parsing documentation for oga-1.3.1
Installing ri documentation for oga-1.3.1
Parsing documentation for multi_json-1.11.2
Installing ri documentation for multi_json-1.11.2
Parsing documentation for little-plugger-1.1.4
Installing ri documentation for little-plugger-1.1.4
Parsing documentation for logging-2.1.0
Installing ri documentation for logging-2.1.0
Parsing documentation for ffi-1.9.10
Installing ri documentation for ffi-1.9.10
Parsing documentation for rb-inotify-0.9.7
Installing ri documentation for rb-inotify-0.9.7
Parsing documentation for rb-fsevent-0.9.7
Installing ri documentation for rb-fsevent-0.9.7
Parsing documentation for listen-3.1.1
Installing ri documentation for listen-3.1.1
Parsing documentation for haml-4.0.7
Installing ri documentation for haml-4.0.7
Parsing documentation for guard-compat-1.2.1
Installing ri documentation for guard-compat-1.2.1
Parsing documentation for thor-0.19.1
Installing ri documentation for thor-0.19.1
Parsing documentation for shellany-0.0.1
Installing ri documentation for shellany-0.0.1
Parsing documentation for slop-3.6.0
Installing ri documentation for slop-3.6.0
Parsing documentation for method_source-0.8.2
Installing ri documentation for method_source-0.8.2
invalid options: -SNw2
(invalid options are ignored)
Parsing documentation for coderay-1.1.1
Installing ri documentation for coderay-1.1.1
Parsing documentation for pry-0.10.3
Installing ri documentation for pry-0.10.3
Parsing documentation for nenv-0.3.0
Installing ri documentation for nenv-0.3.0
Parsing documentation for notiffany-0.0.8
Installing ri documentation for notiffany-0.0.8
Parsing documentation for lumberjack-1.0.10
Installing ri documentation for lumberjack-1.0.10
Parsing documentation for formatador-0.2.5
Installing ri documentation for formatador-0.2.5
Parsing documentation for guard-2.13.0
Installing ri documentation for guard-2.13.0
Parsing documentation for http_parser.rb-0.6.0
Installing ri documentation for http_parser.rb-0.6.0
Parsing documentation for eventmachine-1.2.0.1
Installing ri documentation for eventmachine-1.2.0.1
Parsing documentation for em-websocket-0.5.1
Installing ri documentation for em-websocket-0.5.1
Parsing documentation for guard-livereload-2.5.2
Installing ri documentation for guard-livereload-2.5.2
Parsing documentation for git-1.3.0
Installing ri documentation for git-1.3.0
Parsing documentation for asciidoctor-1.5.4
Installing ri documentation for asciidoctor-1.5.4
Parsing documentation for awestruct-0.5.7
Installing ri documentation for awestruct-0.5.7
Done installing documentation for tilt, netrc, mime-types, unf_ext, unf, domain_name, http-cookie, rest-client, rack, parallel, ast, ansi, ruby-ll, oga, multi_json, little-plugger, logging, ffi, rb-inotify, rb-fsevent, listen, haml, guard-compat, thor, shellany, slop, method_source, coderay, pry, nenv, notiffany, lumberjack, formatador, guard, http_parser.rb, eventmachine, em-websocket, guard-livereload, git, asciidoctor, awestruct after 71 seconds
Fetching: bundler-1.11.2.gem (100%)
Successfully installed bundler-1.11.2
Parsing documentation for bundler-1.11.2
Installing ri documentation for bundler-1.11.2
Done installing documentation for bundler after 5 seconds
Fetching: rake-11.1.2.gem (100%)
Successfully installed rake-11.1.2
Parsing documentation for rake-11.1.2
Installing ri documentation for rake-11.1.2
Done installing documentation for rake after 1 seconds
43 gems installed

Configuring Awestruct

At this point we should be able to create our project directory and initialize it with Awestruct, etc. Again the documentation is severely lacking background information, etc.

Create a project directory and place it under version control
  • Create your project directory : mkdir myproj

  • Change directory into it: cd myproj

  • Initialize version control for the directory: git init

Create your .gitignore

Consult: http://awestruct.org/auto-deploy-to-github-pages/ for details on what to put into your ignore files.

Install missing gem dependencies

Now in a perfect world, you should now be able to initialize your project with Awestruct without any further fuss. Well, that would be nice, but there is a good chance you’re still missing some dependencies.

So, lets go ahead and get those installed.

Awestruct dependencies are a bit of a chicken and egg problem. As part of the Awestruct installation, it generates a Gemfile which you can use with Bundler. The problem is you need that file (along with Bundler) before you can even initialize the project. In some use cases (such as where you are sharing a project with Github, then bundler probably makes sense. Otherwise, you’re stuck installing things manually using gem install. So, there you go. It is what it is.

After that nice little introduction, I’ll qualify things by saying this step may (or may not) be optional (depending on your use case). You could try initializing the project now to see what’s still missing. Only way you’ll find out is by giving it a try.

Alternately, you can just forgo all that by installing what might be missing right now (even if you end up adding some gems you’ll never use).

gem install htmlcompressor uglifier coffee-script therubyracer therubyrhino less sass bootstrap bootstrap-sass compass zurb-foundation

If you don’t install these first, you’ll get all sorts of errors when you attempt to initialize your project.

Initialize your project with Awestruct
awestruct -i -f bootstrap
Awestruct is capable of using either Bootstrap or Foundation as the CSS framework. For a comparison between the Bootstrap and Foundation frameworks, see here: http://blog.teamtreehouse.com/use-bootstrap-or-foundation

Because our project is using Bootstrap, we have specified it as the CSS framework during our Awestruct initialization.

If all goes well, you should see something like the following. If you get more errors, then it’s likely you are still missing additional gem dependencies and will need to install those too.

$~> awestruct -i -f bootstrap
Create directory: /home/mike/website/_config
Create directory: /home/mike/website/_layouts
Create directory: /home/mike/website/_ext
Create file: /home/mike/website/_ext/pipeline.rb
Create file: /home/mike/website/.awestruct_ignore
Create file: /home/mike/website/Rakefile
Create directory: /home/mike/website/stylesheets
Create file: /home/mike/website/Gemfile
   create config.rb

*********************************************************************
Congratulations! Your compass project has been created.

You may now add sass stylesheets to the stylesheets subdirectory of your project.

Sass files beginning with an underscore are called partials and won't be
compiled to CSS, but they can be imported into other sass stylesheets.

You can configure your project by editing the config.rb configuration file.

You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
  1. To compile on demand:
     compass compile [path/to/project]
  2. To monitor your project for changes and automatically recompile:
     compass watch [path/to/project]

More Resources:
  * Website: http://compass-style.org/
  * Sass: http://sass-lang.com
  * Community: http://groups.google.com/group/compass-users/
Create file: /home/mike/website/_config/site.yml
Create file: /home/mike/website/_layouts/base.html.haml
Create file: /home/mike/website/index.html.haml
Create your .gitignore

Before saving anything using GIT version control, you first need to configure your ignore files.

Awestruct installs a file named awestruct_ignore, but you may need to make additional entries into it. Also, you’ll need to manually create your .gitignore file.

For details on how to complete these steps, consult: http://awestruct.org/auto-deploy-to-github-pages/.

Configuring the Gemfile for Bundler

When you initialized your project using Awestruct, one of the files it created was Gemfile. Bundler uses this file to manage Ruby gem dependencies (much like Vundle and other plugin managers are used to manage plugins for VIM).

Configure the Gemfile

Start by uncommenting a few things in Gemfile. A couple of fixes are required here as well. For example the line with bootstrap-sass was looking for the wrong version. To get things working I also had to add gem opal to the bottom.

For reference, here is a copy of my Gemfile.

# This file is a Bundler dependency descriptor file. Its purpose is to list all of
# the dependencies you are using to build your site. It is highly recommended you use
# this to keep your dependencies up to date and not cause conflicts with other gems
# already on your system.
#
# If you do not already have Bundler installed on your computer, run:
#
#  gem install bundler
#
# To use this dependecy file simply run:
#
#  bundle install
#
# We do recommend that you install the gems into another directory however, to ensure
# your awestruct site is pristine and isn't using versions of gems from other programs.
# To do this execute:
#
#  bundle install --path .bundle
#
# More information about Bundler and its other commands can be found at http://gembundler.com/.
# To add other dependencies for your awestruct site simply follow the same pattern as you'll
# find below. To make use of dependecies listed here, simply remove the '#' from the start of
# the line to uncomment the dependency. We hope you enjoy using Awestruct!

source 'https://rubygems.org'                             # This tells Bundler where to look for gems

gem 'awestruct', '>= 0.5.7'                               # Goes without saying
gem 'webrick', '~> 1.3.1'                                 # The rack webserver to use in dev mode

gem 'bootstrap-sass', '>= 3.2.0.2'
gem 'compass', '>= 1.0.1'

# FIXME
gem 'rake', '>= 0.9.2'                                  # Needed for the Rakefile to work
# gem 'coffee-script', '>= 2.2.0'                         # If using coffee-script or to remove the warning
# gem 'rb-fsevent', '~> 0.9', :require => false           # to remove warning about pulling, Mac OSX
# gem 'rb-inotify', '>= 0.9.0', :require => false         # to remove warning about pulling, Linux
# gem 'wdm', :platforms => [:mswin, :mingw], :require => false # to remove warning about pulling, Windows (ruby 1.9+)
# gem 'rb-fchange', '~> 0.0.6', :require => false         # to remove warning about pulling, Windows (ruby 1.8.7)
gem 'therubyracer', '>= 0.10.0', :platforms => :ruby       # Javascript runtime on mri (needed for LESS and coffee-script)
# gem 'therubyrhino', '~> 2.0.2', :platforms => :jruby    # Javascript runtime on jruby (needed for LESS and coffee-script)
# gem 'less', '>= 2.2.2'                                  # If using LESS instead of sass
# gem 'org-ruby', '>= 0.8'                                # If using Org-Mode
# gem 'RedCloth', '>= 4.2.9'                              # If using Textile
gem 'asciidoctor', '>= 0.1.1'                           # If using AsciiDoc syntax, need 0.1.1 for Header support
# gem 'slim', '>= 1.3.6'                                  # If using slim instead of haml
# gem 'kramdown', '>= 0.14.2'                             # If using Markdown
gem 'uglifier', '>= 1.3.0'                              # If using the minify transformer
gem 'htmlcompressor', '>= 0.0.3'                        # If using the minify transformer
gem 'opal'
Run Bundler to install the dependencies listed in the Gemfile
bundle install

Again, this is what I saw it do on my system running Linux Mint 17.3:

$~> bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using rake 11.1.2
Using ansi 1.5.0
Using asciidoctor 1.5.4
Using ast 2.2.0
Installing execjs 2.6.0
Using git 1.3.0
Using formatador 0.2.5
Using rb-fsevent 0.9.7
Using ffi 1.9.10
Using lumberjack 1.0.10
Using nenv 0.3.0
Using shellany 0.0.1
Using coderay 1.1.1
Using method_source 0.8.2
Using slop 3.6.0
Using thor 0.19.1
Using eventmachine 1.2.0.1
Using http_parser.rb 0.6.0
Using guard-compat 1.2.1
Using multi_json 1.11.2
Using tilt 2.0.2
Using little-plugger 1.1.4
Using mime-types 2.99.1
Using parallel 1.8.0
Using rack 1.6.4
Using unf_ext 0.0.7.2
Using netrc 0.11.0
Installing sass 3.4.21
Installing chunky_png 1.3.5
Installing concurrent-ruby 1.0.1
Installing hike 1.2.3
Installing htmlcompressor 0.3.0
Installing libv8 3.16.14.13
Installing sourcemap 0.1.1
Installing ref 2.0.0
Installing webrick 1.3.1
Using bundler 1.11.2
Using ruby-ll 2.1.2
Installing autoprefixer-rails 6.3.5
Installing uglifier 3.0.0
Using rb-inotify 0.9.7
Using notiffany 0.0.8
Using pry 0.10.3
Using em-websocket 0.5.1
Using haml 4.0.7
Using logging 2.1.0
Using unf 0.1.4
Installing compass-core 1.0.3
Installing compass-import-once 1.0.5
Installing sprockets 3.5.2
Installing therubyracer 0.12.2 with native extensions
Using oga 1.3.1
Installing bootstrap-sass 3.3.6
Installing listen 3.0.6
Using domain_name 0.5.20160310
Installing compass 1.0.3
Installing opal 0.9.2
Using guard 2.13.0
Using http-cookie 1.0.2
Using guard-livereload 2.5.2
Using rest-client 1.8.0
Using awestruct 0.5.7
Bundle complete! 10 Gemfile dependencies, 62 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from compass:
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!

As you can see, some of these gems were already installed. Others were missing and were downloaded and installed.

Using rake

At this point (assuming all dependencies have been satisfied), we should be able to launch our Awestruct website.

While it’s possible to directly use the awestruct command to perform various tasks (e.g. serve the site in development mode, deploy it, etc.), it’s easier to use rake for this purpose. For more details about rake see: http://awestruct.org/getting_started/

This page describes several rake tasks (things it can do). There is a fair bit of complexity to all this.

To get things moving, we’ll launch Awestruct in development mode.

rake clean preview
If you received any errors when running rake clean preview, you might need to add some 'requires' to _ext/pipeline.rb I did not have any errors caused by this, but added require 'asciidoctor' as I intend to use Asciidoctor for my text markup.

After fixing all the missing requires and installing any remaining missing gems, etc., you should now get something that looks like this:

$~> rake clean preview
Running command: bundle exec awestruct -d
Generating site: http://localhost:4242
Executing pipeline...
***************************************************************************
Starting preview server at http://localhost:4242 (Press Ctrl-C to shutdown)
***************************************************************************

[2016-03-27 17:56:22] INFO  WEBrick 1.3.1
17:56:22 - INFO - LiveReload is waiting for a browser to connect.
[2016-03-27 17:56:22] INFO  ruby 2.3.0 (2015-12-25) [x86_64-linux]
[2016-03-27 17:56:22] INFO  WEBrick::HTTPServer#start: pid=28187 port=4242

To preview the site in development mode, open your web browser to http:://localhost:4242.

Congratulations

If you have gotten this far, that’s quite an achievement. However, this is just the very beginning of a very long journey.

The URL above is based on using foundation, not bootstrap. Even so, you’ll find something useful in following it. You may also want to read up on the various extensions, etc.

Add a CSS theme

At this point the website does not look like much. To make the site look better, we need to add a CSS theme.

Visit http://bootswatch.com/ and pick a CSS theme.

Once you find a theme you like, download the bootstrap.css and rename it styles.css. Copy this file to your project/stylesheets directory.

Now shut down the site using (CTRL + C) and reload it once more using rake clean preview.

Ah…​.now that looks much better.

Save the state of the website using Git version control

Shut down the site once more using (CTRL + C) and perform a rake clean.

Perform a git add --all followed by a `git commit -m 'Fresh Awestruct build'.

For assistance using GIT, have a look at the tutorials found on GitHub.

Go Forth and Conquer!

You now have a functional Awestruct static website up and running in development mode. To learn how to use it, you may want to read up further about the various technologies used in Awestruct. You’ll be well advised to read up about using the Bootstrap CSS framework as well. And if you’re new to GIT, read about that too.

You can create your pages using pure HTML, or alternately you may wish to use a text based markup such as Markdown or Asciidoctor. If you have questions, visit the respective sites and Google, Google, Google until you find the answers.

Monday, February 29, 2016

Changing the storage location for virt-manager

As you probably know, libvirt defaults to storing all your virtual machines on the root file system using the directory /var/lib/libvirt/images. While that might not be a problem if you have a large primary drive, it's not always optimal. In my case, my primary drive is a small re-purposed laptop drive, so obviously that's just not going to work for me. My boot drive is just that, a boot drive.

So, without doing anything fancy like using symlinks to another storage volume, etc., here is a better way to go about changing this:


  1. As root, start virt-manager.
  2. Click Edit > Connection Details, and then click the Storage tab.
  3. The "Connection Details" dialog box opens.
  4. In the lower left hand corner of this new dialog box, click the green plus sign to add a pool.
  5. The "Add Storage Pool" dialog box opens.
  6. Specify a name for the pool (call it anything you want, it's just a label).
  7. For pool type select dir: Filesystem Directory and click the forward button.
  8. For the target path, browse to the directory you wish to use.
  9. After selecting your folder, click the finish button.
  10. Now you should have 2 storage pools (Default and the new one you just created).

Notes:

1) virt-manager will automatically create the pool directory if it does not already exist.
2) virt-manager requires the pool directory to be owned by root.
3) That's why I had you run virt-manager as root.
4) You don't normally need to run virt-manager as root (and probably shouldn't).
5) You can do all of this using virsh instead of virt-manager. Just look at the Redhat docs.


Now.....after having done all this one might expect being able use the new pool by selecting it during the creation of a new virtual machine. Well....that's not going to happen.

As it turns out, virt-manager does not behave as one might expect it would. Instead, there does not look to be any configurable way at all to ensure new virtual machines are automatically created using the new pool. Nor can the default pool itself be modified to use a new location (unless you symlink it or something).

In fact, even if you stop and remove the default pool, disk images still won't be created in the new pool. Instead they'll be created right smack in the middle of your own home directory. Not only that, after the next system reboot, the default pool comes right back, and virt-manager will once again automatically use it as the default pool (no questions asked). Pretty strange behavior if you ask me.

To use your new storage pool, you have to do something completely different and rather unexpected.

Prior to creating your virtual machine, manually create a storage volume in your new pool.
  1. Start virt-manager.
  2. Click Edit > Connection Details, and then click the Storage tab.
  3. In the left hand pane, select your new storage pool.
  4. In the lower right hand pane, click the New Volume button.
  5. The "New Storage Volume" dialog box appears.
  6. Type a name for the new image file and select the format type.
  7. Now specify the max volume size and the amount of disk space to be initially allocated.
  8. Click the Finish button when done.
Specify that volume when you create your new virtual machine.

It goes without saying if you fail to select the new volume during the creation of your virtual machine, the volume will instead automatically be created in the default pool.

Perhaps if you removed all pools and then created a new pool and gave it the name "default", then virt-manager might begin to use it as the default pool. I am only speculating as I have not yet tried it.

I am curious whether the odd behavior of the virt-manager GUI is inherent to KVM itself, or simply the result of poor interface design. At any rate, it's behavior is not always very intuitive.


Tip: I've noticed virt-manager likes to do everything as root and it even wants to take root ownership of your ISO files (another peculiarity of virt-manager).

When creating a new virtual machine, you can work around this issue by simply making a copy of your ISO file and dropping it into /tmp. Once the file is in /tmp who cares what virt-manager does to it as the entire /tmp directory is swept clean upon every reboot.

Hope that helps.


Michael

ZFS - coming to Ubuntu 16.04 LTS (Xenial Xerus)

Truth be told, ZFS is already here for Ubuntu (at least if you're running the 64 bit version, which you probably are). That's right, you can install it on a number of different releases as a PPA right now. This also means you can run ZFS on Linux Mint as well.

Just browse on over to the ZFS on Linux website and under 'packages' click the link for Ubuntu. That'll take you to Canonical's Native ZFS for Linux website. From there you can add the PPA.

Or you can simply do the following (I did this on Linux Mint 17.3 which is based on Ubutnu 14.04 LTS):

sudo add-apt-repository ppa:zfs-native/stable

followed by

sudo apt-get update

Now before you can install the ZFS related software, you'll first need some prerequisites (compilers, etc.), or you won't be able to build the kernel modules. We'll install those before anything else.

sudo apt-get install build-essentials

Now we can install the ZFS software.

sudo apt-get install spl-dkms zfs-dkms ubuntu-zfs zfsutils zfs-doc mountall

A word of warning here. There is a specific order to getting everything installed. The SPL module needs to be built before the ZFS module, so spl-dkms is listed first.

Once everything is installed, you need to load the kernel module using the modprobe command (or you can reboot the computer, but this isn't Windows, so you're under no obligation to do that).

sudo modprobe zfs

If you run into troubles getting things built - Look here:

http://askubuntu.com/questions/431879/error-when-installing-ubuntu-zfs

Also, don't do what I did and forget to install mountall. Otherwise your ZFS dataset mountings won't persist beyond your next reboot.


Here is my story.....

First I did an lsblk to see my block devices. This showed me /dev/sdb and /dev/sdc were the 2 drives I wanted to mirror. Then I created my pool as a RAID mirror using the following syntax:

zpool create <pool_name> mirror <device 1> <device 2> 

In my case this translated into this:

zpool create storage mirror /dev/sdb /dev/sdc

After creating my ZFS storage pool with 2 spare 500GB WD blue SATA drives as a nice little RAID 1 mirror, I then continued on by enabling LZ4 compression for the entire pool:

zfs set compression=lz4 storage

I followed that up by creating 2 ZFS datasets (one for ISO files and another for virtual machines).

zfs create storage/iso
zfs create storage/vm

I then checked my work with a zpool status and a zfs list and everything looked fine.

Next I transferred over about 80 GB of data from my laptop (I first tried to get samba working, but eventually gave up on it and simply copied everything over using scp).

It's probably worth mentioning a little snag I ran into while using scp. At first I got an access is denied, which makes sense. As I had done a sudo su prior to creating the pool and datasets, it was to be expected both datasets would end up owned by root. I resolved that by doing a chown on the dataset. After changing ownership, I was able to scp the data as a regular user without any further difficulties.

Later after my first reboot, I was like "Holy Crap", what just happened to my ZFS datasets? Nothing looks to be mounted!!!!

To make matters worse, zfs list showed everything just fine, including the 80 GB of data I has previously transferred over. But nothing was there except for the pool folder itself......and it was empty. Ugh!!!!!

By then it was midnight and having to get up early the next morning I decided to call it a night. 

The next day after Googling a bit, I found a ZFS command that showed me the problem: 

zfs get all

In all it's glory I saw every single ZFS property for all of my datasets including the one that mattered the most about then:  

mounted no 

So I Googled some more and discovered I had overlooked installing mountall. Long story short, don't forget that one, it's important. Oh and by the way, ZFS doesn't normally use /etc/vfstab (OpenIndiana) or /etc/fstab (Linux), so you won't typically find your mountings there.....although you could (if pressed) add some auto-mounting values to /etc/default/zfs.

That's it for now.....

Michael

What's in your toybox?

Thought I might do a little inventory of my current PC collection.....

At the moment I have 3 operational mid tower PC's and laptop (Thinkpad w500). I also have a hybrid mid tower running a SPARC motherboard (from a SunBlade 1500). I tossed the SPARC system together several years back when I was working daily with Solaris 8 at work. 

Given I have no use for the sparc box anymore, I'll likely be removing this motherboard and selling it on EBAY. I have a spare core2duo motherboard with (I think 8GB of memory) and an AMD HD 6000 series graphics card which I'll likely install into this system so it can be re-allocated as a home theater PC (perhaps running SteamOS or something similar).

As for the details of the operational stable:

My Lenovo Thinkpad W500 laptop is running Linux Mint 17.2 KDE. It has 8GB of memory, a 128GB primary SSD, and for expanded storage I swapped out the DVD drive for a hard drive caddy containing a 500GB WD Scorpio black. Thinking about pulling this drive and replacing it with a 250GB SSD or something similar. At least then the laptop would have no moving parts (sans the cooling fan). 

My primary workstation is a nice refurbished HP Z210 workstation running Windows 10. It has a server class motherboard , quad core XEON with hyperthreading, 8 GB of ECC memory, and an AMD R7 265 Graphics card. It's basically a poor man's i7 gamer box. The primary drive is a 128GB SSD and I have 2 old 150GB WD raptors running in a raid stripe. 

Ya I know there is no redundancy, and if I lose a single drive everything is gone, but this storage array is only storing downloaded game content. So, there is nothing on it which cannot be reproduced. When I configured the array, I chose speed over integrity. This is a very fast and nearly silent gaming rig. I also use it for occasional virtualization (Vmware player and virtualbox).

Next up is my Linux box. It's running an old Gigabyte EP45-UD3R motherboard with a slightly overclocked core 2 quad CPU, 12GB of memory, and an old Nvidia graphics card. To reduce energy usage, I will likely dial this box back to stock settings (It's overclocked because it used to be my gaming rig). The primary storage drive is a 7200 rpm 160GB laptop drive with Linux Mint 17.3 KDE installed. For additional storage I have added two 500GB WD blue drives, which are configured for storage integrity as a ZFS RAID mirror. This system (along with my laptop) will primarily be used for OpenIndiana (and illumos) systems documentation development (A.K.A content creation). I will also be using it as a virtualization system (VMware, Virtualbox, and KVM).  

Finally there is the system I have built up as my primary storage server. It's an old core 2 duo motherboard with only a couple of Gigs of memory. Primary storage is a 300 GB hard drive (which is overkill really...but what else am I going to do with it?). Secondary storage consists of 2 brand new 1TB WD RE 7200 rpm nearline SAS drives. The drives are running off an old LSI hardware RAID controller configured as a simple host bus adapter (IT mode I guess?). The sole purpose of the card is to support the operation of the SAS drives as data integrity will be the sole responsibility of ZFS.

This system will be running OpenIndiana Hipster with a text mode console (no GUI).  Hipster makes for a great home NAS system as ZFS is native to OpenIndiana (due to it's OpenSolaris roots). No it doesn't have ECC memory.....but I'm not going to let that stop me. 

That's it for now.....

Michael

Hello World

Hello World,

My name is Michael Kruger and I created this blog to chronicle my journey through the wonderful world of open source software. In particular I volunteered in late December of 2015 to help with writing systems documentation for the OpenIndiana project. 

OpenIndiana is derived from OpenSolaris and is essentially a fully community based continuation of the OpenSolaris project, which itself was the testbed (Think Fedora) for what later became Oracle Solaris 11.

OpenIndiana shares most of the technologies found in Oracle Solaris 11, but is completely open source as it uses the illumos kernel rather than Sun/Oracle's proprietary OS/Net consolidation. In a nutshell, illumos is OS/NET with all the proprietary bits removed and rewritten to be entirely open source.

And now for a little bit about me. While not a developer, I have done a dash of bash and sprinkle of powershell scripting here and there. I also have some modest technical writing experience, and some exposure to the software development process in general (and software configuration management in particular).

To round it all off, I have toyed around a little bit with version control systems (subversion), and in support of the OpenIndiana project, am now teaching myself how to use GIT, GitHub, etc., along with remembering everything I have forgotten about how to use VIM. Oh yes, there is also text markup. I am teaching myself how to write in Asciidoc (well actually the Ruby implementation of Asciiidoc, which is called Asciidoctor).

I also have roughly 15 years experience supporting Windows desktops and servers (mostly desktops). A couple of those years included working with Vmware Vsphere, Redhat Enterprise Linux, and even some UNIX (HP-UX and Solaris). 

Most of what I expect to do as a contributing member of the OpenIndiana project is help with writing tutorials, producing a nice polished (BSD like) OpenIndiana handbook, as well as assisting with the ground up development of an all new documentation toolchain (ideally something text markup based and completely automated by means of continuous integration).

The current OpenSolaris docs (books) were all written in Solbook (a subset of docbook) and have a rather nasty toolchain. My hope is to someday see all these books converted to Asciidoc (plain text markup) as docbook is a real bear to work with. 

Michael