Skip to content

Instantly share code, notes, and snippets.

View madhurjain's full-sized avatar

Madhur Jain madhurjain

  • San Jose
View GitHub Profile
@madhurjain
madhurjain / windows_driver_commands.MD
Last active June 23, 2019 21:01
Windows Driver Commands

Windows Management Interface (WMI)

Find the correct driver name

wmic sysdriver get name

Then use this to delete the driver

wmic sysdriver where "name=drivernamehere" call delete
@madhurjain
madhurjain / docker_reference.md
Last active October 7, 2018 00:34
Docker Commands

Docker on Windows

  • Make sure Virtualization is Enabled in BIOS
  • Install Docker Toolbox on Windows from this link

Commands

Run Docker Image

docker run --name carnd -it -p 4567:4567 -v /c/Users/Test/project:/work udacity/controls_kit:latest
@madhurjain
madhurjain / snippets_trivia.MD
Created September 6, 2018 03:59
Interesting snippets found while writing code

Check size of a structure compile time in C

char (*__fail)(void)[sizeof(Struct_t)] = 1;
@madhurjain
madhurjain / git_quickref.MD
Last active June 23, 2019 03:12
Git Commands

Cherry-Pick from a different repo

git fetch <remote-git-url> <branch> && git cherry-pick SHA1
or
git remote add other https://example.link/repository.git
git fetch other

then normally do a cherry-pick

@madhurjain
madhurjain / windows_kernel_debugging.md
Last active September 28, 2018 23:01
Windows Kernel Debugging

Setting up Kernel Debug over USB 3.0

  • On the target computer, open a Command Prompt window as Administrator, and enter these commands: TargetName can be any name like dbgmachine
bcdedit /debug on
bcdedit /bootdebug on                 // <-- Optional. Only required to debug boot related issues.
bcdedit /dbgsettings usb targetname:TargetName
@madhurjain
madhurjain / handy_commands.md
Last active April 12, 2017 19:33
Handy Commands

Handy Commands

Generate Energy Report on Windows

  • Run elevated cmd prompt and type powercfg -energy
@madhurjain
madhurjain / windows_set_testsigning_on.bat
Created April 11, 2017 19:14
Set TESTSIGNING on for Windows Drivers Testing
bcdedit.exe -set loadoptions DISABLE_INTEGRITY_CHECKS
bcdedit.exe -set TESTSIGNING ON
@madhurjain
madhurjain / Building Boost with VS 2017.md
Last active May 29, 2018 07:47
Building Boost Library using Visual Studio 2017
  1. Download and Extract Boost
  2. Run bootstrap.bat
  3. Open generated project-config.jam and add path to MSVC 2017 like below
import option ; 
 
using msvc : 14.0 : "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\cl.exe"; 
 
option.set keep-going : false ; 
@madhurjain
madhurjain / AhoCorasick.pas
Last active December 9, 2020 14:35
AhoCorasick Implementation in Delphi / Pascal
unit AhoCorasick;
interface
uses Classes, Generics.Collections;
type
ptrNode = ^TNode;
TNode = record
id: Cardinal; // Node Id for debugging
@madhurjain
madhurjain / process.py
Created June 27, 2013 06:49
CSV file processing in python
import csv, re, traceback
# Read category file to dict
categoryFile = open('categories.csv', 'rb')
try:
categoryDict = csv.DictReader(categoryFile);
cDesc = []
mainCat = []
secondCat = []
thirdCat = []