Skip to content

Instantly share code, notes, and snippets.

View user-data-2.xml
Write-Host "This script is running in PowerShell `n"
Write-Host "The current PowerShell version is `n $PSVersionTable.PSVersion `n"
pwd > c:\test.log
dir >> c:\test.log
View user-data-1.xml
pwd > c:\test.log
dir >> c:\test.log
b-long / unattend.xml
Created Feb 14, 2017
CloudForms Sysprep example - Windows Server 2008 R2
View unattend.xml
# Setting Variables
debug = false
locale = "en-US"
registered_organization = "My Company"
registered_owner = "My Company"
# Change values if blank
evm[:hostname] = evm[:vm_target_hostname] if evm[:hostname].blank? # Use vm_target_hostname if hostname in the dialog was blank
b-long / experiment-5.yml
Created Feb 10, 2017
Experimental cloud-init file
View experiment-5.yml
# Based on
# MiqProvisionAmazon_Web.yaml
# CloudForms - Cloud-Init Script for Apache Installation on EC2
# For troubleshooting check: /var/lib/cloud/instance/user-data.txt & /var/log/boot.log
<% # Set Global Variables
role = evm[:role]
role ||= evm[:ws_values][:role] rescue 'web'
instance_name = evm[:vm_target_name]
b-long / RCurl to curl
Last active Nov 5, 2015
Result should be the same from both implementations
View RCurl to curl

Original code

url <- c("","")
result <- lapply(url, function(f) {
          # TODO: Consider if we want this in the new function
          # message(basename(f))
          h <- RCurl::basicTextGatherer()
          ok <- RCurl::curlPerform(url=f,
                            nobody=TRUE, headerfunction=h$update)
          yy <- h$value()
b-long /
Created Oct 15, 2015 — forked from jimhester/
Bash function to detect if an R command uses an external connection of anykind. Designed to be used with R CMD check
# Bash function to detect if an R command uses an external connection of
# any kind. Designed to be used with R CMD check
function has_external_connection {
DIR=$(mktemp -d)
# Use a local repository so we don't have to make an external connection for
# `available.packages()`
mkdir -p $DIR/src/contrib
b-long /
Created Oct 8, 2015
Quick note on installing the Oracle Java 1.8 JDK in Ubuntu

Certainly not the first person to write this, but figured I'd write it down in my own gist.

To install the Oracle JDK 8 (1.8), do the following:

sudo add-apt-repository ppa:webupd8team/java
# You can't skip this step
sudo apt-get update
sudo apt-get install oracle-java8-installer
You can’t perform that action at this time.