Skip to content

Instantly share code, notes, and snippets.

View MattHodge's full-sized avatar

Matthew Hodgkins MattHodge

View GitHub Profile
@MattHodge
MattHodge / 00_Blog_Win10_Development_PC_Install.ps1
Last active December 29, 2020 22:57
00_Blog_Win10_Development_PC_Install.ps1
# Configure PowerShell Execution Policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
# Install Chocolatey
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
# Install the required apps
choco install git.install -y
choco install virtualbox -y
choco install vagrant -y
@MattHodge
MattHodge / 05_Blog_Win10_Development_PC_Chef_Berks.ps1
Last active February 2, 2016 03:07
05_Blog_Win10_Development_PC_Chef_Berks.ps1
# Create knife.rb config - more details here https://docs.chef.io/config_rb_knife.html
atom ~/.chef/knife.rb
# Create Berksfile config - more details here http://berkshelf.com/
atom ~/.berkshelf/config.json
# Verify you can communicate with the chef server
knife user list
@MattHodge
MattHodge / 04_Blog_Win10_Development_PC_Vagrant.ps1
Last active November 8, 2015 13:04
04_Blog_Win10_Development_PC_Vagrant.ps1
# Install vagrant plugins
vagrant plugin install 'vagrant-berkshelf'
vagrant plugin install 'vagrant-dsc'
vagrant plugin install 'vagrant-omnibus'
vagrant plugin install 'vagrant-reload'
vagrant plugin install 'vagrant-vbguest'
vagrant plugin install 'vagrant-vbox-snapshot'
vagrant plugin install 'vagrant-winrm'
vagrant plugin install 'winrm-fs'
@MattHodge
MattHodge / 03_Blog_Win10_Development_PC_Git.ps1
Last active August 1, 2016 10:55
03_Blog_Win10_Development_PC_Git.ps1
# Add Path Variable ssh-keygen path in the git folder - do this manually if you aren't using the function
Add-PathVariable -Path 'C:\Program Files\Git\usr\bin'
# Generate SSH Key - accept the defaults
ssh-keygen -t rsa -b 4096 -C "your@example.com" -P <SomePassPhrase>
# Add your key to the ssh-agent which will prevent you having to enter in the passphrase every time the key is used
ssh-add ~/.ssh/id_rsa
# Copy the contents of the key to the clipboard
@MattHodge
MattHodge / 02_Blog_Win10_Development_PC_Atom.ps1
Last active February 2, 2016 03:02
02_Blog_Win10_Development_PC_Atom.ps1
# Linter to validate the code as you are typing
apm install linter
# Install rubocop gem
gem install rubocop
# Linter for ruby
apm install linter-rubocop
# Rubocop auto corrector
@MattHodge
MattHodge / 01_Blog_Win10_Development_PC_PSProfile.ps1
Last active November 8, 2015 13:04
01_Blog_Win10_Development_PC_PSProfile.ps1
# Create a symlink to the profile in your shared drive
cmd /c mklink $PROFILE D:\DataHodge\Dropbox\PSProfile\Microsoft.PowerShell_profile.ps1
# Load the profile into the current session
. $PROFILE
@MattHodge
MattHodge / 07_Blog_PSStringFormating_HashTables_WebSite.ps1
Last active November 8, 2015 13:05
Description for 07_Blog_PSStringFormating_HashTables_WebSite.ps1
$webData = @{
name = 'Matt'
fontcolor = 'red'
type = 'beer'
price = '6.00'
age = 29
}
$htmlPage = "
@MattHodge
MattHodge / 06_Blog_PSStringFormating_HashTables_DoubleDoubleQuotes.ps1
Created August 16, 2015 11:51
Description for 06_Blog_PSStringFormating_HashTables_DoubleDoubleQuotes.ps1
# When our string contains double quotes
$myItem = @{
name = 'Matt'
age = 29
}
$myStringBackTicks = "The user `"$($myItem.name)`" is of age `"$($myItem.age)`""
$myStringDoubleQuotes = "The user ""$($myItem.name)"" is of age ""$($myItem.age)"""
Write-Output $myStringBackTicks
@MattHodge
MattHodge / 05_Blog_PSStringFormating_HashTables_SingleQuotes.ps1
Created August 16, 2015 11:51
Description for 05_Blog_PSStringFormating_HashTables_SingleQuotes.ps1
# When our string contains single quotes
$myItem = @{
name = 'Matt'
age = 29
}
$myString = "The user '$($myItem.name)' is of age '$($myItem.age)'"
Write-Output $myString
@MattHodge
MattHodge / 03_Blog_PSStringFormating_HashTables.ps1
Created August 16, 2015 11:51
Description for 03_Blog_PSStringFormating_HashTables.ps1
# Create a hash table for the item and use double quotes
$myItem = @{
type = 'Beer'
price = '$6.00'
}
$myString = "The price of a $myItem.type is $myItem.price"
Write-Output $myString