Skip to content

Instantly share code, notes, and snippets.


Niraj Shukla shklnrj

View GitHub Profile
PavelBezpalov / 1. ELK.install
Last active Apr 15, 2020
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
View 1. ELK.install
$ sudo apt-get update && sudo apt-get install default-jre
$ wget -qO - | sudo apt-key add -
$ echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status
rkjha / nginx-config-rails4-with-puma-ssl-version.conf
Last active May 27, 2020
Nginx config for rails 4 application using puma [ssl and non-ssl version]
View nginx-config-rails4-with-puma-ssl-version.conf
upstream myapp_puma {
server unix:/tmp/myapp_puma.sock fail_timeout=0;
# for redirecting to https version of the site
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
chiraggude / Install Ruby and RubyGems
Last active Dec 14, 2018
Install Ruby 2.1.1 and RubyGems 1.8.25 on CentOS 6.5
View Install Ruby and RubyGems
# Install Ruby
tar xvzf ruby-2.1.1.tar.gz
cd ruby-2.1.1
./configure --prefix=/usr
make install
# remove "ruby-2.1.1" folder in /root
View haproxy-ssl.cfg
# References:
nbproc 2
maxconn 16384
oodavid /
Created Mar 26, 2012
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see for other systems like ubuntu etc

mikeyk / gist:1329319
Created Oct 31, 2011
Testing storage of millions of keys in Redis
View gist:1329319
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
You can’t perform that action at this time.