~mapperr/vagrantfiles

e48e6a363cb9fa627cf191410a5b4d95452f4418 — mapperr 4 months ago 8256703
add macbox
A glustertest/Vagrantfile => glustertest/Vagrantfile +36 -0
@@ 0,0 1,36 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "debian/bookworm64"
  config.vm.box_check_update = false

  config.vm.network "private_network", type: "dhcp"

  (1..3).each do |i|
    config.vm.define "node#{i}" do |node|
      node.vm.provider "virtualbox" do |vb|
        vb.name = "gluster#{i}"
        vb.gui = false
        vb.cpus = 1
        vb.memory = "1024"
      end

      node.vm.provision "shell", inline: <<-SHELL
        # hostnamectl hostname node#{i}
        export DEBIAN_FRONTEND=noninteractive
        apt update
        apt install -y gnupg wget
        wget -O - https://download.gluster.org/pub/gluster/glusterfs/9/rsa.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/gluster.gpg
        DEBID=$(grep 'VERSION_ID=' /etc/os-release | cut -d '=' -f 2 | tr -d '"')
        DEBVER=$(grep 'VERSION=' /etc/os-release | grep -Eo '[a-z]+')
        DEBARCH=$(dpkg --print-architecture)
        echo "deb [signed-by=/etc/apt/trusted.gpg.d/gluster.gpg] https://download.gluster.org/pub/gluster/glusterfs/LATEST/Debian/${DEBID}/${DEBARCH}/apt ${DEBVER} main" > /etc/apt/sources.list.d/gluster.list
        apt update
        apt install -y glusterfs-server
      SHELL
    end
  end


end

A macbox/Vagrantfile => macbox/Vagrantfile +27 -0
@@ 0,0 1,27 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
    config.vm.box = "jhcook/macos-sierra"
    config.vm.box_version = "10.12.6"
    config.vm.synced_folder ".", "/vagrant", disabled: true

    config.vm.provider "virtualbox" do |v|
        v.check_guest_additions = false

        v.name = "macbox"
      
        # Display the VirtualBox GUI when booting the machine
        v.gui = true
    
        v.cpus = 2
    
        # Customize the amount of memory on the VM:
        v.memory = "4096"
        # v.memory = "3072"
        # v.memory = "2566"
        # v.memory = "2048"
        # v.memory = "1024"
    end
end


M wbdev/Vagrantfile => wbdev/Vagrantfile +131 -131
@@ 1,131 1,131 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  #config.vm.box = "mapperr/win10-pro"
  config.vm.box = "gusztavvargadr/windows-10"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  config.vm.box_check_update = false

  #config.vm.communicator = "winrm"

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # RDP
  #config.vm.network "forwarded_port", guest: 3389, host:3389, auto_correct: true 
  
  # misc
  for i in 7100..7110
    config.vm.network :forwarded_port, guest: i, host: i, auto_correct: true
  end

  # bridged network
  #config.vm.network "public_network", bridge: "wlp2s0"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  config.vm.provider "virtualbox" do |vb|
    vb.name = "wbdev"
  
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true

    vb.cpus = 2

    # Customize the amount of memory on the VM:
    # vb.memory = "4096"
    vb.memory = "3072"
    #vb.memory = "2566"
    # vb.memory = "2048"
    # vb.memory = "1024"

    # https://forums.virtualbox.org/viewtopic.php?t=76941
    # https://www.vagrantup.com/docs/virtualbox/configuration.html
    vb.default_nic_type  = "82540EM"

    vb.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
    vb.customize ["modifyvm", :id, "--vram", "256"]

    vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
    vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
    vb.customize ["modifyvm", :id, "--pae", "on"]

    vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
    vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"] # win only
    vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]

    vb.customize ["storageattach", :id,
        "--storagectl", "IDE Controller",
        "--port", "0",
        "--device", "0",
        "--nonrotational", "on"]

    vb.customize ["storageattach", :id,
        "--storagectl", "IDE Controller",
        "--port", "1",
        "--device", "0",
        "--type", "dvddrive",
        "--medium", "emptydrive"]

    vb.customize ["modifyvm", :id, "--audio", "none"]

    vb.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]

    vb.customize ["modifyvm", :id, "--usb", "on"]
    # vb.customize ["modifyvm", :id, "--usbehci", "on"] # usb2
    vb.customize ["modifyvm", :id, "--usbxhci", "on"] # usb3

    # --videocap options not present anymore in virtualbox 5.2.4
    #vb.customize ["modifyvm", :id, "--videocap", "off"]
    vb.customize ["modifyvm", :id, "--vrde", "off"]
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  config.vm.provision "file", source: "disable-windefender.ps1", destination: "C:\\Users\\vagrant\\Desktop\\disable-windefender.ps1"
  config.vm.provision "shell", path: "provision.ps1"
