Skip to content

Instantly share code, notes, and snippets.

@patik
Last active October 17, 2017 06:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patik/6d6319790fb4c3cd9fbe to your computer and use it in GitHub Desktop.
Save patik/6d6319790fb4c3cd9fbe to your computer and use it in GitHub Desktop.
Proxy config for Git and Node at DTF

Download and install these first:

  • NodeJS
  • Git for Windows
    • During installation, on the options screen with the check boxes about what to install, check the box for TrueType fonts
    • On the screen with three radio button options about the shell and Windows Command Prompt, choose the second option
    • Go with the default options for the rest of the installation
  • SourceTree
    • This is similar to GitHub's app, but more powerful and flexible

Then open the Git Bash shell (Start > Git > Git Bash) and continue with the next file below.

# Copy and paste these into the Bash shell. Use shift-insert to paste.
# Configure Git
git config --global http.proxy http://gateway.zscaler.net:80/
git config --system http.proxy http://gateway.zscaler.net:80/
git config --global http.sslVerify false
git config --system http.sslVerify false
git config --global --unset http.sslcainfo
git config --system --unset http.sslcainfo
git config --global push.default matching
git config --system push.default matching
git config --global branch.autosetuprebase always
git config --system branch.autosetuprebase always
git config --global core.autocrlf true
git config --system core.autocrlf true
# Create local folder for Node since our roaming profiles screw things up
mkdir /c/apps
# This is where global modules will be installed:
mkdir /c/apps/npmglobal
# This is the folder Node will use as its cache when it downloads packages to install:
mkdir /c/apps/npmcache
# Configure Node to use those local directories
npm config set cache /c/apps/npmcache --global
npm config set prefix /c/apps/npmglobal --global
# Configure Node/NPM for the proxy
npm config set proxy http://gateway.zscaler.net:80/ --global
npm config set strict-ssl false --global
npm config set registry http://registry.npmjs.org/ --global
# Setup Bash profile and `PATH`
touch ~/.bash_profile
touch ~/.bashrc
echo "export PATH=/c/apps/npm-global:\$PATH" >> ~/.bash_profile
echo "export PATH=/c/apps/npm-global:\$PATH" >> ~/.bashrc
source ~/.bash_profile
source ~/.bashrc
export PATH=/c/apps/npm-global:$PATH
# Install global Node modules
npm install -g grunt-cli jshint
# Done!
# !!! Edit these commands before executing them !!!
# Put your own name and email here
# These will appear next to your commits, so use your real name
git config --system user.name First Last
git config --global user.name First Last
git config --system user.email yourname@its.ny.gov
git config --global user.email yourname@its.ny.gov

These items are optional.

Text editor

Install a good text editor like Sublime Text (paid) or Atom (free).

Then you will probably want to install some add-ons for your editor to help with code linting, enforcing code styles, etc.

Sublime Text setup

  • Install Package Control
  • Recommended packages for web developers (press cmd-shift-p or ctrl-shift-p in Sublime, type "install package", then type the name of the package)

Atom

  • Configure proxy
    • Open settings (cmd-comma or ctrl-comma, or File > Settings)
    • Go to the last item, Open Config Folder. Then in the sidebar open the .apm foler and then the file .apmrc. Add these lines, replacing USERNAME and PASSWORD with your Windows login credentials:
      • proxy=http://gateway.zscaler.net:80/
      • http-proxy = USERNAME:PASSWORD@http://gateway.zscaler.net:80/
      • https-proxy = USERNAME:PASSWORD@http://gateway.zscaler.net:80/
      • strict-ssl = false
  • Recommended packages for web development (open Settings and go to Packages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment