From c14d8f758636e8df2b02efdcce367f7f72cd7d49 Mon Sep 17 00:00:00 2001 From: Yosef Durr Date: Sun, 6 May 2018 11:35:16 -0700 Subject: [PATCH] merge readme and script updates from dev branch (#25) readme refinement, adding ml script --- ORGANIZATION.md | 25 ++++++++++++++++++++++++ README.md | 37 +++++++---------------------------- dev_ml_python.ps1 | 48 ++++++++++++++++++++++++++++++++++++++++++++++ dev_web.ps1 | 4 +--- dev_web_nodejs.ps1 | 7 +++++-- 5 files changed, 86 insertions(+), 35 deletions(-) create mode 100644 ORGANIZATION.md create mode 100644 dev_ml_python.ps1 diff --git a/ORGANIZATION.md b/ORGANIZATION.md new file mode 100644 index 0000000..b93cffb --- /dev/null +++ b/ORGANIZATION.md @@ -0,0 +1,25 @@ +## Using Chocolatey and Boxstarter in an organization +Does your organization have strong policies against using the internet? Are you deploying software in air-gapped networks? No problem, the Chocolatey client is [an offline solution that has zero call home](https://chocolatey.org/security#chocolatey-client), and the best part is you [can create packages and host them internally for free]((https://chocolatey.org/docs/how-to-setup-offline-installation)) (see [What is Chocolatey?](https://chocolatey.org/docs/getting-started#what-is-chocolatey) and [Set Up Chocolatey for Organizational/Internal Use](https://chocolatey.org/docs/how-to-setup-offline-installation)). Yes, you read that right, there's no charge for this! It is important to point out that Chocolatey itself installs with the [Community Package Repository](https://chocolatey.org/packages) already set as a default source repository to allow ease of installs for the greater community, but it is a simple adjustment to remove that and add your own internal sources. + +As an organization, you may not be keen to reach out to the internet. That's fine, with just a few modifications, you can still take advantage of these scripts: + +1. Ensure you have the Chocolatey nupkg itself on your internal package repository. This is done in the first few sections of the [organizational deployment guide](https://chocolatey.org/docs/how-to-setup-offline-installation). +1. You may need to also grab the [Boxstarter packages](https://chocolatey.org/packages?q=id%3Aboxstarter) and put them on your internal repository (on each package page in the left menu you will find a download link that will download the nupkg file). The packages may also need to be [internalized](https://chocolatey.org/docs/how-to-recompile-packages) before being put on your internal repository to remove any runtime internet access. +1. Review the script you want to use. Take note of the package names. You will need to either [internalize those packages](https://chocolatey.org/docs/how-to-recompile-packages) or create your own packages with embedded binaries or pointed to internal resources. +1. In the script prior to any calls to Chocolatey, you need to add the following code: + ~~~powershell + # Ensure the community repository is removed + choco source remove --name="'chocolatey'" + + # Sources - Add your internal repositories (add other options like auth/allow self service as needed - https://chocolatey.org/docs/commands-source): + choco source add --name="'internal_server'" --source="'http://somewhere.internal/chocolatey'" --priority="'1'" --bypass-proxy --user bob --password something + choco source add --name="'internal_file_share'" --source="'\\fileshare\chocolatey'" --priority="'2'" --bypass-proxy + #TODO: Add other sources here + ~~~ +1. Alternatively, you could add the following to the end of all of the package installation/upgrade calls: + ~~~powershell + --source="'location_name[; location_uri]'" + ~~~ +1. Unfortunately, you may not be able to take advantage of Boxstarter's one-click installer links that are available in the "How to run the scripts" section above. You can still use [an alternative means of running those scripts](http://www.boxstarter.org/InstallingPackages) that still works quite well! Please see the note below for additional addendums. + +**NOTE:** At this time, you may find that Boxstarter's one-click installer is hosted externally. It may use the community repository to get those [Boxstarter packages](https://chocolatey.org/packages?q=id%3Aboxstarter) deployed. You may need to set up the one-click installer or [use an alternative means of running your scripts](http://www.boxstarter.org/InstallingPackages) to ensure Boxstarter is using internal locations as well. We'll provide more details on how to do this later (and possibly fixes to Boxstarter itself to allow this)! diff --git a/README.md b/README.md index c259492..648b214 100644 --- a/README.md +++ b/README.md @@ -14,45 +14,23 @@ To run a setup script, click a link in the table below from your target machine. |Click link to run |Description | |---------|---------| |Desktop App | Windows Desktop App Development (Visual Studio, Windows SDK) | -|Web | Web (VS Code, Multiple Browsers) | +|Web | Web (VS Code, WSL, Multiple Browsers) | |Web NodeJS | Web Dev with NodeJS (Web + NodeJS LTS) | +|Machine Learning| Machine Learning (Python, WSL, VS Code) | | | Xamarin (Visual Studio, Xamarin, Android SDK) | -| | Machine Learning | -| | Containers (Kubernetes, etc...) | +| | Containers (Docker, Kubernetes, etc...) | | | More Coming Soon! | ## Working with Chocolatey in an organization? -Does your organization have strong policies against using the internet? Are you deploying software in air-gapped networks? No problem, Chocolatey is [an offline solution that has zero call home](https://chocolatey.org/security#chocolatey-client), and the best part is you [can create packages and host them internally for free]((https://chocolatey.org/docs/how-to-setup-offline-installation)) (see [What is Chocolatey?](https://chocolatey.org/docs/getting-started#what-is-chocolatey) and [Set Up Chocolatey for Organizational/Internal Use](https://chocolatey.org/docs/how-to-setup-offline-installation)). Yes, you read that right, you can take advantage of Chocolatey's infrastructure without any cost! It is important to point out that Chocolatey itself installs with the [Community Package Repository](https://chocolatey.org/packages) already set as a default source repository to allow ease of installs for the greater community, but it is a simple adjustment to remove that and add your own internal sources. - -As an organization, you are not likely keen to reach out to the internet. That's fine, with just a few modifications, you can still take advantage of these scripts: - -1. Ensure you have the Chocolatey nupkg itself on your internal package repository. This is done in the first few sections of the [organizational deployment guide](https://chocolatey.org/docs/how-to-setup-offline-installation). -1. You may need to also grab the [Boxstarter packages](https://chocolatey.org/packages?q=id%3Aboxstarter) and put them on your internal repository (on each package page in the left menu you will find a download link that will download the nupkg file). The packages may also need to be [internalized](https://chocolatey.org/docs/how-to-recompile-packages) before being put on your internal repository to remove any runtime internet access. -1. Review the script you want to use. Take note of the package names. You will need to either [internalize those packages](https://chocolatey.org/docs/how-to-recompile-packages) or create your own packages with embedded binaries or pointed to internal resources. -1. In the script prior to any calls to Chocolatey, you need to add the following code: - ~~~powershell - # Ensure the community repository is removed - choco source remove --name="'chocolatey'" - - # Sources - Add your internal repositories (add other options like auth/allow self service as needed - https://chocolatey.org/docs/commands-source): - choco source add --name="'internal_server'" --source="'http://somewhere.internal/chocolatey'" --priority="'1'" --bypass-proxy --user bob --password something - choco source add --name="'internal_file_share'" --source="'\\fileshare\chocolatey'" --priority="'2'" --bypass-proxy - #TODO: Add other sources here - ~~~ -1. Alternatively, you could add the following to the end of all of the package installation/upgrade calls: - ~~~powershell - --source="'location_name[; location_uri]'" - ~~~ -1. Unfortunately, you may not be able to take advantage of Boxstarter's one-click installer links that are available in the "How to run the scripts" section above. You can still use [an alternative means of running those scripts](http://www.boxstarter.org/InstallingPackages) that still works quite well! Please see the note below for additional addendums. - -**NOTE:** At this time, you may find that Boxstarter's one-click installer is hosted externally. It may use the community repository to get those [Boxstarter packages](https://chocolatey.org/packages?q=id%3Aboxstarter) deployed. You may need to set up the one-click installer or [use an alternative means of running your scripts](http://www.boxstarter.org/InstallingPackages) to ensure Boxstarter is using internal locations as well. We'll provide more details on how to do this later (and possibly fixes to Boxstarter itself to allow this)! +As an organization, you may not be keen to reach out to the internet. That's fine as with just a few modifications you can still take advantage of these scripts. Visit the [organizational use page](ORGANIZATION.md) to learn how. ## No administrative access? Are you in an environment where you don't have any administrative access on your machine? No problem, you can still take advantage of Chocolatey and manage "portable" software. You can also use a VM where you may have administrative access (see next section). -For alternative means of deploying "portable" software and installing Chocolatey without administrative access, please see [Non-Administrative Install](https://chocolatey.org/install#non-administrative-install). Unfortunately you won't be able to take advantage of Boxstarter, but you will find resources and an example script that gives you a quick setup of Chocolatey and installation of a few packages. +For alternative means of deploying "portable" software and installing Chocolatey without administrative access, please see Chocolatey's documentation on [Non-Administrative Install](https://chocolatey.org/install#non-administrative-install). Unfortunately you won't be able to take advantage of Boxstarter, but you will find resources and an example script that gives you a quick setup of Chocolatey and installation of a few packages. -**NOTE:** It's really important to point out that Chocolatey is not going to magically allow you to install software that requires administrative access to install (at least not with the open source edition), so you will need to find packages that are portable or create those and push them to the community repository or your internal sources. +**NOTE:** +It's important to point out the open source edition of the Chocolatey client will not allow you to magically install software that requires administrative access, so you will need to find packages that are portable or create those and push them to the community repository or your internal sources. ## Setting up a VM Windows 10 VM setup instructions @@ -66,7 +44,6 @@ Please read before using scripts. When you use our sample scripts, these will direct to Chocolately to install the packages. By using Chocolatey to install a package, you are accepting the license for the application, executable(s), or other artifacts delivered to your machine as a result of a Chocolatey install. This acceptance occurs whether you know the license terms or not. Read and understand the license terms of any package you plan to install prior to installation through Chocolatey. If you do not want to accept the license of a package you are installing, you need to uninstall the package and any artifacts that end up on your machine as a result of the install. - #### Our samples are provided AS-IS without any warranties of any kind Chocolately has implemented security safeguards in their process to help protect the community from malicious or pirated software, but any use of our scripts is at your own risk. Please read the Chocolately's legal terms of use and the Boxstarter project license as well as how the community repository for Chocolatey.org is maintained. diff --git a/dev_ml_python.ps1 b/dev_ml_python.ps1 new file mode 100644 index 0000000..799b77e --- /dev/null +++ b/dev_ml_python.ps1 @@ -0,0 +1,48 @@ +# Description: Boxstarter Script +# Author: Microsoft +# Common dev settings for web development + +Disable-UAC + +#--- Windows Features --- +Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions + +#--- File Explorer Settings --- +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1 +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1 +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1 +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2 + +#--- Git --- +choco install -y git -params '"/GitAndUnixToolsOnPath /WindowsTerminal"' +choco install -y Git-Credential-Manager-for-Windows + +#--- Windows Subsystems/Features --- +choco install -y Microsoft-Hyper-V-All -source windowsFeatures +choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures + +#--- Ubuntu --- +Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing +Add-AppxPackage -Path ~/Ubuntu.appx + +#--- Fonts --- +choco install -y inconsolata +# choco install -y ubuntu.font + +#--- Tools --- +choco install -y docker-for-windows +choco install -y python +choco install -y pip +choco install -y 7zip.install + +# TODO: install additional ML tools + +#--- VS Code --- +choco install -y visualstudiocode + +#--- VS Code extensions --- +choco install -y vscode-docker + +Enable-UAC +Enable-MicrosoftUpdate +Install-WindowsUpdate -acceptEula diff --git a/dev_web.ps1 b/dev_web.ps1 index 7da50c7..8b3bbea 100644 --- a/dev_web.ps1 +++ b/dev_web.ps1 @@ -28,7 +28,6 @@ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-L #--- Ubuntu --- Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing Add-AppxPackage -Path ~/Ubuntu.appx -Ubuntu.exe <# #--- SLES --- @@ -51,14 +50,13 @@ choco install -y firefox #--- Fonts --- choco install -y inconsolata -choco install -y ubuntu.font +# choco install -y ubuntu.font #--- Tools --- choco install -y sysinternals choco install -y docker-for-windows choco install -y python choco install -y pip -choco install -y easy.install Enable-UAC Enable-MicrosoftUpdate diff --git a/dev_web_nodejs.ps1 b/dev_web_nodejs.ps1 index dc8d969..9a156a1 100644 --- a/dev_web_nodejs.ps1 +++ b/dev_web_nodejs.ps1 @@ -23,13 +23,17 @@ choco install -y 7zip.install choco install -y Microsoft-Hyper-V-All -source windowsFeatures choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures +#--- Ubuntu --- +Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing +Add-AppxPackage -Path ~/Ubuntu.appx + #--- Browsers --- choco install -y Firefox choco install -y Googlechrome #--- Fonts --- choco install -y inconsolata -choco install -y ubuntu.font +# choco install -y ubuntu.font #--- Tools --- choco install -y nodejs-lts # Node.js LTS, Recommended for most users @@ -40,7 +44,6 @@ choco install -y sysinternals choco install -y docker-for-windows choco install -y python2 # Node.js requires Python 2 to build native modules choco install -y pip -choco install -y easy.install Enable-UAC Enable-MicrosoftUpdate