Skip to content

Instantly share code, notes, and snippets.

View shukla2112's full-sized avatar
👋
Hi!

Nikunj Shukla shukla2112

👋
Hi!
View GitHub Profile
@shukla2112
shukla2112 / mongodb_collection_sizes.js
Created July 6, 2018 06:49 — forked from joeyAghion/mongodb_collection_sizes.js
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var collectionNames = db.getCollectionNames(), stats = [];
collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
stats = stats.sort(function(a, b) { return b['size'] - a['size']; });
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); }
@shukla2112
shukla2112 / redis_key_sizes.sh
Created July 27, 2017 09:56 — forked from epicserve/redis_key_sizes.sh
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@shukla2112
shukla2112 / elasticsearch.yml
Created April 20, 2017 11:38 — forked from reyjrar/elasticsearch.yml
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@shukla2112
shukla2112 / README.md
Created October 3, 2016 10:34 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu 14.04 64-bit

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Step 1

Install the xvfb server by running

@shukla2112
shukla2112 / Instructions_to_login.md
Last active April 28, 2020 02:36 — forked from sahilsk/Instructions_to_login.md
Instructions to login to servers

How to access server

  • Edit ssh config of your system

    vim ~/.ssh/config

Paste the following content: