Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Ritiek Malhotra ritiek

🌴
On vacation
View GitHub Profile
@ritiek
ritiek / scan_vendors.py
Last active Sep 8, 2020
Scan devices on LAN to get their IP, MAC and vendor name
View scan_vendors.py
#!/usr/bin/env python
import logging
import urllib2 as urllib
import nmap
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
def scanNetwork(network):
@ritiek
ritiek / google_scraper.py
Last active Dec 22, 2017
Scrape links from google search
View google_scraper.py
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
search_term = 'hello'
"""
0 = page 1
10 = page 2
@ritiek
ritiek / folder_predict.py
Last active Nov 29, 2020
Keras predicting on all images in a directory
View folder_predict.py
from keras.models import load_model
from keras.preprocessing import image
import numpy as np
import os
# image folder
folder_path = '/path/to/folder/'
# path to model
model_path = '/path/to/saved/model.h5'
# dimensions of images
@ritiek
ritiek / README.md
Last active Feb 20, 2019
Aww yiss! Rick n' Roll Android Apps
View README.md
View keybase.md

Keybase proof

I hereby claim:

  • I am ritiek on github.
  • I am ritiek (https://keybase.io/ritiek) on keybase.
  • I have a public key ASA1qFuAESdfigezYxV8q4XPEY6hqSk8UHvogWNRJCsKJwo

To claim this, I am signing this object:

@ritiek
ritiek / hosts
Last active Aug 7, 2019
hosts file to block all GameRanger advertisements
View hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
@ritiek
ritiek / devenv.sh
Last active Jan 27, 2018
Setup rust-lang local development environment
View devenv.sh
# git clone https://github.com/rust-lang/rust
# cd rust
# <make changes to source if any>
# full build (1st time)
./x.py install
rustup toolchain link develop build/x86_64-unknown-linux-gnu/stage2
rustup default develop
rustc -V
@ritiek
ritiek / count.sh
Last active Dec 19, 2018
Count number of lines of code in a project
View count.sh
find . -name "*.py" -type f -exec grep . {} \; | wc -l
@ritiek
ritiek / wolfpedia.py
Last active Apr 28, 2019
Fetch information from wolfram and wikipedia using Flask API
View wolfpedia.py
import wolframalpha
import wikipedia
from wikipedia.exceptions import DisambiguationError
from flask import Flask
app = Flask(__name__)
client = wolframalpha.Client('T27H46-H3TH6GL545')
def wolframit(query):
You can’t perform that action at this time.