Skip to content

Instantly share code, notes, and snippets.

@christofluethi
Last active February 9, 2017 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christofluethi/53276cda7b820f81c980350e355fbb64 to your computer and use it in GitHub Desktop.
Save christofluethi/53276cda7b820f81c980350e355fbb64 to your computer and use it in GitHub Desktop.
Bash on Windows

Windows 10 Setup for Ubuntu Linux Bash using WSL

Slow Sudo

Edit /etc/hosts and add

127.0.0.1 localhost <ADD_YOURS_HERE> 

Slow SSH Logins

Edit ~/.ssh/config and add

Host *
  GSSAPIAuthentication no
  GSSAPIDelegateCredentials yes

Edit /etc/ssh/sshd_config and add

GSSAPIAuthentication no
UseDNS no

Bash setup

Make sure you have the following in your ~/.bashrc

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_ALL=en_US.UTF-8

color_prompt=yes
if [ "$color_prompt" = yes ]; then
    if [ $(id -u) -eq 0 ]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$ '
    else
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$ '
    fi
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w\$ '
fi

LS_COLORS=$LS_COLORS:'di=01;34;40:' ; export LS_COLORS

Git

Install apt-get install git

Deal with line endings on windows

git config --global core.autocrlf true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment