This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DISM /online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$root = "\\VBOXSRV\" | |
$folders = "common", "vagrant" | |
$nCOM = New-Object -ComObject WScript.Shell | |
$folders | ForEach-Object { | |
$shortcut = $nCOM.CreateShortcut("$Home\Desktop\" + $_ + " (VBOXSRV).lnk") | |
$shortcut.TargetPath = $root + $_ | |
$shortcut.Save() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @source => http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/09/23/a-self-elevating-powershell-script.aspx | |
# Get the ID and security principal of the current user account | |
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID) | |
# Get the security principal for the Administrator role |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://blogs.technet.microsoft.com/heyscriptingguy/2012/10/28/powertip-use-powershell-to-enable-the-windows-firewall/ | |
# older Wins: netsh advfirewall set allprofiles state off | |
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$shell = $host.ui.RawUI | |
# Buffersize | |
$buffer = $shell.BufferSize | |
$buffer.width = 120 | |
$buffer.height = 2000 | |
$shell.BufferSize = $buffer | |
# WindowSize | |
$size = $shell.WindowSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Remove-LocalUserProfile { | |
<# | |
.SYNOPSIS | |
Removes a local user profile from the local or remote computer. | |
.DESCRIPTION | |
Removes a local user profile from the local or a remote computer by getting the Win32_UserProfile WMIObject, translating the SIDs to | |
usernames, and removing the profile if the result matches the specified username. | |
.PARAMETER ComputerName | |
Name of the computer you want to remove the user from. | |
.PARAMETER User |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_to_disk = './tmp/large_disk.vdi' | |
Vagrant::Config.run do |config| | |
config.vm.box = 'base' | |
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host1.vm.provider :vmware_fusion do |vmw| | |
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager' | |
dir = "#{ENV['PWD']}/.vagrant/additional-disks" | |
unless File.directory?( dir ) | |
Dir.mkdir dir | |
end | |
file_to_disk = "#{dir}/hd2.vmdk" | |
unless File.exists?( file_to_disk ) | |
`#{vdiskmanager} -c -s 10GB -a lsilogic -t 0 #{file_to_disk}` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PECLVER="0.1.1" | |
LIBSODIUMVER="1.0.2" | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference http://stackoverflow.com/a/18490935/2037928 | |
sudo apt-get update --fix-missing | |
# Install needed packages | |
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/ | |
wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz |
OlderNewer