Skip to content

Instantly share code, notes, and snippets.

@ritiek
ritiek / scan_vendors.py
Last active January 11, 2023 10:09
Scan devices on LAN to get their IP, MAC and vendor name
#!/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 December 22, 2017 07:01
Scrape links from google search
#!/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 November 6, 2022 13:23
Keras predicting on all images in a directory
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 February 20, 2019 13:46
Aww yiss! Rick n' Roll Android Apps

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:

If you have no idea what this is about. See https://github.com/ritiek/piano-rs.

Dragonborn Comes

FG(FB) (FB)J(BK) (BK)W(GJ)BGF x2

Kataware Doki

(qu) u u (nu) trre(ct)m e

@ritiek
ritiek / hosts
Last active July 3, 2023 05:16
hosts file to block all GameRanger advertisements
# 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 January 27, 2018 07:01
Setup rust-lang local development environment
# 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 December 19, 2018 13:37
Count number of lines of code in a project
find . -name "*.py" -type f -exec grep . {} \; | wc -l
@ritiek
ritiek / wolfpedia.py
Last active April 28, 2019 09:01
Fetch information from wolfram and wikipedia using Flask API
import wolframalpha
import wikipedia
from wikipedia.exceptions import DisambiguationError
from flask import Flask
app = Flask(__name__)
client = wolframalpha.Client('T27H46-H3TH6GL545')
def wolframit(query):