Last active
July 18, 2020 04:57
-
-
Save iamdevlinph/e01b549ed51d7334f03483ecae1149e9 to your computer and use it in GitHub Desktop.
Blog Gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create .tmux.conf in your home directroy | |
# This will hold tmux configurations | |
cd ~ | |
nano .tmux.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global user.name "John Doe" | |
git config --global user.email "john.doe@gmail.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global push.default current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hub pull-request -b <branch> -m <pr_message> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install ack-grep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go to your jekyll directory and install | |
bundle install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install git | |
# verify | |
git --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install jekyll bundler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install jsonlint -g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install ruby ruby-dev build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install tmux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lxrun /install /y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install zsh | |
# verify | |
zsh --version | |
# set as default | |
chsh -s $(which zsh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec jekyll serve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# md5 | |
ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub | |
# sha256 | |
ssh-keygen -lf ~/.ssh/id_rsa.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start tmux | |
if [ "$TMUX" = "" ]; then tmux; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to use tmux just run it | |
tmux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to apply modifications | |
tmux source-file .tmux.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ack-grep '<<<<< HEAD' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./src -name \*.json | xargs -I {} jsonlint -qc {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/.zshrc | |
# Enjoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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