Purpose This repository collects the basic settings and configuration files to apply when start working on a new Ubuntu machine. It contains detailed instructions for applying the settings and useful settings files.
.bashrc— custom~/.bashrcfile (copy to~/.bashrcandsourceit)..gitignore— files to ignore for this repository.LICENSE— MIT license for the repository.README.md— this file (instructions & checklist).settings.json— VS Code user settings (path:~/.config/Code/User/settings.json).
-
1.a. Set a custom
.bashrcfile1.b. Change GNOME Terminal preferences
-
2.a. Global configuration
2.b. Local configuration
2.c. Show git settings
-
3.a. Generate key pair
3.b. Copy public key to a remote machine
3.c. Add public key to GitHub / GitLab / Bitbucket
-
4.a. Recommended extensions
4.b. Apply local settings (settings.json)
4.c. Apply settings on a remote machine (Remote - SSH)
Things included in the custom .bashrc:
- Set a custom
PS1prompt with colors, relevant info, and custom separators:
Format: ✔/✘ HH:MM 🗂️ ╭⟮[env] user@host:directory [branch/hash][*]⟯
╰──❭ $/#
Example: ✔ 10:43 🗂️ ╭⟮luciano@vivobook:~/project master⟯
╰──❭ $ - Increase shell history:
HISTSIZE=10000 # Current session commands
HISTFILESIZE=20000 # History file commands- Color GCC warnings/errors:
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'- Alias
pythontopython3:
alias python='python3'Steps:
- Make a backup of your current version first:
cp ~/.bashrc ~/.bashrc.backup- Copy the file from this repository into your home directory:
# From your home or any working directory
git clone https://github.com/luchocurti/dev-machine-setup.git
cd ~/dev-machine-setup
cp .bashrc ~/.bashrc
# Apply changes immediately
source ~/.bashrc- Open GNOME Terminal.
- Menu → Preferences.
- Select the profile (e.g., Unnamed).
- Appearance / Colors → choose a built-in scheme such as Gray on black or a dark profile.
- Optionally: uncheck “Use colors from system theme” and set custom text/background colors.
Run these commands to set your global git configuration:
git config --global user.name "Name Surname"
git config --global user.email "user@email.com"
git config --global diff.tool meld
git config --global merge.tool meld
git config --global mergetool.prompt true
git config --global mergetool.keepBackup true
git config --global core.editor "code --wait"
git config --global core.autocrlf input
git config --global credential.helper "cache --timeout=3600"
git config --global color.ui auto
git config --global difftool.prompt true
git config --global init.defaultBranch masterInside a repository run:
git config --local user.name "Name Surname"
git config --local user.email "user@email.com"To inspect different levels of configuration:
echo "All git settings"
git config --list --show-origin
echo "Global settings"
git config --global --list
echo "Local settings (run inside a Git repository)"
git config --local --list
echo "System settings"
git config --system --listPrefer ED25519 keys (modern and compact):
ssh-keygen -t ed25519 -C "your@email.com"
# follow prompts, accept default file location (~/.ssh/id_ed25519)Use ssh-copy-id to append your public key to ~/.ssh/authorized_keys on the remote host:
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@remote_machine
# then test
ssh user@remote_machineIf ssh-copy-id is not available, copy the contents of ~/.ssh/id_ed25519.pub and append to ~/.ssh/authorized_keys on the remote host (set correct permissions: chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys).
- Copy the contents of your public key:
cat ~/.ssh/id_ed25519.pub
# copy the printed line- On Git hosting service:
- GitHub: Settings → SSH and GPG keys → New SSH key → paste key → Save
- GitLab: User Settings → SSH Keys → Add key → Save
- Bitbucket: Personal settings → SSH keys → Add key → Save
- Test:
ssh -T git@github.com # or git@gitlab.com, git@bitbucket.orgOpen the Extensions view (Ctrl + Shift + X) and install the extensions you need. Recommended categories:
- C/C++ language support (IntelliSense, debugging)
- C/C++ themes & icon packs
- CMake & CMake Tools
- Remote - SSH (for remote editing and development)
- Remote Explorer / Remote - SSH: Editing Configuration Files
- Material Icon Theme (optional)
You can also install from the command line:
code --install-extension <extension-id>If you don't know the exact extension id, search by the extension name in the Extensions view.
- Open VS Code →
Ctrl + Shift + P→ Preferences: Open User Settings (JSON). - Edit
~/.config/Code/User/settings.json(or the path used by your VS Code build) — this repository containssettings.jsonwhich you can copy there:
cp settings.json ~/.config/Code/User/settings.json- Restart VS Code
- Connect to the remote host using Remote - SSH in the Remote Explorer.
- While connected to the remote,
Ctrl + Shift + P→ Preferences: Open Remote Settings (JSON) (this will open the remote user settings file). - Copy relevant settings from your local
settings.jsoninto the remote settings file and save. - Restart the remote VS Code window.
Tip: extensions can be installed on the remote host by selecting "Install on SSH: " from each extension's menu.
- Update OS & install base tools:
sudo apt update && sudo apt upgrade -y
sudo apt install git curl build-essential wget openssh-client- Clone this Dev Machine Setup repo:
git clone https://github.com/luchocurti/dev-machine-setup.git
cd ~/dev-machine-setup- Apply
.bashrc:
cp ~/.bashrc ~/.bashrc.backup
cp .bashrc ~/.bashrc
source ~/.bashrc- Apply git global config (edit values first):
# copy the commands from this README into a script or run manually- Generate or copy SSH key:
# if you already have one, copy to the new machine ~/.ssh/
# otherwise generate:
ssh-keygen -t ed25519 -C "your@email.com"- Install VS Code (if not installed) and copy
settings.json:
# copy settings.json
mkdir -p ~/.config/Code/User
cp settings.json ~/.config/Code/User/settings.json- Install recommended VS Code extensions using the Extensions view or
code --install-extension. - Test SSH access to your servers and to Git hosting.
- Keep secrets out of your repository. Never commit private keys or credentials. Add
~/.ssh/*to.gitignoreif you ever push from a machine that contains your keys. - Prefer ED25519 keys for SSH unless you have compatibility constraints.
- If you rely on the same dotfiles across many machines, consider a dotfiles manager (bare git repo in
~/.cfg) — outside the scope of this README, but useful once the repo grows.
See LICENSE for the license applicable to this project.
