Skip to content

Instantly share code, notes, and snippets.

View ferventcoder's full-sized avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
case $operatingsystem {
'windows': {
Package {
provider => chocolatey,
}
}
}
include chocolatey
include chocolatey_server
@ferventcoder
ferventcoder / chocolateyInstall.ps1
Last active September 11, 2015 07:15
MSI package
$ErrorActionPreference = 'Stop';
$packageArgs = @{
packageName = '[[PackageName]]'
unzipLocation = $toolsDir
fileType = 'MSI'
url = '[[Url]]'
url64bit = '[[Url64]]' # 64bit URL here or remove - if installer is both, use $url
silentArgs = "/qn /norestart"
validExitCodes= @(0, 3010, 1641)
@ferventcoder
ferventcoder / rubyinstall.sh
Last active September 6, 2015 15:36
Installing the Rubies
# This script is geared towards cmd.exe.
# If you are using powershell, look for the hints
# about alternative commands in comments
# Note there is no alternative for refreshenv
# Pik also may not work in PowerShell at all.
# It certainly doesn't to update paths
SET ORIG_PATH=%PATH%
#$ORIG_PATH=$env:PATH
@ferventcoder
ferventcoder / PackageVerificationSetupandSteps.md
Last active August 29, 2015 14:27
Package Verifier test steps

Requirements

  • Virtualbox installed
  • Vagrant installed
  • Vagrant sahara plugin installed
  • Vagrant box win2012r2x64 available

Box Prep

  • Copy PrepareMachine.ps1 to VagrantAction.ps1
  • Run vagrant up
@ferventcoder
ferventcoder / .gitconfig
Last active April 4, 2018 00:44
Cloud boxes setup
[user]
name = Chocolatey
email = chocolatey@realdimensions.net
[core]
autocrlf = false
editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor
filemode = false
excludesfiles = C:/Users/rob/.gitignore
symlinks = false
[diff]
@ferventcoder
ferventcoder / force_utf8.rb
Last active August 29, 2015 14:23
I was attempting to enforce UTF-8, this only contains a few encodings but could do more
def fix_encodings(files)
files.each do |file|
next if File.directory?(file)
[Encoding::UTF_8, Encoding::UTF_16LE, Encoding::UTF_16, Encoding::ISO_8859_1, Encoding::US_ASCII, Encoding::default_external].each do |encoding|
contents = File.read(file, :mode =>'rb', :encoding => encoding)
next unless contents.valid_encoding?
break if contents.valid_encoding? && encoding == Encoding::UTF_8
if contents.valid_encoding?
@ferventcoder
ferventcoder / chocolateyUninstall.ps1
Last active August 29, 2015 14:22
New Chocolatey Uninstall Template
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one
# stop on all errors
$ErrorActionPreference = 'Stop';
# REMOVE ANYTHING BELOW THAT IS NOT NEEDED
# Auto Uninstaller should be able to detect and handle registry uninstalls (if it is turned on, it is in preview for 0.9.9).
$packageName = '{{PackageName}}'
# registry uninstaller key name is the key that is found at HKLM:\Software\Windows\CurrentVersion\Uninstall\ THE NAME
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one
# REMOVE ANYTHING BELOW THAT IS NOT NEEDED
$ErrorActionPreference = 'Stop'; # stop on all errors
$packageName= '[[PackageName]]' # arbitrary name for the package, used in messages
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = '[[Url]]' # download url
$url64 = '[[Url64]]' # 64bit URL here or remove - if installer is both, use $url
$packageArgs = @{
packageName = $packageName
@ferventcoder
ferventcoder / Windows Just Got Chocolatey (Package Management).md
Created May 8, 2015 21:34
Windows Just Got Chocolatey (Package Management) Abstract

Other platforms have long enjoyed package management, a concept that was mostly foreign to Windows. There have been a few attempts at it, but the only one that has had a large amount of success is Chocolatey. Chocolatey took a different approach that has allowed it to build on top of an existing Windows ecosystem. Learn about the simplicity and sensible design of Chocolatey, how it has started to serve the role of package management for Windows, and where we are taking it in the future.

Kids love it. Microsoft Approved! Chocolatey does some cool things that will save you time and money for your organization and make you look uber smart for using it. Come learn more!

@ferventcoder
ferventcoder / 1.scheduled_tasks.pp
Last active August 29, 2015 14:17
Scheduled_task - Repeat triggers
scheduled_task { 'Notepad_normal':
ensure => 'present',
enabled => 'true',
command => 'C:\Windows\notepad.exe',
trigger => { 'every' => '1', 'schedule' => 'daily', 'start_time' => '15:10' },
user => 'system',
}
scheduled_task { 'Notepad_with_startdate':
ensure => 'present',