Skip to content

Instantly share code, notes, and snippets.

@matbesancon
Last active January 28, 2020 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matbesancon/8d198e659259461e1b83d87efe52ff0b to your computer and use it in GitHub Desktop.
Save matbesancon/8d198e659259461e1b83d87efe52ff0b to your computer and use it in GitHub Desktop.
Linux setup
[user]
name = Mathieu Besançon
[core]
autocrlf = true
[pager]
branch = false
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="amuse"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git autojump)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
## Preferred editor for local and remote sessions
export EDITOR='nano'
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='nano'
# else
# export EDITOR='nano'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias julia="~/programs/julia-13/bin/julia"
alias µ="~/.local/bin/micro"
alias juliap="julia --project"
alias ls="exa"
alias ll="exa -l"
alias tree="exa -T"
#!/bin/bash
mkdir -p $HOME/programs
# assuming Debian system
sudo apt-get update -y > /dev/null
sudo apt-get install -y -q git libgfortran5 curl zsh python3-pip neovim wget xclip nano autojump unzip > /dev/null
# install latex if nothing specified
if [ $LATEX='' ]
then
echo "Installing latex basics"
sudo apt-get install -y -q texlive-base texlive-generic-recommended latexmk texlive-fonts-recommended > /dev/null
fi
# zsh
echo "OhMyZSH"
CHSH='yes' && RUNZSH='no' && sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# rust
echo "Rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust_init.sh && chmod +x rust_init.sh && ./rust_init.sh -y && rm ./rust_init.sh
source $HOME/.cargo/env
rustup component add rustfmt
echo "Micro editor"
mkdir -p $HOME/Downloads
cd $HOME/Downloads && mkdir -p $HOME/.local/bin && \
wget https://github.com/zyedidia/micro/releases/download/v1.4.1/micro-1.4.1-linux64.tar.gz && \
tar -C . -xzf micro-1.4.1-linux64.tar.gz && cp micro-1.4.1/micro $HOME/.local/bin && \
rm -r $HOME/Downloads/micro-1.4.1 $HOME/Downloads/micro-1.4.1-linux64.tar.gz && cd $HOME
source $HOME/.profile
mkdir -p $HOME/.config/micro && cd $HOME/.config/micro && \
wget https://gist.githubusercontent.com/matbesancon/5f8e995f12d7e393fb8c38c91635f2bc/raw/bindings.json && \
wget https://gist.githubusercontent.com/matbesancon/5f8e995f12d7e393fb8c38c91635f2bc/raw/settings.json && cd $HOME
echo "Julia 1.3"
cd $HOME/Downloads/ && wget https://julialang-s3.julialang.org/bin/linux/x64/1.3/julia-1.3.0-linux-x86_64.tar.gz && tar -C $HOME/programs/ -xzf julia-1.3.0-linux-x86_64.tar.gz && mv $HOME/programs/julia-1.3.0 $HOME/programs/julia-13 && rm julia-1.3.0-linux-x86_64.tar.gz
# bat
echo "bat & exa"
cd $HOME/Downloads && wget https://github.com/sharkdp/bat/releases/download/v0.12.1/bat_0.12.1_amd64.deb && sudo dpkg -i bat_0.12.1_amd64.deb && rm bat_0.12.1_amd64.deb && cd $HOME
cd $HOME/Downloads && \
wget https://github.com/ogham/exa/releases/download/v0.9.0/exa-linux-x86_64-0.9.0.zip --output-document=exa.zip && \
unzip exa.zip && mv exa-linux-x86_64 $HOME/.local/bin/exa && rm exa.zip && cd $HOME
echo "zsh setup"
wget --output-document=$HOME/.zshrc https://gist.githubusercontent.com/matbesancon/8d198e659259461e1b83d87efe52ff0b/raw/.zshrc
echo "Julia basic packages, just JuMP for now".
$HOME/programs/julia-13/bin/julia -e 'import Pkg; Pkg.add("JuMP")'
echo "Java"
sudo apt-get install -y -q openjdk-11-jdk > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment