Skip to content

Instantly share code, notes, and snippets.

View bmishra's full-sized avatar

Binayak Mishra bmishra

View GitHub Profile
@bmishra
bmishra / cache.go
Last active May 11, 2018 06:58
Simple in-memory cache
package cache
import (
"errors"
"time"
)
type request struct {
cmd string
key string
@bmishra
bmishra / app.go
Created January 30, 2018 08:19
curl: (52) Empty reply from server
package main
import (
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"time"
Privacy Policy
Dash built the Dash Cafe app as a Free app. This SERVICE is provided by Dash at no cost and is intended for use as is.
This page is used to inform website visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Dash Cafe unless otherwise defined in this Privacy Policy.
@bmishra
bmishra / add-user.sh
Created March 29, 2017 07:29
Add User #ubuntu
useradd -m -d /home/username -s /bin/bash username
mkdir /home/username/.ssh
echo "xxx" >> /home/username/.ssh/authorized_keys
chown -R username:username /home/username/.ssh
chmod 700 /home/username/.ssh
chmod 600 /home/username/.ssh/authorized_keys
adduser username sudo
@bmishra
bmishra / pr.md
Created March 3, 2017 07:25 — 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 = [email protected]: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: