Skip to content

Instantly share code, notes, and snippets.

View dineshsprabu's full-sized avatar

Dineshprabu S dineshsprabu

  • Bangalore, India.
View GitHub Profile
@dineshsprabu
dineshsprabu / node_profile_inspect.md
Created July 19, 2018 07:16
Node Profiling and Inspecting

Profiling

Below command would create a log.

node --prof app.js

To understand the log you would need to pass it to --prof-process.

@dineshsprabu
dineshsprabu / vscode_golang.md
Last active June 8, 2018 12:54
Setting up VSCode Golang

VSCode Download

https://code.visualstudio.com/download

Install Go extension

On VSCode, Goto Extension -> Search Go -> Install.

@dineshsprabu
dineshsprabu / sticky_thread_pool.rb
Last active February 27, 2018 14:48
[Ruby] Sticky Thread Pool
# Sticky Thread Pool would help to execute your block
# by sticking to a particular executor on the pool by
# by index.
require "concurrent"
class StickyThreadPool
attr_accessor :pool
@dineshsprabu
dineshsprabu / setup_ubuntu_14_04.sh
Last active December 30, 2017 08:03
[Mining] Mining Zcash with minergate
#!/bin/bash
printf yyy | sudo apt-get install cmake build-essential libboost-all-dev
git clone https://github.com/feeleep75/nheqminer.git
cd nheqminer/nheqminer
mkdir build
cd build
cmake ..
make
@dineshsprabu
dineshsprabu / minergate_cli.md
Last active December 29, 2017 16:30 — forked from balinux/gist:af5465cc4078f2022844be6509b21fff
Minergate-cli ubuntu installation

Run this command to install MG-CLI:

sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb

start miner (4 cores for BCN) use this command:

minergate-cli -user <YOUR@EMAIL.com> -bcn 4
@dineshsprabu
dineshsprabu / time_based_queries.md
Created December 21, 2017 11:58
[Postgres] Time based queries

Add interval to timestamp value

select (<column-name>::timestamp::date + interval '1 week') as inter from <table-name> limit 1;
@dineshsprabu
dineshsprabu / dynamic_page_downloader.js
Last active December 10, 2017 06:19
[PhantomJS] Load and save dynamic webpage
#!/usr/bin/phantomjs
// This script will load a dynamic page and gives you the content.
// Args: url -> URL to be downloaded.
var system = require('system');
if(system.args.length == 1){
system.stderr.write("Pass URL as argument to the script");
phantom.exit(1)
@dineshsprabu
dineshsprabu / postgres_management.md
Created November 24, 2017 09:54
[Postgres] Useful Management Queries

Size of the DB

SELECT pg_size_pretty(pg_database_size('postgres'));

Size of the table with indexes

select pg_size_pretty(pg_total_relation_size('tablename'));
@dineshsprabu
dineshsprabu / hbase.md
Created October 25, 2017 06:22
[HBase] HBase commands

HBase Commands

List of row keys.

count 'pio_event:events_1', { INTERVAL => 1 }

List tables.

list
@dineshsprabu
dineshsprabu / screen.md
Created October 24, 2017 14:13
[Screen] Useful screen commands

Screen commands

Create screen session detached and log on local file. A local file named screenlog.0 will be created on the local dir.

screen -dms -L <any-name> bash -c <command>