Skip to content

Instantly share code, notes, and snippets.

@nareshganesan
nareshganesan / PythonDevSetup.sh
Last active October 25, 2015 06:08
Homebrew + Python + Pip + Virtualenv - Mac Yosemite Installation
#!/usr/bin/python
# All command below are for Mac Yosemite 10.10.3
# Homebrew install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Add Homebrew to System Path - to ~/.bash_profile or ~/.profile
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
# Install Python for your development (Comes with Pip)
brew install python
# Pip update
sudo pip install --upgrade pip
@nareshganesan
nareshganesan / EC2AttachVolume.txt
Last active August 31, 2015 03:51
EC2 attach an existing volume to instance - Linux
# command to show the list of volumes attached to the instance
lsblk # get the device which has no mount point.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvdf 202:80 0 100G 0 disk
xvda1 202:1 0 8G 0 disk /
# Check files system of the volume
sudo file -s /dev/xvdf
# if the device is not empty to format the volume
@nareshganesan
nareshganesan / gist:46413289deae452df407
Created December 27, 2015 10:30 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
{
"ignored_packages":
[
"Vintage"
],
// Terminal plugin
"terminal": "iTerm.sh",
// OS X only: When files are opened from finder, or by dragging onto the
// dock icon, this controls if a new window is created or not.
"open_files_in_new_window": false,
# GIT config ref: https://gist.github.com/trey/2722934
# If brew is not installed the paste the link below in terminal and return.
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# GIT bash completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
@nareshganesan
nareshganesan / Mac Useful Dev tools.txt
Last active July 13, 2017 05:45
El Capitan: iterm2 + Zsh + Oh-my-zsh
# EL Capitan
# For Python devs
sudo easy_install pip
sudo pip install virtualenv
pip install virtualenvwrapper # has some good pre-post scripts for mundane tasks.
@nareshganesan
nareshganesan / Mac-Utilities.sh
Last active January 7, 2016 17:18
Elcapitan change LocalHostName ComputerName HostName
# El capitan change computer name
sudo scutil --set LocalHostName "Name" # Bonjour-based services discovery name ()
sudo scutil --set ComputerName "Name" # User Friendly computer name
sudo scutil --set HostName "Name" # Name to display when connecting over SSH
# To check if the above name is set
scutil --get HostName
# install git scm
sudo apt-get install git-core
# configure git user details , can be system wide, user specific or repo specific
# user name
git config --global user.name "John Doe"
# user email
git config --global user.email johndoe@example.com
@nareshganesan
nareshganesan / hugo-commands.bash
Created January 22, 2016 07:46
Hugo Installation + Tutorial + Useful commands
# Hugo is a static site generator from spf13.
# it is really simple, elegant and easy to install once we get around it.
# The following commands are mostly tested in OSX
brew install hugo
mkdir hugo-project
cd hugo-project
# Tailing a big file especially log file
tail -f filename
# search for content
grep 'pattern'
# search with OR condition
grep -E 'pattern1|pattern2'
# search with AND condition