GithubHelp home page GithubHelp logo

dotfiles's Introduction

MacBook and Servers Configuration

This repository contains the dotfiles and all the information to configure both a local laptop (I use macbook with Iterm2 as terminal) and remote Linux machines. When not specified differently, instructions have to be repeated locally and remotely.

Mac - Install HomeBrew and Git

xcode-select โ€”-install /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Mac - Install Iterm2

brew cask install iterm2

Miscellaneous packages

brew install rynsc git

A nice tip from https://github.com/svenkreiss/dotfiles is to save iterm iterm2 preferences in a custom folder (or use the ones provided). To load them: preferences --> general --> preferences (pointing at dotfiles/iterm2 for example). Similarly, you can load the profiles dotfiles/iterm2/Profiles.json into Preferences --> profiles.

All - Install Oh My Zsh

Install zsh with: brew install zsh (for mac)

Oh My Zsh:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

To make it your default shell:

chsh -s /usr/bin/zsh

Plugins

Many plugins are already available, I use:

  • History-Substring-search

git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search

  • Sintax Highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Forward SSH Key

To avoid creating a new SSH in each remote machine, we can forward the agent when we ssh by changing the ssh settings touch ~/.ssh/config and then copy the following:

Host *
    IdentityFile ~/.ssh/id_ed25519
    ForwardAgent yes
    UseKeychain yes
    AddKeysToAgent yes

HPC Clusters

Thanks to @svenkreiss.

Changing default shell may not be supported, but you can launch your shell from .bash_profile if you detect you are interactive mode. Only change shell when in interactive mode, otherwise job submission with sbatch will not work. First, verfy the path of the installed zsh with:
which zsh
Then add at the end of .bash_profile the following (careful about indentation, avoid copy-paste):

if [[ "$-" == *i* ]]; then
	export SHELL=<zsh_path>
	exec <zsh_path> -l
fi

All - Make changes effective

Clone this repository and rsync the into the custom folder of oh-my-zsh:

git clone [email protected]:bertoni9/dotfiles.git
rsync -av dotfiles/zsh_profile.zsh  ~/.oh-my-zsh/custom/

Change the line in the .zshrc file that contains the plugins to activate by substituting it with the following (or the one you like)

nano ~/.zshrc

And add: plugins=(git history-substring-search zsh-syntax-highlighting)

Many more plugins are available, read more in their official page

All - SSH Key to Github account

Very helpful to working with Github without typing every time username and password. Steps well explained in the official website

If you already have a repository with https url (always asking for username and password), after setting a ssh key:
git remote set-url origin <ssh-url>

Mac - Install Python3

As Python2 is used as default in the system, it's convenient to use pyenv to set the right Python version.

brew install pyenv
pyenv install 3.8.10
pyenv global 3.8.10
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.