Local starter kit for new workstation
Khanh Nguyen • 6 October 2021 •
General#
VS Code Extensions#
- Auto Close Tag
- Auto Rename Tag (consider drop since vscode now got this natively)
- Bracket Pair Colorizer
- CSS Peek
- Docker
- EditorConfig for Visual Studio Code
- ES7 React/Redux/GraphQL/React-Native snippets
- ESLint
- GitLens — Git supercharged
- Helium Icon Theme
- JavaScript (ES6) code snippets
- Prettier Formatter
- Import Cost
- MDX (optional)
- Tailwind CSS IntelliSense (optional)
- PostCSS Language Support (optional)
- vscode-styled-components (optional)
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.tabSize": 2,
"eslint.run": "onSave",
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"]
}
Sublime Text 4#
- Ctrl+Shift+P => Install Package Controll => Loading
- Ctrl+Shift+P => Install package => Pretty Json => Finish
- Ctrl+Shift+P => Key Binding
[
{ "keys": ["ctrl+alt+f"], "command": "pretty_json" },
{ "keys": ["ctrl+alt+m"], "command": "un_pretty_json" }
]
- Ctrl+Alt+F => Format Json
- Ctrl+Alt+M => Minify Json
- Ctrl+Shift+J => Concatenate String
Docker containers#
docker run -d --name mongo-dev -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=123456 mongo:latest
// Corresponding connection string: mongodb://root:123456@127.0.0.1:27017?retryWrites=true&w=majority
docker run -d --name redis-dev -p 6379:6379 redis
docker run -d --hostname local-rabbit --name rabbit-dev -p 5672:5672 -p 15672:15672 rabbitmq:3-management
/*
Optional:
-e RABBITMQ_DEFAULT_USER=YourUserName -e RABBITMQ_DEFAULT_PASS=YourUserPass
*/
docker run --name local-seq -d --restart unless-stopped -e ACCEPT_EULA=Y -p 80:80 -p 5341:5341 datalust/seq
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=YourDesirePassword" --name=sql-server-dev -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
Windows#
Docker#
wsl -l -v # Check list of already installed
wsl install # install wsl
wsl --update
wsl --set-default-version 2
Install docker desktop then change location of docker images if needed.
Ubuntu#
General setup#
Check software-properties-common
- Support for PPA(Personal package archive)
apt policy software-properties-common
In case not have yet:
sudo apt-get install software-properties-common
sudo apt update
sudo apt install net-tools
sudo apt install htop
: machine process viewerInstall Rider:
sudo snap install rider --classic
. Detailed guidance- Setting > Code Style > C# > Linebreaks and Wrapping > Prefer to wrap before '=>' followed by expressions
.Net SDK#
Cause of various .Net SDK version cross platform, therefore, for linux, install .Net SDK via dotnet-install.sh
To add dotnet
to executable path, add export PATH="$PATH:$HOME/.dotnet"
line to the bottom of ~/.bashrc
file. Explaination here.
(~
usually represent home directory, which is /home/[user]
)
Multiple PATH
export can be specified by :
character. For Ex: export PATH="$PATH:$HOME/.dotnet:$HOME/.dotnet/tools"
export PATH="$PATH:$HOME/.dotnet:$HOME/.dotnet/tools"
export DOTNET_ROOT=$HOME/.dotnet
# export MSBuildSDKsPath=$DOTNET_ROOT/sdk/$(${DOTNET_ROOT}/dotnet --version)/Sdks
# export PATH="${PATH}:${DOTNET_ROOT}"
# export PATH="$PATH:$HOME/.dotnet/tools"
Docker#
- Install via
sudo apt install docker.io
|sudo apt install docker-compose
- Checking version:
docker --version
- Checking current running status:
sudo systemctl status docker
- In case of disable, run
sudo systemctl enable --now docker
- Check it again
- In case of disable, run
- Testing:
sudo docker run hello-world