- Help Setup ubuntu
- TOC
- Install Git
- Install Homebrew
- Add Suporting Packages
- Install Docker
- Install Ruby
- Install LAMP
- Install xclip
- Install NVM (Node Version Manager)
- Install Node
- Install Bower
- Install python
- install Coffee scripts
- Install Nonemon
- Install PostgreSQL
- Install Redis
- Install ZSH
- Install oh-my-zsh
- Helpful Supporting package
- Helpful custom function
sudo apt-get -y install git
- Name and Email
git config --global user.name "Md. Atiqul Islam"
git config --global user.email "atiqul.islam1589@gmail.com"
- Shortcut
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global credential.https://github.com.username atiq1589
-
Generate ssh key
- go to ~/.ssh
cd ~/.ssh
If you do not have .ssh folder create it
mkdir ~/.ssh && cd $\_
+ run below command and follow the stepsssh-keygen -t rsa -b 4096 -C "atiqul.islam1589@gmail.com"
-
turn on ssh-agent
eval "$(ssh-agent -s)"
-
Add your SSH key to the ssh-agent
ssh-add ~/.ssh/your_file_name
-
Copy .pub content (xclip is not working by the time i write this document)
cat ~/.ssh/your_file_name.pub
with xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
-
Go to github settings page and add this key
-
test your ssh connection
ssh -T git@github.com
***Hi atiq1589! You've successfully authenticated, but GitHub does not provide shell access.***
-
Add below command in ~/.bashrc file
if [ -z "$SSH_AUTH_SOCK" ] ; then eval `ssh-agent -s` ssh-add fi
-
install expect
sudo apt-get -y install expect
-
make a script
#!/usr/bin/expect -f spawn ssh-add /home/user/.ssh/id_rsa expect "Enter passphrase for /home/user/.ssh/id_rsa:" send "passphrase\n"; interact
For my local pc: ./mnt/e/work/Resources/bash-command/add-ssh.sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
sudo apt install python3-dev python3-pip
sudo apt install libffi-dev
sudo apt install python3-tk
sudo apt install lzma
sudo apt install liblzma-dev
sudo apt install libbz2-dev
sudo apt install libreadline-dev
sudo apt install tk-dev
brew install nvm
brew install yarn
brew install pyenv
brew install pyenv-virtualenv
brew install poetry
brew install libffi
brew install rustup
rustup-init
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get install -y ruby
or
sudo apt-get install -y ruby-full
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
or
sudo service apache2 {command [restart, start, stop]}
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
sudo apt-get -y install xclip
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
nvm -v
- Need to create .nvmrc file in that folder
- put version number on that file (.nvmrc)
$ echo "5.9" > .nvmrc
$ echo "lts/*" > .nvmrc # to default to the latest LTS version
- then run
nvm use
- Automatically load node version.
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
- Install NVM
- Install Node
nvm install node
or
nvm install #version
nvm install 6.9.1
node -v
or
Check NPM
npm -v
npm install -g bower
There is aleardy python2 installed
sudo apt-get install python-pip
pip --version
npm install -g coffee-script
npm install -g nodemon
- Install postgresql
sudo apt-get install postgresql postgresql-contrib
- Change password
sudo -i -u postgres
psql
\password postgres
Follow instruction 3. quite
\q
- Restart
sudo service postgresql restart
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
sudo ln -s path/to/redis-stable/src/redis-server /usr/bin
sudo apt-get install zsh
SOURCE Curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
wget
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Add ZSH_THEME="gnzh" in ~/.zshrc
or
match="robbyrussell"
sed -i -e 's/'$match'/gnzh/g' .zshrc
To Enable ZSH in windows 10 bash add
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi
in ~/.bashrc file
It has some problem to start other commands. Need to fix that first
- git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
add plugin in ~/.zshrc file plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
- Dev package
sudo apt-get install libffi-dev
sudo apt-get install libssl-dev
sudo apt-get install python-dev
- To access drive directly add below command in ~/.bashrc file
drive(){
cd /mnt/$1;
}
and run
source ~/.bashrc