Skip to content

Instantly share code, notes, and snippets.

@jmscarnatto
Last active November 3, 2024 19:41
Show Gist options
  • Save jmscarnatto/6caa944876e105103d9774a07db70354 to your computer and use it in GitHub Desktop.
Save jmscarnatto/6caa944876e105103d9774a07db70354 to your computer and use it in GitHub Desktop.
Basic linux setup for programming

Summary

  1. Install basic tools
  2. Oh-My-Sh / Powerlevel10k / Autosuggestions / ....
  3. Install Docker
  4. Install RVM
  5. Install NVM
  6. Vscdode Settings
  7. Vscode extensions

1 - Basic tools

sudo apt update
sudo apt upgrade -y
sudo apt install curl git zsh btop fzf ncdu pwgen -y

2 - Oh-My-Sh / Powerlevel10k / Autosuggestions / ....

wget -P $HOME https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh; \
    sh $HOME/install.sh; \
    rm $HOME/install.sh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting --depth 1
git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions --depth 1

sed -i 's/robbyrussell/powerlevel10k\/powerlevel10k/' $HOME/.zshrc
sed -i 's/(git)/(git zsh-autosuggestions zsh-syntax-highlighting)/' $HOME/.zshrc
echo "[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" >> $HOME/.zshrc

echo "alias gil=\"git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit\"" >> $HOME/.zshrc
echo "alias gis=\"git status\"" >> $HOME/.zshrc
echo "alias gck=\"git checkout\"" >> $HOME/.zshrc
echo "alias gib=\"git branch\"" >> $HOME/.zshrc
echo "alias gip=\"git pull\"" >> $HOME/.zshrc
echo "alias gita=\"git commit --amend --no-edit\"" >> $HOME/.zshrc
echo "alias gir=\"git reflog --date=local\"" >> $HOME/.zshrc
echo "alias dops=\"docker ps\"" >> $HOME/.zshrc
echo "alias doim=\"docker images\"" >> $HOME/.zshrc
echo "alias doco=\"docker-compose\"" >> $HOME/.zshrc
echo "alias ports=\"lsof -i -P -n | grep LISTEN\"" >> $HOME/.zshrc

2b - Nvim

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux64.tar.gz
sudo rm $HOME/nvim-linux64.tar.gz
echo "export PATH=\"$PATH:/opt/nvim-linux64/bin\""  >> $HOME/.zshrc

3 - Docker

sudo apt install -y apt-transport-https ca-certificates gnupg
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/dockerce.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/dockerce.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/dockerce.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

4 - RVM

sudo apt install -y gpg gcc g++ make
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
source ~/.zshrc
rvm install 3.2.2
rvm use 3.2.2 --default

5 - NVM

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ./zshrc
nvm install node
npm install yarn -g

6 - Vscode Settings

{
    "editor.minimap.enabled": false,
    "workbench.sideBar.location": "right",
    "workbench.editor.showTabs": "single",
    "editor.fontSize": 14,
    "terminal.integrated.defaultProfile.osx": "zsh",
    "terminal.external.osxExec": "iTerm.app",
    "terminal.integrated.fontFamily": "MesloLGS NF",
    "window.nativeTabs": true,
    "editor.scrollbar.vertical": "hidden",
    "editor.overviewRulerBorder": false,
    "editor.hideCursorInOverviewRuler": true,
    "editor.quickSuggestions.comments": true,
    "editor.renderWhitespace": "trailing",
    // Warnings in overview vertical ruler
    "workbench.colorCustomizations": {
        "editorOverviewRuler.border": "#0000",
        "editorOverviewRuler.findMatchForeground": "#0000",
        "editorOverviewRuler.rangeHighlightForeground": "#0000",
        "editorOverviewRuler.selectionHighlightForeground": "#0000",
        "editorOverviewRuler.wordHighlightForeground": "#0000",
        "editorOverviewRuler.wordHighlightStrongForeground": "#0000",
        "editorOverviewRuler.modifiedForeground": "#0000",
        "editorOverviewRuler.addedForeground": "#0000",
        "editorOverviewRuler.deletedForeground": "#0000",
        "editorOverviewRuler.errorForeground": "#0000",
        "editorOverviewRuler.warningForeground": "#0000",
        "editorOverviewRuler.infoForeground": "#0000",
        "editorOverviewRuler.bracketMatchForeground": "#0000",
        "editorCursor.foreground": "#e06b31",
        "terminalCursor.foreground": "#0db474",
        "editorWhitespace.foreground": "#faf606"
    },
    "java.imports.gradle.wrapper.checksums": [
        {
            "sha256": "e2b82129ab64751fd40437007bd2f7f2afb3c6e41a9198e628650b22d5824a14",
            "allowed": true
        }
    ],
    "workbench.startupEditor": "none",
    "security.workspace.trust.untrustedFiles": "open",
    "editor.largeFileOptimizations": false,
    "sync.gist": "b6f1fb566ac112aa8728b615e1a0e8be",
    "editor.bracketPairColorization.enabled": true,
    "editor.guides.bracketPairs": true,
    "editor.fontFamily": "Hermit, 'Cascadia mono', Menlo, Monaco, 'Courier New', monospace",
    "ruby.rubocop.suppressRubocopWarnings": true,
    "ruby.rubocop.executePath": "/Users/jmscarnatto/.asdf/shims/",
    "ruby.rubocop.onSave": false,
    "editor.tabSize": 2,
    "ruby.useLanguageServer": true,
    "ruby.intellisense": "rubyLocate",
    "[ruby]": {
        "editor.defaultFormatter": "LoranKloeze.ruby-rubocop-revived"
    },
    "ruby.useLanguageServer": true, 
    "ruby.intellisense": "rubyLocate",
    "redhat.telemetry.enabled": false,
    "yaml.customTags": [
        "!And",
        "!And sequence",
        "!If",
        "!If sequence",
        "!Not",
        "!Not sequence",
        "!Equals",
        "!Equals sequence",
        "!Or",
        "!Or sequence",
        "!FindInMap",
        "!FindInMap sequence",
        "!Base64",
        "!Join",
        "!Join sequence",
        "!Cidr",
        "!Ref",
        "!Sub",
        "!Sub sequence",
        "!GetAtt",
        "!GetAZs",
        "!ImportValue",
        "!ImportValue sequence",
        "!Select",
        "!Select sequence",
        "!Split",
        "!Split sequence"
    ],
    "extensions.ignoreRecommendations": true,
    "breadcrumbs.icons": false,
    "breadcrumbs.symbolPath": "off",
    "editor.cursorBlinking": "expand",
    "editor.cursorWidth": 3,
    "terminal.integrated.scrollback": 10000,
    "vs-kubernetes": {
        "vs-kubernetes.knownKubeconfigs": [
            "/Users/jmscarnatto/.kube/config"
        ],
        "vs-kubernetes.kubeconfig": "/Users/jmscarnatto/.kube/config"
    },
}

7 - Vscode Extensions

  • Gitlens
  • Docker
  • Remote Explorer
  • Endwise
  • Thunder Client
  • Codium Mate or Supermaven
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment