Skip to content

Instantly share code, notes, and snippets.

View RishikeshDarandale's full-sized avatar
🗨️
learning > implementing

Rishikesh Darandale RishikeshDarandale

🗨️
learning > implementing
View GitHub Profile
@RishikeshDarandale
RishikeshDarandale / Opensearch.md
Last active January 25, 2024 17:19
OpenSearch - setting on loacal

Install opensearch

mkdir ~/devtools
  • Copy the file to ~/devtools
@RishikeshDarandale
RishikeshDarandale / README.md
Created June 6, 2022 17:52
Staring a redis cluster using docker

Redis cluster using docker

A quick instruction to setup the redis cluster on local machine for quick testing. I am going to use bitnami docker images.

Instructions

  • Start the redis cluster with one master and one slave
docker-compose up -d
2020/06/05 17:01:13 [WARN] Provider "registry.terraform.io/-/aws" produced an invalid plan for aws_batch_job_definition.batch-job-definition, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
batch-job-role\",\"memory\":4096,\"mountPoints\":[],\"resourceRequirements\":[],\"ulimits\":[],\"vcpus\":1,\"volumes\":[]}")
2020/06/05 17:01:13 [INFO] backend/local: plan operation completed
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
@RishikeshDarandale
RishikeshDarandale / packageModules.js
Last active September 6, 2019 15:44
serverless-webpack: multi compile option
'use strict';
const BbPromise = require('bluebird');
const _ = require('lodash');
const path = require('path');
const archiver = require('archiver');
const fs = require('fs');
const glob = require('glob');
const semver = require('semver');
@RishikeshDarandale
RishikeshDarandale / circle.yml
Created March 8, 2019 13:46 — forked from mxygem/circle.yml
Refactored circle.yaml
aliases:
- &restore_gem_cache
keys:
- v1-gemfile-{{ checksum "Gemfile.lock" }}
- &save_gem_cache
name: Saving gem cache
key: v1-gemfile-{{ checksum "Gemfile.lock" }}
paths:
- ~/data/vendor/bundle
@RishikeshDarandale
RishikeshDarandale / query.md
Last active November 16, 2018 10:39
elasticsearch order by IDs provided in IDs query

elasticsearch 6.3

When you want to order the elaticsearch document in the order of Ids you have provided in [Ids][1] query, then following function score query can be used to get required result:

{  
   "query":{  
      "function_score":{  
         "query":{  
 "ids":{ 
@RishikeshDarandale
RishikeshDarandale / pre-commit
Created May 13, 2018 06:18 — forked from jamtur01/pre-commit
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f

Keybase proof

I hereby claim:

  • I am rishikeshdarandale on github.
  • I am rishidarandale (https://keybase.io/rishidarandale) on keybase.
  • I have a public key ASDtoQnQlTAldrcTqUCYDTGqd8fzKD_Akl2w_nDt8c4xMQo

To claim this, I am signing this object:

@RishikeshDarandale
RishikeshDarandale / gpg-import-and-export-instructions.md
Created February 19, 2018 06:15 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@RishikeshDarandale
RishikeshDarandale / JPACryptoConverter.java
Created May 19, 2017 06:44 — forked from simbo1905/JPACryptoConverter.java
JPA Converter which encrypts a column in the db
import java.security.Key;
import java.util.Properties;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import org.slf4j.Logger;