Skip to content

Instantly share code, notes, and snippets.

View karnikamit's full-sized avatar
:shipit:
2B || !2B

Amitkumar Karnik karnikamit

:shipit:
2B || !2B
View GitHub Profile
@karnikamit
karnikamit / quickpick
Created July 15, 2018 09:06 — forked from Dyrcona/quickpick
A bash script to batch git cherry-pick of many commits from a single source branch. It can become a new git command if you save it in your path with a name like git-quickpick. Then, you can run it like so `git quickpick foo/bar'. Very handy, that.
#!/bin/bash
# Author: Thomas Berezansky <tsbere@mvlc.org>
# Author: Jason Stephenson <jason@sigio.com>
#
# Feel free to use and to share this script in anyway you like.
# This script is intended as a shortcut for the git cherry-pick
# command when you have several commits that you want to cherry-pick
# into your local branch from another branch. It often results in a
@karnikamit
karnikamit / cdp.py
Created March 28, 2018 05:40 — forked from trhura/cdp.py
A small python script for cdp device discovery
#! /usr/bin/env python
# A small script for cdp devices discovery
import sys
import pcapy
import socket
from dpkt import ethernet
from dpkt import cdp
from docopt import docopt
@karnikamit
karnikamit / git-cheat-sheet.md
Last active September 18, 2017 11:38 — forked from iansheridan/git-cheat-sheet.md
A cheat sheet for GIT

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

"""
Get both a and b attributes, here 0 is a valid value.
Don't use comparison==0
What if c = '', its invalid!
"""
class A(object):
a = 1
@karnikamit
karnikamit / client.py
Last active August 29, 2015 14:21 — forked from yoavram/client.py
import requests
#http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
url = "http://localhost:5000/"
fin = open('simple_table.pdf', 'rb')
files = {'file': fin}
try:
r = requests.post(url, files=files)
print r.text