end
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  #config.vm.box = "mapperr/win10-pro"
  config.vm.box = "gusztavvargadr/windows-10"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  config.vm.box_check_update = false

  #config.vm.communicator = "winrm"

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # RDP
  #config.vm.network "forwarded_port", guest: 3389, host:3389, auto_correct: true 
  
  # misc
  for i in 7100..7110
    config.vm.network :forwarded_port, guest: i, host: i, auto_correct: true
  end

  # bridged network
  #config.vm.network "public_network", bridge: "wlp2s0"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  config.vm.provider "virtualbox" do |vb|
    vb.name = "wbdev"
  
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true

    vb.cpus = 2

    # Customize the amount of memory on the VM:
    # vb.memory = "4096"
    vb.memory = "3072"
    #vb.memory = "2566"
    # vb.memory = "2048"
    # vb.memory = "1024"

    # https://forums.virtualbox.org/viewtopic.php?t=76941
    # https://www.vagrantup.com/docs/virtualbox/configuration.html
    vb.default_nic_type  = "82540EM"

    vb.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
    vb.customize ["modifyvm", :id, "--vram", "256"]

    vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
    vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
    vb.customize ["modifyvm", :id, "--pae", "on"]

    vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
    vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"] # win only
    vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]

    vb.customize ["storageattach", :id,
        "--storagectl", "IDE Controller",
        "--port", "0",
        "--device", "0",
        "--nonrotational", "on"]

    vb.customize ["storageattach", :id,
        "--storagectl", "IDE Controller",
        "--port", "1",
        "--device", "0",
        "--type", "dvddrive",
        "--medium", "emptydrive"]

    vb.customize ["modifyvm", :id, "--audio", "none"]

    vb.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]

    vb.customize ["modifyvm", :id, "--usb", "on"]
    # vb.customize ["modifyvm", :id, "--usbehci", "on"] # usb2
    vb.customize ["modifyvm", :id, "--usbxhci", "on"] # usb3

    # --videocap options not present anymore in virtualbox 5.2.4
    #vb.customize ["modifyvm", :id, "--videocap", "off"]
    vb.customize ["modifyvm", :id, "--vrde", "off"]
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  config.vm.provision "file", source: "disable-windefender.ps1", destination: "C:\\Users\\vagrant\\Desktop\\disable-windefender.ps1"
  config.vm.provision "shell", path: "provision.ps1"
end

A win11box/Vagrantfile => win11box/Vagrantfile +131 -0
@@ 0,0 1,131 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  #config.vm.box = "mapperr/win10-pro"
  config.vm.box = "gusztavvargadr/windows-11"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  config.vm.box_check_update = false

  #config.vm.communicator = "winrm"

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # RDP
  #config.vm.network "forwarded_port", guest: 3389, host:3389, auto_correct: true 
  
  # misc
  for i in 7100..7110
    config.vm.network :forwarded_port, guest: i, host: i, auto_correct: true
  end

  # bridged network
  #config.vm.network "public_network", bridge: "wlp2s0"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  config.vm.provider "virtualbox" do |vb|
    vb.name = "win11box"
  
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true

    vb.cpus = 2

    # Customize the amount of memory on the VM:
    # vb.memory = "4096"
    vb.memory = "3072"
    #vb.memory = "2566"
    # vb.memory = "2048"
    # vb.memory = "1024"

    # https://forums.virtualbox.org/viewtopic.php?t=76941
    # https://www.vagrantup.com/docs/virtualbox/configuration.html
    vb.default_nic_type  = "82540EM"

    vb.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
    vb.customize ["modifyvm", :id, "--vram", "256"]

    vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
    vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
    vb.customize ["modifyvm", :id, "--pae", "on"]

    vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
    vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"] # win only
    vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]

    vb.customize ["storageattach", :id,
        "--storagectl", "IDE Controller",
        "--port", "0",
        "--device", "0",
        "--nonrotational", "on"]

    vb.customize ["storageattach", :id,
        "--storagectl", "IDE Controller",
        "--port", "1",
        "--device", "0",
        "--type", "dvddrive",
        "--medium", "emptydrive"]

    vb.customize ["modifyvm", :id, "--audio", "none"]

    vb.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]

    vb.customize ["modifyvm", :id, "--usb", "on"]
    # vb.customize ["modifyvm", :id, "--usbehci", "on"] # usb2
    vb.customize ["modifyvm", :id, "--usbxhci", "on"] # usb3

    # --videocap options not present anymore in virtualbox 5.2.4
    #vb.customize ["modifyvm", :id, "--videocap", "off"]
    vb.customize ["modifyvm", :id, "--vrde", "off"]
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  config.vm.provision "file", source: "disable-windefender.ps1", destination: "C:\\Users\\vagrant\\Desktop\\disable-windefender.ps1"
  config.vm.provision "shell", path: "provision.ps1"
