Skip to content

Instantly share code, notes, and snippets.

View OmkarKirpan's full-sized avatar
🎨

Omkar Kirpan OmkarKirpan

🎨
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / rpi3_iot_server.md
Created November 26, 2018 09:45 — forked from xoseperez/rpi3_iot_server.md
Raspberry Pi 3 with Mosquitto, Node-RED, InfluxDB, Grafana and Nginx (as a reverse proxy)
@OmkarKirpan
OmkarKirpan / strong-pm-install.md
Created September 17, 2018 11:41 — forked from tomysmile/strong-pm-install.md
Strong-PM install script for new Digital Ocean droplet Ubuntu 14.x w/ node x

install system pre-req

sudo apt-get install build-essential sqlite git

install strong-pm

sudo npm install -g strong-pm --unsafe-perm
@OmkarKirpan
OmkarKirpan / country
Created September 4, 2018 07:57 — forked from psamaan/country
Countries Select Option List
<select name="Country">
<option value="" selected="selected">Select Country</option>
<option value="United States">United States</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>