Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Blog Gists
# Create .tmux.conf in your home directroy
# This will hold tmux configurations
cd ~
nano .tmux.conf
# the following commands will add some snippets to your shell config
# this will make gems install to user directory
# you can replace .zshrc with .bashrc
echo '# Install Ruby Gems to ~/gems' >> ~/.zshrc
echo 'export GEM_HOME=$HOME/gems' >> ~/.zshrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
ssh-keygen -t rsa -C "your_email@example.com"
# Copy key to clipboard
cat ~/.ssh/id_rsa.pub
# Add the ssh key on github or bitbucket
git config --global user.name "John Doe"
git config --global user.email "john.doe@gmail.com"
git config --global alias.lg "log --color --graph --pretty=format:'%C(bold yellow)%h%Creset -%C(bold cyan)%d%Creset %s %C(bold cyan)(%cr) %C(bold red)<%an>%Creset' --abbrev-commit"
git config --global push.default current
hub pull-request -b <branch> -m <pr_message>
sudo apt-get install ack-grep
# go to your jekyll directory and install
bundle install
sudo apt-get update
sudo apt-get install git
# verify
git --version
# Install binary and documentation
wget https://github.com/github/hub/releases/download/v2.2.9/hub-linux-amd64-2.2.9.tgz
tar zvxvf hub-linux-amd64-2.2.9.tgz
sudo ./hub-linux-amd64-2.2.9/install
# Skipped autocomplete and alias
# Cleanup
rm -rf hub-linux-amd64-2.2.9
gem install jekyll bundler
npm install jsonlint -g
# replace "setup_8.x" with the version you want
# like "setup_7.x" if you want to install version 7.x
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
# verfiy
node -v
npm -v
# to update npm (if necessary)
npm i -g npm
# you can replace zsh with bash
# this will add some scripts to the .zshrc or .bashrc
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | zsh
# Note: On Linux, after running the install script, if you get nvm: command not found or see no feedback from your terminal after you type:
command -v nvm
# install latest lts
nvm install --lts
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sudo apt-get install ruby ruby-dev build-essential
sudo apt-get update
sudo apt-get install tmux
lxrun /install /y
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sudo apt-get install zsh
# verify
zsh --version
# set as default
chsh -s $(which zsh)
sudo apt-get remove nodejs
sudo apt-get remove npm
sudo apt-get update
# verify by running
which nodejs npm node
# should return a 'not found'
# then install again
bundle exec jekyll serve
# md5
ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub
# sha256
ssh-keygen -lf ~/.ssh/id_rsa.pub
# start tmux
if [ "$TMUX" = "" ]; then tmux; fi
# to use tmux just run it
tmux
# to apply modifications
tmux source-file .tmux.conf
# intall Tmux Plugin Manager
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# the plugin is already in the .tmux.conf so just need to install it
# to install tmux plugins
prefix + I
#ctrl+a, shift+i
# press ESCAPE to continue
# remap prefix from C-b to C-a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# set pane using mouse
set -g mouse on
# make tmux use your preferred shell
set-option -g default-shell /bin/zsh
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# color status bar
set -g status-bg colour235
set -g status-fg white
# highlight current window
# set-window-option -g window-status-current-fg black
# set-window-option -g window-status-current-bg green
# set color of active pane
# set -g pane-border-fg colour235
# set -g pane-border-bg black
# set -g pane-active-border-fg green
# set -g pane-active-border-bg black
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# other plugins
set -g @plugin 'tmux-plugins/tmux-resurrect'
# new pane in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
#!/bin/bash
tmux new-session -d -s testSession -n testWindow
tmux send-keys -t testSession:testWindow "cd ~" Enter
tmux send-keys -t testSession:testWindow "source ~/.zshrc" Enter
tmux attach -t testSession:testWindow
ack-grep '<<<<< HEAD'
find ./src -name \*.json | xargs -I {} jsonlint -qc {}
source ~/.zshrc
# Enjoy
# find this line and add the following
plugins=(git ssh-agent zsh-autosuggestions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.