end

A win11box/disable-windefender.ps1 => win11box/disable-windefender.ps1 +1 -0
@@ 0,0 1,1 @@
Set-MpPreference -DisableRealtimeMonitoring $true
\ No newline at end of file

A win11box/provision.ps1 => win11box/provision.ps1 +88 -0
@@ 0,0 1,88 @@
$autologon_username = "vagrant"
$autologon_password = "vagrant"
$new_computername = "wbdev"
$new_timezone = "Central European Standard Time"
$starting_port_range = 7100
$port_range_size = 10

if ((Get-Command "choco.exe" -ErrorAction SilentlyContinue) -eq $null) {
	Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}

if ((Get-Command "scoop" -ErrorAction SilentlyContinue) -eq $null) {
	Set-ExecutionPolicy Bypass -Scope Process -Force; iwr -useb get.scoop.sh | iex
}

scoop install gsudo
scoop install git
scoop bucket add extras
scoop install chromium
scoop install vcredist2015
scoop install neovim
choco uninstall -y chef-client

Rename-Computer -NewName $new_computername
set-timezone -Name $new_timezone
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
# enable rdp (see: https://theitbros.com/how-to-remotely-enable-remote-desktop-using-powershell/)
# Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
for ($i=0; $i -le $port_range_size; $i++) {
    $port = $starting_port_range + $i
    netsh http add urlacl url=http://*:$port/ user=everyone
}
Get-Service wsearch,diagtrack,dps,trkwks,MapsBroker,iphlpsvc,PcaSvc,Spooler,WerSvc,stisvc | Stop-Service -PassThru | Set-Service -StartupType disabled

# autologon
# http://www.sysadmins.eu/2014/12/set-up-auto-logon-in-windows-using.html
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoAdminLogon -Value 1 -ErrorAction SilentlyContinue | out-null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultUserName -Value $autologon_username -ErrorAction SilentlyContinue | out-null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultPassword -Value $autologon_password -ErrorAction SilentlyContinue | out-null


# DEVELOPMENT TOOLS

# fonts
choco install -y hackfont SourceCodePro

# optionals
choco install -y firefox vim vifm meld ngrok ConEmu netcat

# basic tools
choco install -y 7zip.install jetbrainstoolbox

# web dev
choco install -y nodejs
# choco install -y nginx --params '"/installLocation:C:\nginx /noService"'


# microsoft dev environment

# basic vs packages
choco install -y NuGet.CommandLine visualstudio2017buildtools visualstudio2017-workload-webbuildtools

# dotnetcore and aspnetcore
choco install -y visualstudio2017-workload-netcoretools

# iisexpress
choco install -y --ignore-checksum iisexpress

# sqlserver localdb and tools
choco install -y sqllocaldb sqlserver-cmdlineutils sql2017-dacframework

# azure tools
choco install -y azure-cli azcopy

# xamarin development
choco install -y visualstudio2017community visualstudio2017-workload-netcrossplat jdk8

cd "C:\Program Files (x86)\Android\android-sdk\tools\bin"
ECHO 'Y' | .\sdkmanager.bat --licenses
ECHO 'Y' | .\sdkmanager.bat "tools" "platform-tools"
ECHO 'Y' | .\sdkmanager.bat "platforms;android-25" "build-tools;27.0.3" "extras;android;m2repository" "extras;google;m2repository" "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"

$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newpath = $oldpath + ';C:\Program Files\Microsoft SQL Server\140\DAC\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin;C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy;C:\Program Files (x86)\Android\android-sdk\platform-tools'
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath

# restart machine
shutdown /t 0 /r

A win11box/win10-performance.md => win11box/win10-performance.md +11 -0
@@ 0,0 1,11 @@
https://medium.com/burak-tasci/tweaking-the-environment-to-speed-up-visual-studio-79cd1920fed9
https://www.askvg.com/master-tutorial-to-make-windows-10-super-fast/
https://www.askvg.com/beginners-guide-to-configure-windows-10-services/
https://blogs.technet.microsoft.com/heyscriptingguy/2012/08/27/three-cool-powershell-service-tricks/

# Manual settings

- Start --> Adjust the appearance and performance of windows --> Adjust for best performance
- Start --> Notification and action settings --> disable everything
- Start --> Choose a power plan --> select or create one with High Performance template
- Start --> Ease of access --> Display --> disable everything