Skip to content

Instantly share code, notes, and snippets.

View ramarnat's full-sized avatar

Rohit Amarnath ramarnat

View GitHub Profile
list_% : ; @echo $* = $($*)
@ramarnat
ramarnat / get-pending-reboots.ps1
Last active December 2, 2015 15:44
get-pending-reboots.ps1
# From https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542
Function Get-PendingReboot
{
<#
.SYNOPSIS
Gets the pending reboot status on a local or remote computer.
.DESCRIPTION
This function will query the registry on a local or remote computer and determine if the
system is pending a reboot, from Microsoft updates, Configuration Manager Client SDK, Pending Computer
Set-StrictMode -Version Latest
Set-ExecutionPolicy Unrestricted
$log = 'c:\boxstarter-boostrap.txt'
Try
{
. C:\Users\Administrator\AppData\Roaming\Boxstarter\BoxstarterShell.ps1
Get-Module -ListAvailable | Add-Content $log
@ramarnat
ramarnat / gist:c4b2fed5a5a4c346942d
Last active August 29, 2015 14:23
test_reboot.ps1
shutdown /r /t 1 /c "testing boxstarter reboot"
if (Test-PendingReboot) {
Write-BoxstarterMessage "System Shutdown not in progress" -Verbose
}
else {
Write-BoxstarterMessage "System Shutdown in progress" -Verbose
}
require 'spec_helper'
# module Full360
describe 'lib_epm::deploy' do
before do
allow_any_instance_of(Full360::Configurator).to receive(:stage_task_running?).and_return(false)
end
cached(:runner) {ChefSpec::SoloRunner.new(step_into: ['lib_epm_silent_xml_file', 'lib_epm_configurator'])}

Keybase proof

I hereby claim:

  • I am ramarnat on github.
  • I am ramarnat (https://keybase.io/ramarnat) on keybase.
  • I have a public key whose fingerprint is 5599 E00E B825 301A 925A AAA7 676A 442E F129 DCF2

To claim this, I am signing this object:

require 'grape'
require 'rspec'
require 'rack/test'
module Example
module TransactionTestHelper
include Rack::Test::Methods
def app
Example::Root
$ cat /bin/sudo
#!/bin/bash
while getopts ":a:" opt; do
case $opt in
\?)
shift
;;
esac
done
shift $((OPTIND-1))
# Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM
# AND install 7-zip, curl and .NET 4 if its missing.
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2008 SP2 64bits AMIs provided by Amazon
#
# Inject this as user-data of a Windows 2008 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# $log = 'c:\bootstrap_output.txt'
vagrant@precise64:~$ docker build -t ramarnat/centos_upstart .
Uploading context 13742080 bytes
Step 1 : FROM centos:6.4
---> 539c0211cd76
Step 2 : RUN yum -y install upstart
---> Running in d3bc8dbef6c2
Loaded plugins: fastestmirror
Setting up Install Process
Resolving Dependencies
--> Running transaction check