Skip to content

Instantly share code, notes, and snippets.

View maisnamraju's full-sized avatar

Maisnam Raju Singh maisnamraju

View GitHub Profile

If you are using vagrant, you probably-statistically are using git. Make sure you have its binary folder on your path, because that path contains 'ssh.exe'.

Now, modify C:\vagrant\vagrant\embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\ssh.rb to comment out the faulty Windows check and add a real SSH check:

# if Util::Platform.windows?
  # raise Errors::SSHUnavailableWindows, :host => ssh_info[:host],
                                       # :port => ssh_info[:port],
                                       # :username => ssh_info[:username],
 # :key_path => ssh_info[:private_key_path]
@maisnamraju
maisnamraju / logger.js
Created May 5, 2016 13:38 — forked from rtgibbons/logger.js
Logger Library with winston
var app = require(process.cwd() + '/app');
var winston = require('winston');
var _ = require('lodash');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',
@maisnamraju
maisnamraju / pub-sub.js
Created August 1, 2016 12:19 — forked from reu/pub-sub.js
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");
@maisnamraju
maisnamraju / how-to-set-up-stress-free-ssl-on-os-x.md
Created February 27, 2018 01:17 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@maisnamraju
maisnamraju / go-soap-wsdl-using-http.go
Created June 17, 2019 07:53 — forked from novalagung/go-soap-wsdl-using-http.go
Example implementation of making SOAP call on WSDL web service using go with only net/http package. The full tutorial avaiable on https://medium.com/eaciit-engineering/soap-wsdl-request-in-go-language-3861cfb5949e
package main
import (
"bytes"
"crypto/tls"
"encoding/base64"
"encoding/xml"
"fmt"
"log"
"net/http"
@maisnamraju
maisnamraju / main.go
Created June 27, 2019 10:53 — forked from creack/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
@maisnamraju
maisnamraju / create-ssl-for-localhost
Last active September 24, 2019 04:44 — forked from itsMattShull/create-ssl-for-localhost
Command to create a key.pem and cert.pem for localhost for ubuntu
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout key.pem \
-new \
-out cert.pem \
-subj /CN=localhost \
-reqexts SAN \
-extensions SAN \
@maisnamraju
maisnamraju / client.js
Last active February 25, 2020 10:03 — forked from agrueneberg/client.html
HMAC-SHA256 sample code.
var http, crypto, sharedSecret, query, signature;
http = require("http");
crypto = require("crypto");
sharedSecret = "super-secret";
body = { "test": "123" };
signature = crypto.createHmac("sha256", sharedSecret).update(body).digest("hex");
http.post({
[
{
"name":"Ahmednagar",
"tahasil" : [ "Akola", "Jamkhed", "Karjat", "Kopargaon", "Nagar", "Nevasa", "Parner", "Pathardi", "Rahta", "Rahuri", "Sangamner", "Shevgaon", "Shrigonda", "Shrirampur" ]
},
{
"name":"Akola",
"tahasil":[ "Akola", "Akot", "Balapur", "Barshitakli", "Murtijapur", "Patur", "Telhara" ]
[
{
"name":"अहमदनगर",
"tahasil" : [ "अकोले", "जामखेड", "कर्जत", "कोपरगाव", "नगर", "नेवासा", "पारनेर", "पाथर्डी", "राहाता", "राहुरी", "संगमनेर", "शेवगांव", "श्रीगोंदा", "श्रीरामपूर" ]
},
{
"name":"अकोला",