Skip to content

Instantly share code, notes, and snippets.

@sudo-suhas
Created July 10, 2018 10:33
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 sudo-suhas/2fc61611183f865c446fc03b14675327 to your computer and use it in GitHub Desktop.
Save sudo-suhas/2fc61611183f865c446fc03b14675327 to your computer and use it in GitHub Desktop.
System setup
# Some options for our Zsh history. These will set our history to allow
# a ton more entires, ignore duplicate commands, and ignore some of the
# commands we don’t need a history of. This is useful because if you
# want to search for that command you ran a few weeks ago, you can do
# that a lot easier.
export HISTSIZE=32768;
export HISTFILESIZE=$HISTSIZE;
export HISTCONTROL=ignoredups;
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help";
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Configure default Go workspace
export GOPATH="$HOME"/dev/work/go
PATH=${PATH}:"$HOME"/.local/bin
PATH=${PATH}:"$HOME"/installs/go-tools/bin # Add go-tools bin directory to path
PATH=${PATH}:"$HOME"/.yarn/bin # Add yarn bin directory to path
PATH=${PATH}:"$HOME"/ssh-cmds # Add ssh command scripts to path
export PATH=${PATH}
# 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/suhaskaranth/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="robbyrussell"
ZSH_THEME="spaceship"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array 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 change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# 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.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# 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? (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
git-extras
golang
sudo
yarn
z
zsh-syntax-highlighting
)
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
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# 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 aptcheck="sudo apt update && \
printf '\n=============\n\n' && \
apt list --upgradable"
alias aptupgrade="sudo apt upgrade && \
printf '\n=============\n\n' && \
sudo apt autoclean
printf '\n=============\n\n' && \
sudo apt autoremove"
alias tgo="GOPATH=$HOME/installs/go-tools go"
# SSH_ENV="$HOME/.ssh/environment"
# function start_agent {
# echo "Initialising new SSH agent..."
# /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
# echo succeeded
# chmod 600 "${SSH_ENV}"
# . "${SSH_ENV}" > /dev/null
# /usr/bin/ssh-add;
# }
# Source SSH settings, if applicable
# if [ -f "${SSH_ENV}" ]; then
# . "${SSH_ENV}" > /dev/null
# #ps ${SSH_AGENT_PID} doesn't work under cywgin
# ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
# start_agent;
# }
# else
# start_agent;
# fi
eval "$(direnv hook zsh)"
#!/bin/bash -xe
# Setup instructions for ubuntu 18.04
sudo apt update
sudo apt full-upgrade
# Manually install chrome
# Sublime text
# https://www.sublimetext.com/docs/3/linux_repositories.html
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt install sublime-text
# Firefox developer edition
sudo apt install ubuntu-make
umake web firefox-dev
# Go
# https://github.com/golang/go/wiki/Ubuntu
sudo apt install golang-go
# node.js
# Take cmd from https://github.com/creationix/nvm and install nvm
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash
source ~/.bashrc
nvm install v8
# yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install --no-install-recommends yarn
# JAVA
sudo add-apt-repository ppa:webupd8team/java
sudo apt install oracle-java8-installer
# mysql
sudo apt install mysql-server mysql-client
# mysql 5.7 gets installed with empty password
sudo mysql -u root
# Setup database
: <<'end_long_comment'
mysql> create database mydb;
mysql> create user 'myuser'@'localhost' identified by 'mypass';
mysql> grant all privileges on mydb.* to 'myuser'@'localhost';
end_long_comment
# redis
sudo apt install redis-server
# dev tools
sudo apt install git gitk build-essential tcl
# VS Code
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install code
# might need to edit code.desktop for getting icon
# /usr/share/code/resources/app/resources/linux/code.png
# /usr/share/applications/code.desktop
# Netbeans - https://askubuntu.com/questions/75549/how-do-i-install-netbeans
# DBeaver
sudo add-apt-repository ppa:serge-rider/dbeaver-ce
sudo apt install dbeaver-ce
# Postman
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Path=/opt/Postman/app/
Exec=/opt/Postman/app/Postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development
StartupNotify=false
StartupWMClass=Postman
OnlyShowIn=Unity;GNOME;
X-UnityGenerated=true;
EOL
# numix icons
sudo add-apt-repository ppa:numix/ppa
sudo apt install numix-icon-theme-circle
sudo apt install gnome-tweaks gnome-shell-extensions
# Misc
sudo apt install libreoffice \
unrar \
xclip clipit \
curl \
shellcheck \
git-extras \
python-pip \
ubuntu-restricted-extras \
tlp tlp-rdw indicator-cpufreq \
jq \
tree \
direnv \
clang-format
# If on ThinkPad
sudo apt install tp-smapi-dkms acpi-call-dkms
# oh-my-zsh
sudo apt install zsh
chsh -s $(which zsh)
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
sudo apt install fonts-powerline
# theme
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
# Set ZSH_THEME="spaceship" in .zshrc.
# syntax highlighting - https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md#oh-my-zsh
# Other plugins - git-extras, sudo, yarn, z
# https://github.com/sharkdp/fd
wget https://github.com/sharkdp/fd/releases/download/v7.0.0/fd_7.0.0_amd64.deb -O fd_7.0.0_amd64.deb
sudo dpkg -i fd_7.0.0_amd64.deb
# https://github.com/BurntSushi/ripgrep
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.8.1/ripgrep_0.8.1_amd64.deb
sudo dpkg -i ripgrep_0.8.1_amd64.deb
# terminal editior - https://github.com/zyedidia/micro
snap install micro --classic
# https://gnometerminator.blogspot.in/p/introduction.html
sudo add-apt-repository ppa:gnome-terminator
sudo apt install terminator
# Go setup
mkdir -p ~/installs/go-tools
GOPATH=~/installs/go-tools go get -v -u \
github.com/golang/dep/cmd/dep \
github.com/skelterjohn/rerun \
github.com/davecheney/httpstat
# yarn global packages
yarn global add nodemon local-web-server
# aws CLI
pip install awscli --upgrade --user
aws configure
pip install awsebcli --upgrade --user
# protobufs
sudo add-apt-repository ppa:maarten-fonville/protobuf
sudo apt update
sudo apt install protobuf-compiler
: <<'end_long_comment'
To install deb files using command line:
`sudo dpkg -i /path/to/deb/file`
Install unmet dependencies if any
`sudo apt-get install -f`
end_long_comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment