Skip to content

Instantly share code, notes, and snippets.

@lonniev
lonniev / debug.log
Created August 13, 2014 16:06
Debug.log output for the vagrant-azure plugin team
INFO global: Vagrant version: 1.6.3
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_NO_PLUGINS="1"
@lonniev
lonniev / Vagrantfile_for_vagrant_issues_4974
Created December 15, 2014 04:59
A Vagrantfile attempting to set up 3 VMs for development, test, and deploy of a distributed app
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :machine
@lonniev
lonniev / gist:92a6395cd13b5a4ad32c
Created December 15, 2014 05:09
Ginormorous Gist Dump for Vagrant Chef Windows Roles issue
This file has been truncated, but you can view the full file.
INFO global: Vagrant version: 1.6.5
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant"
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
@lonniev
lonniev / pom-snippet.xml
Last active August 29, 2015 14:13
maven-upload-plugin for Eclipse Typo p2 Update Site (zipped)
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-upload-plugin</artifactId>
<executions>
<execution>
<id>upload-p2-update-site</id>
<phase>deploy</phase>
<goals>
<goal>upload</goal>
</goals>
@lonniev
lonniev / vagrantize-softlayer.ps1
Last active May 12, 2017 14:53
(Tries to) Add Vagrant interfaces to the Softlayer Windows instance
$RunningAsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if ($RunningAsAdmin)
{
$code = {
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
Write-Output "Chocolatey apparently installed."
Write-Output "Creating Vagrant User"
@lonniev
lonniev / post_install.bat
Last active August 29, 2015 14:19
Wrapper cmd.exe DOS Batch script to run the Vagrant post_install Powershell script
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/lonniev/350a444c626119c31208/raw/09b5513e9777b144137cfbf0bf6af2c9a3e7fc5b/vagrantize-softlayer.ps1'))"
@lonniev
lonniev / serialize_hash_to_dotted_properties.rb
Last active August 29, 2015 14:23
Given a nested hash, serialize that to an array of property key=value pairs where each key is the dotted form of all the hash keys to reach the value
def serialize( h )
h.collect{ |k,v|
unless v.kind_of? Hash
"#{k}=#{v}"
else
@lonniev
lonniev / hashify_nested_to_properties_list.rb
Created June 29, 2015 18:57
Given a nested hash, pretty print a list of corresponding dotted property = value lines
require 'JSON'
require 'pp'
def hashList( list, value )
head, *tail = list
head.sub!( /\[(.+)\]/, '\1' )
case tail
@lonniev
lonniev / Vagrantfile
Created August 10, 2015 03:39
Vagrantfile for Vagrant 1.74 that exhibits Chef-solo rsych problems
Vagrant.require_version ">= 1.7.4"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.boot_timeout = 600
config.omnibus.chef_version = :latest
config.vm.guest = :windows
config.windows.set_work_network = true
config.vm.synced_folder ".", "/vagrant", type: "rsync"
config.vagrant.host = :detect
config.vm.define "sl-win-obeo" do | cci |
@lonniev
lonniev / elevated_shell.ps1.erb
Created September 25, 2016 00:11
An Alternative construction of the TaskDefinition for Vagrant's 1.8.5 winrm communicator
param([String]$username, [String]$password, [String]$encoded_command, [String]$execution_time_limit)
# Try to get the Schedule.Service object. If it fails, we are probably
# on an older version of Windows. On old versions, we can just execute
# directly since priv. escalation isn't a thing.
$schedule = $null
Try {
$schedule = New-Object -ComObject "Schedule.Service"
} Catch [System.Management.Automation.PSArgumentException] {
powershell.exe -EncodedCommand $encoded_command