Skip to content

Instantly share code, notes, and snippets.

View OmkarKirpan's full-sized avatar
🎨

Omkar Kirpan OmkarKirpan

🎨
View GitHub Profile
@OmkarKirpan
OmkarKirpan / Server.py
Created December 5, 2018 10:11 — forked from jdkanani/Server.py
Python SimpleHTTPServer : Routing sample
#!/usr/bin/env python
import os
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
ROUTES = [
('/', '/var/www/doc-html')
]
class MyHandler(SimpleHTTPRequestHandler):
@OmkarKirpan
OmkarKirpan / functions.c
Created November 3, 2019 14:32 — forked from eatonphil/functions.c
Introduction to "Fun" C (using GCC)
/**
* This are a collection of examples for C 201.
* These combine concepts you may or may not be
* familiar with and are especially useful for
* students new to C. There is a lot of really
* cool stuff you can do in C without any cool
* languages.
*
* This is file in particular is an introduction
* to fun function usage in C.
@OmkarKirpan
OmkarKirpan / The Technical Interview Cheat Sheet.md
Created November 28, 2019 07:04 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo since a gist is too difficult to maintain as an open source endevaor and there is no way to version it. I have updated below, but I will not be able to keep this one up to date so please checkout the repo instead. The below is just for some preservation for those who stumble across here.






\

@OmkarKirpan
OmkarKirpan / slackmap.sh
Created December 2, 2019 19:17 — forked from jgamblin/slackmap.sh
Script to NMAP a network and Post Differences to Slack
#!/bin/sh
TARGETS="192.168.1.0/24"
OPTIONS="-v -T4 -F -sV"
date=$(date +%Y-%m-%d-%H-%M-%S)
cd /nmap/diffs
nmap $OPTIONS $TARGETS -oA scan-$date > /dev/null
slack(){
curl -F file=@diff-$date -F initial_comment="Internal Port Change Detected" -F channels=#alerts -F token=xxxx-xxxx-xxxx https://slack.com/api/files.upload
}
@OmkarKirpan
OmkarKirpan / OneDirect.js
Created February 11, 2021 07:44
OneDirect AutoRefresh Chats
// ==UserScript==
// @name OneDirect AutoRefresh Chats
// @namespace https://theunpaiddev.tumblr.com/
// @version 1.0
// @description Auto refresh Onedirect Chats
// @author Omkar Kirpan
// @match https://*.onedirect.in/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant none
@OmkarKirpan
OmkarKirpan / fix-wsl2-dns-resolution
Created June 14, 2021 18:24 — forked from coltenkrauter/fix-wsl2-dns-resolution
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@OmkarKirpan
OmkarKirpan / SimpleSmartContract.sol
Created July 22, 2021 15:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.17+commit.d19bba13.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.0;
contract SimpleSmartContract {}
@OmkarKirpan
OmkarKirpan / FilesReadFileExample.java
Created September 14, 2022 04:09
store decoded binary file to path
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Base64;
import java.util.List;
public class FilesReadFileExample {
public static void main(String[] args) {