Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Latest commit

 

History

History
98 lines (77 loc) · 6.42 KB

README.md

File metadata and controls

98 lines (77 loc) · 6.42 KB

Windows .dotfiles

These are my configuration files and setup scripts for new Windows computers. If using Windows, I use Windows 10 with the Ubuntu Windows Linux Subsystem. In most cases these dotfiles will work on similar systems. Fork if you wish but keep in mind that a lot of these settings are personalized to me (so you will most likely want to change them before using the scripts). Review the code, and remove things you don't want or need. Do not blindly use these settings.

Inspired by: https://dotfiles.github.io/ and https://github.com/jayharris/dotfiles-windows

Table of Contents


Setup a Windows 10 computer

  1. Install Windows
  2. Install and configure all additional hardware-specific Windows drivers (usually found on your backup drive or in the cloud)
  3. Install Dropbox manually
  4. Install GitBash manually
  5. Open a PowerShell as an administrator and set your ExecutionPolicy: Set-ExecutionPolicy RemoteSigned
  6. Allow .NET packages to be installed via NuGet: Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
  7. Install Chocolatey from a privileged PowerShell: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  8. Close PowerShell
  9. Install C++ 2015 manually (this is a VS Code dependency)
  10. Install VS Code manually
    1. Install Settings Sync for VS Code
    2. Get Gist Token from secret hiding place
    3. Type sync in the Command Palette in VS Code and copy/paste your GitHub token and Gist ID
    4. Wait for all your extensions and themes to sync up and then close VS Code (your text editor is ready to roll!)
  11. Using GitBash, clone this repo into your home folder: cd ~ && git clone git@github.com:jonathanbell/.dotfiles-windows.git .dotfiles && cd ~/.dotfiles Important: (note that we clone .dotfiles-windows to the .dotfiles directory)
  12. Install Ubuntu on Windows 10 from the Windows App Store
  13. Set your Ubuntu/Linux home directory to be the same as your Windows home folder
  14. Install Photoshop manually
  15. Install Lightroom manually
  16. Install Premier manually
  17. Install MovesLink manually
  18. Uninstall unwanted apps by right-clicking them in the Start Menu
  19. Copy (or symlink) SSH config file from your secret hiding place to ~/.ssh or setup new ones.
    1. From the Linux command line ln -s /path/to/secret/hiding/place ~/.ssh
  20. Optional: You may need to setup permissions for SSH keys to work correctly on the Linux/Windows Subsystem. Edit /etc/wsl.conf (add it if it does not exist) using the following code block and then change the permissions of the private key directory to 700 and all the keys inside the directory to 600.

Run the new-computer.ps1 script

  1. Open PowerShell as an admin
  2. Change directory your .dotfiles directory: cd $HOME\.dotfiles
  3. Then execute the new-computer.ps1 script in order to install and configure all the Windows things: .\new-computer.ps1

Run the new-computer.bash script

The following instructions are meant to be run inside the Windows Subsystem for Linux command line. Open that command prompt and run:

  1. cd ~/.dotfiles && chmod +x new-computer.bash
  2. ./new-computer.bash

Optional: Extra stuff

Cloudinary

  1. Copy your Cloudinary config file from your secret hiding place to ~/.cloudinary

You can now upload images to Cloudinary with cloudinary upload foo.png

Apache

  1. Enable/give priority to .php files: sudo nano /etc/apache2/mods-enabled/dir.conf and move index.php to the front of the list.
  2. Open ports.conf: cd /ect/apache2 && sudo nano ports.conf and make these changes:
    1. Change the default port (80) to 8080
  3. Open apache2.conf: sudo nano apache2.conf and make the following changes:
    1. Add AcceptFilter http none and AcceptFilter https none to the end of the file.
    2. Change <Directory /var/www/> to <Directory /mnt/c/Users/path/to/your/sites>
    3. Also ensure that AllowOverride is set to All (in order to allow .htaccess files to do their thing)
  4. For each locally hosted website that you have, add a <VirtualHost> entry to 000-default.conf: cd sites-enabled && sudo nano 000-default.conf.
    1. For each site, copy+paste the block below and edit it to suit your needs:
    <VirtualHost *:443>
       DocumentRoot "/mnt/c/Users/<your username>/path/to/site"
       ServerName dev.localhost.com # change to whatever you like
       SSLEngine on
       SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem"
       SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key"
       ErrorLog "/mnt/c/Users/<your username>/path/to/error/logs/dev.localhost.com.errors"
       CustomLog "/mnt/c/Users/<your username>/path/to/custom/logs/dev.localhost.com.log" common
    </VirtualHost>
  5. Edit the hosts file on the Windows side of things. The file will be located in C:\Windows\System32\Drivers\etc\.
    1. Add your local domain like so: 127.0.0.1 dev.localhost.com
  6. Ensure that mod_rewrite and mod_expires are enabled: sudo cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load && sudo cp /etc/apache2/mods-available/expires.load /etc/apache2/mods-enabled/expires.load
  7. Finally, ensure permissions are correct on the directory where you keep your website code: sudo chmod 775 -R /mnt/c/Users/<your username>/path/to/websites/