Skip to content

Instantly share code, notes, and snippets.

View neeraj87's full-sized avatar
🏠
Working from home

Neeraj Jadhav neeraj87

🏠
Working from home
  • Pune
View GitHub Profile
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@marcelog
marcelog / aws-sqs.policy
Last active December 4, 2023 07:07
SQS Policy to allow an S3 bucket to publish messages
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@kennydude
kennydude / Java.java
Created July 14, 2012 14:31
Encrypt from Java and decrypt on Node.js
// Encrypt where jo is input, and query is output and ENCRPYTION_KEy is key
byte[] input = jo.toString().getBytes("utf-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(ENCRYPTION_KEY.getBytes("UTF-8"));
SecretKeySpec skc = new SecretKeySpec(thedigest, "AES/ECB/PKCS5Padding");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, skc);
byte[] cipherText = new byte[cipher.getOutputSize(input.length)];
@itarato
itarato / encryption.java
Created September 28, 2014 18:59
Java AES CBC encryption example
package com.company;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class Main {
@jeonghwan-kim
jeonghwan-kim / delete-aws-s3.js
Created March 17, 2014 11:08
delete object in S3
var aws = require('aws-sdk');
var BUCKET = 'node-sdk-sample-7271';
aws.config.loadFromPath(require('path').join(__dirname, './aws-config.json'));
var s3 = new aws.S3();
var params = {
Bucket: 'node-sdk-sample-7271',
Delete: { // required
Objects: [ // required
{