Skip to content

development

2 posts with the tag “development”

Setting Up Your Software Development Environment

Setting Up Your Software Development Environment

Section titled “Setting Up Your Software Development Environment”

A well-configured development environment is crucial for productivity. This guide covers essential tools, configurations, and best practices for setting up a robust workspace, focusing on a Linux-based setup.

For development, Linux distributions (like Ubuntu, Fedora, Arch) are popular due to their flexibility, powerful command-line tools, and native support for many development technologies. macOS is also a strong contender, while Windows often benefits from WSL (Windows Subsystem for Linux).

Git is non-negotiable for collaborative development and tracking changes.

Terminal window
sudo apt update
sudo apt install git -y
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Visual Studio Code is a highly popular and extensible editor. Install it via snap or by downloading the .deb package.

Terminal window
sudo snap install --classic code

Default terminals are fine, but modern alternatives like Kitty or Alacritty offer better performance and customization.

Terminal window
sudo apt install kitty -y

For web development, Node.js and its package managers are essential.

Terminal window
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
# Install pnpm (optional, but recommended)
sudo npm install -g pnpm

Bash is the default, but zsh with Oh My Zsh or fish shell offer enhanced features.

Terminal window
sudo apt install zsh -y
chsh -s $(which zsh)
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Customize your ~/.zshrc or ~/.bashrc for aliases, functions, and prompt.

~/.zshrc
# ZSH_THEME="robbyrussell"
ZSH_THEME="agnoster"
alias ll="ls -lah"
alias gs="git status"
alias gc="git commit -m"

Use pyenv or conda for managing Python versions and virtual environments.

Terminal window
curl https://pyenv.run | bash
# Add to .zshrc or .bashrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrc
pyenv install 3.10.12
pyenv global 3.10.12

Docker is indispensable for containerized development and deploying services.

Terminal window
# Install Docker (refer to official docs for latest instructions)
sudo apt install docker.io -y
sudo usermod -aG docker $USER
newgrp docker
# Install Docker Compose
sudo apt install docker-compose -y

Store your shell configurations, editor settings, and other dotfiles in a Git repository. This makes it easy to sync your setup across machines.

Terminal window
git clone --bare git@github.com:your-username/dotfiles.git $HOME/.dotfiles
alias dotfiles=\'git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME\'
dotfiles checkout
ToolDescriptionWhy Use It
tmux / screenTerminal multiplexerManage multiple terminal sessions, persistent sessions
fzfFuzzy finderFast file/history search
ripgrep (rg)Fast code searchFaster grep alternative
tldrSimplified man pagesQuick command examples

Building a development environment is an iterative process. Start with the basics, then gradually add tools and configurations that suit your workflow. The goal is to minimize friction and maximize your focus on coding.

Happy coding!

Essential Linux Commands for Developers

Working in software development often means spending a lot of time in the terminal, especially on Linux systems. Mastering a few essential commands can significantly boost your productivity. Here’s a quick reference guide to some of the most useful ones.

CommandDescriptionExample Usage
lsList directory contentsls -la (long format, all files)
cdChange directorycd ../projects/my-app
pwdPrint working directorypwd
mkdirCreate directorymkdir new-feature
rmRemove files or directoriesrm -rf old-logs/ (force, recursive)
cpCopy files or directoriescp -r src/ build/
mvMove or rename files/directoriesmv old-name.txt new-name.md
findSearch for files in a directory hierarchyfind . -name "*.js"
CommandDescriptionExample Usage
catConcatenate and display file contentcat README.md
lessView file content page by pageless /var/log/syslog
headDisplay first N lines of a filehead -n 10 config.yaml
tailDisplay last N lines of a filetail -f access.log (follow changes)
grepSearch for patterns in filesgrep -r "error" . (recursive search)
nano / vimText editorsnano script.sh
CommandDescriptionExample Usage
psReport a snapshot of current processes`ps aux
top / htopDisplay Linux processes dynamicallyhtop (more user-friendly)
killSend a signal to processeskill 12345 (terminate process ID 12345)
killallKill processes by namekillall node
systemctlControl the systemd system and service managersudo systemctl status nginx
CommandDescriptionExample Usage
dfReport file system disk space usagedf -h (human-readable)
duEstimate file space usagedu -sh my-project/ (summary, human-readable)
freeDisplay amount of free and used memoryfree -h
unamePrint system informationuname -a (all information)
lscpuDisplay CPU architecture informationlscpu
CommandDescriptionExample Usage
ip addrDisplay IP addresses and network interfacesip addr show eth0
pingSend ICMP ECHO_REQUEST to network hostsping google.com
curlTransfer data from or to a servercurl -I https://codevibr.dev (show headers)
wgetNon-interactive network downloaderwget https://example.com/file.zip
sshOpenSSH remote login clientssh user@remote-host

Understanding file permissions is crucial for security and proper application function.

Terminal window
# View permissions
ls -l my-file.sh
# Change permissions (read, write, execute for owner, group, others)
chmod 755 my-file.sh
# Change ownership
sudo chown user:group my-file.sh
CommandDescriptionExample Usage
apt updateRefresh package listssudo apt update
apt upgradeUpgrade installed packagessudo apt upgrade -y
apt installInstall new packagessudo apt install git
apt removeRemove packagessudo apt remove htop

While not strictly a Linux command, Git is indispensable for developers.

Terminal window
# Initialize a new repository
git init
# Clone a repository
git clone https://github.com/user/repo.git
# Check status
git status
# Add changes to staging area
git add .
# Commit changes
git commit -m "feat: add new feature"
# Push changes to remote
git push origin main

This is just a starting point. The Linux terminal is a powerful environment, and there’s always more to learn. The best way to get comfortable is to use it daily. Experiment, read man pages (man <command>), and don’t be afraid to break things in a safe environment.

Happy coding!