Skip to content

Instantly share code, notes, and snippets.

Atul Khanduri AtulKsol

Block or report user

Report or block AtulKsol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AtulKsol
AtulKsol / elasticsearch_commands.md
Created Oct 17, 2019
ElasticSearch Commands for Mac
View elasticsearch_commands.md

Install using Homebrew:

brew tap elastic/tap # Tap elastic 
brew search elasticsearch # Will show available versions
brew install elasticsearch@2.4 # install specific version

Start ElasticSearch Server

brew services start elasticsearch@5.6

@AtulKsol
AtulKsol / postgres-not-running-fix.md
Last active Oct 17, 2019
Postgres on OSX with homebrew not running
View postgres-not-running-fix.md

Postgres on OSX with homebrew not running [tested in mac]

Fix for following issue:

$ psql
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
@AtulKsol
AtulKsol / memory_monitor.rb
Created Jun 25, 2018
Log Memory usage for each request
View memory_monitor.rb
module MemoryMonitor
def log_memory_usage
initialize_logger
initialize_memory_variable
log_request
reset_memory_variable
end
@AtulKsol
AtulKsol / db_backup_commands.md
Last active Nov 3, 2017
Commands to backup & restore database
View db_backup_commands.md
  1. pg_dump is a nifty utility designed to output a series of SQL statements that describes the schema and data of your database. You can control what goes into your backup by using additional flags.
    Backup: pg_dump -h localhost -p 5432 -U postgres -d mydb > backup.sql

    Restore: psql -h localhost -p 5432 -U postgres -d mydb < backup.sql

    -h is for host.
    -p is for port.
    -U is for username.
    -d is for database.

@AtulKsol
AtulKsol / docker-sync.md
Created Jul 7, 2017
Docker Sync commands
View docker-sync.md
@AtulKsol
AtulKsol / multiple_ssh_setting.md
Created Jun 5, 2017 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@AtulKsol
AtulKsol / sublime-setting.json
Created Jan 18, 2017
Sublime user settings
View sublime-setting.json
{
"font_size": 9,
"ignored_packages":
[
"Vintage"
],
"tab_size": 2,
"translate_tabs_to_spaces": true,
"word_wrap": true,
@AtulKsol
AtulKsol / Dockerfile
Created Dec 27, 2016 — forked from renatosousafilho/Dockerfile
Deploy com Mina, Docker e Docker Compose
View Dockerfile
FROM rails:4.2.3
MAINTAINER Renato Filho <renatosousafilho@gmail.com>
ENV HOME /home/app
ENV RAILS_ENV development
RUN useradd -m -s /bin/bash app
RUN gem install -N bundler
@AtulKsol
AtulKsol / rails_load_path_tips.md
Created Dec 25, 2016 — forked from maxim/rails_load_path_tips.md
How to use rails load paths, app, and lib directories.
View rails_load_path_tips.md

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

You can’t perform that action at this time.