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 / 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 / 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
@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;
@RishikeshDarandale
RishikeshDarandale / s3_website.rake
Created September 9, 2016 06:17 — forked from alikhajeh1/s3_website.rake
Rake task to upload static website to AWS S3 using the s3cmd command-line tool
require 'fileutils'
OUT_DIR = 'public'
desc 'Prepare and upload the static site to S3'
task :upload, [:name] do |t, args|
raise Exception.new('You must provide the name of site to upload to, e.g., be rake upload[www]') unless args[:name]
puts "Removing existing output directory"
FileUtils.rm_rf OUT_DIR if File.exists?(OUT_DIR)
@RishikeshDarandale
RishikeshDarandale / _config.yml
Created August 19, 2016 13:31 — forked from alialo/_config.yml
Twitter Bootstrap style pagination in Jekyll
paginate: 10
@RishikeshDarandale
RishikeshDarandale / gulpfile.js
Created July 26, 2016 06:37 — forked from halex2005/gulpfile.js
gulpfile for codeofcliber blog
var gulp = require('gulp');
// build tasks
var childProcess = require('child_process');
gulp.task('jekyll', function(cb) {
var child = childProcess.exec('jekyll build', function(error, stdout, stderr) {
cb(error);
});
});
@RishikeshDarandale
RishikeshDarandale / pr.md
Created April 27, 2016 06:31 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@RishikeshDarandale
RishikeshDarandale / README.md
Created March 11, 2016 04:37 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@RishikeshDarandale
RishikeshDarandale / 00. tutorial.md
Created December 22, 2015 14:28 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler