# Setting up Ubuntu for 54chi for Node, Python, Salesforce, Go and Blog
These are the essentials I need for a comfortable experience with Ubuntu with Salesforce B2B Commerce:
- VERSION CONTROL: Git. But use gitlab if you want private repos that can be accessed outside the VPN!
- CLI: SFDX, so Visual Studio won’t help too much with Salesforce
- IDE: Visual Studio w/Forcecode and SF Extensions
- BROWSER: Firefox (primary) and Chrome (as a backup or for performance analysis)
- PASSWORD MANAGER: Gorilla Password
- SUPPORTING LANGUAGES: Node (with NVM), Python3 (with Jupyter notebook), Go (for Hugo), vue (js framework) and vuepress (for documentation)
# Git
- Open a terminal window
- Install regular git:
$ sudo apt install git
1
# Python
- Open a terminal window
- Install python3:
$ sudo apt-get update $ sudo apt-get install python3.6
1
2 - Install pip3:
$ sudo apt-get install python3-pip
1
# Java
- Open a terminal window
- Install Java 8
sudo apt install openjdk-8-jre-headless
1
# Node and SFDX cli
- Open a terminal window
- Install NPM
$ sudo apt-get install npm
1 - Since sfdx-cli doesn’t seem to work with node v8, let’s also install curl and NVM while at it (https://gist.github.com/d2s/372b5943bce17b964a79):
$ sudo apt-get install curl $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash $ source ~/.bashrc $ nvm install v10
1
2
3
4 - Then install sfdx-cli
$ npm install --global sfdx-cli
1 - We will also install yarn, as it is becoming the next npm:
$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - $ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list $ sudo apt-get update && sudo apt-get install --no-install-recommends yarn
1
2
3
# Password Manager
- Open a terminal window
- Install password gorilla manager (is like lastpass but portable):
sudo apt-get update sudo apt-get install password-gorilla
1
2 - Copy the gorilla.dat into the desktop (you may need to mount the drive either USB or shared)
# Firefox
- Firefox comes with Ubuntu. I like to install a couple extensions to make it safer to browse around.
- Open Firefox, install NoScript and uBlock Origin extensions to keep it lean and fast
- NoScript is the best way to prevent your page loading extra javascript stuff you don’t want to.
- uBlock will block popups without selling your soul
# Chrome
- Download and install Chrome (https://www.google.com/chrome/). You want the .deb file since we are in Ubuntu
- Since Chrome won’t be my default browser (long live Firefox!) we don’t need any plugins (yet)
# VS Code
- Download and Install VS Code (https://code.visualstudio.com (https://code.visualstudio.com/)). You want the .deb file since we are in Ubuntu
- Over VS Code and install the ForceCode extension by John Aaron Nelson and the Salesforce Extension Pack by Salesforce (this will take a while). This will install:
- ForceCode and
- Salesforce Extension Pack, which installs
- Apex,
- Apex Interactive Debugger,
- Apex Replay Debugger,
- Salesforce CLI Integration,
- Aura Components,
- Visualforce,
- Lightning Web Components and
- Python (???!!)
- In VS Code, disable the telemetry stuff unless you are ok of getting spied.
File > Preferences > Settings Type "telemetry" Disable both the Crash Reporter and Telemetry options
1
2
3 - Restart VS Code
# Jupyter
- Open a terminal window
- Install Jupyter notebook
$ sudo -H pip3 install --upgrade pip $ sudo -H pip3 install virtualenv
1
2 - References: https://www.digitalocean.com/community/tutorials/how-to-set-up-jupyter-notebook-with-python-3-on-ubuntu-18-04
# Docker
- Open a terminal window
- Install docker
$ sudo apt-get update $ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - $ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" $ sudo apt update $ sudo apt-get install docker-ce docker-ce-cli containerd.io
1
2
3
4
5
6
7
8
9
10
11
12
13
14 - References:
- https://docs.docker.com/install/linux/docker-ce/ubuntu/
- https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
# Hugo
- Open a terminal window
- Install Hugo
$ sudo apt-get install hugo
1
# Vuepress
- Open your project
- Install Vuepress
$ yarn add -D vuepress@next
1
# Vue cli
- Open a terminal window
- Install vue clie
$ yarn global add @vue/cli
1
# Shortcuts and tips
# Virtual Machine:
Everytime the computer goes to sleep, the network in the VM goes down.
Re-enabling the network after coming back from sleep:
- In the bottom status bar, click on the adapter icon (The 2 screens)
- Click on "Connect Network adapter" (to disable it)
- Click on "Connect Network adapter" again (to re-enable it)
# Linux:
- CTRL+Alt+T: Terminal window
- Windows key: Search
- $ which xyz: tells you where a program lives
- If program xyz is not found in your PATH, follow these steps to add it and allow it to be run from anywhere. Note: your profile may be in your .profile, .bash_profile, .bashrc, .zshrc, etc.
- Add this to your profile: export PATH="$PATH:/path/xyz-[version]/bin" (the path may vary of course)
- If in the terminal, log in and log out for the changes to take effect
# VSCode/ForceCode:
- CTRL+B: Toggle the file explorer
- CTRL+`: Terminal window (bash or wsl)
- Create vs snippets to make your life easier. Mine are here: https://github.com/54chi/ckz54_VSCodeSnippets
If you want to make VS a little lighter upon load, you can then disable the following plugins, as we won't typically use them (since we don't do active development). P.S. Don't delete them...you may need them sometimes!:
- Apex Interactive Debugger
- Apex Replay Debugger: super cool to debug and see the values at any give time!
- Aura Components
- Lightning Web Components: the future is lightning, but we are not living in the future!
# Jupyter:
https://www.dataquest.io/blog/jupyter-notebook-tutorial/
# Firefox:
Remember to allow blocked content in your B2B Salesforce site: By default, 3rd party cookies and Trackers may be blocked, which for some reason will block ccAdmin from showing up when configuring B2B commerce. This can be done easily by clicking on the "i" next to the URL bar on top.
Shortcuts:
- Web Developer Tools: CTRL+Shift+I
- Extensions: CTRL+Shift+A
- Scratchpad: Shift+F4
# Vuepress:
- Create a sample doc
# create a docs directory mkdir docs # create a markdown file echo '# Hello VuePress' > docs/README.md
1
2
3
4 - Then add to package.json
{ "scripts": { "docs:dev": "vuepress dev docs", "docs:build": "vuepress build docs" } }
1
2
3
4
5
6 - To create docs in real time (by default, you will see the results in http://localhost:8080/):
$ yarn docs:dev # OR npm run docs:dev
1 - To generate docs (by default they will be created in docs/.vuepress/dist):
$ yarn docs:build # Or npm run docs:build
1