Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
BugBounty

Mehtab Zafar mzfr

:octocat:
BugBounty
View GitHub Profile
@mzfr
mzfr / task.py
Last active May 25, 2018
task.py
View task.py
"""
Reading and Writing file in queue using asyncio
To run: python3 task.py <input_file> <output_file>
It was a task for my GSoC'18 selection under Honeynet(I failed!!)
"""
import asyncio
import sys
@mzfr
mzfr / Clean-it-up
Last active Jul 2, 2018
Remove empty files and subdirectories within a directory
View Clean-it-up
"""
requirements:
- tabulate
- argparse
"""
import os
import argparse
from tabulate import tabulate
@mzfr
mzfr / Correct_names.py
Created Jul 6, 2018
Rename Bad movies names to good one :)
View Correct_names.py
import os
import sys
from guessit import guessit
def main(path):
for folder in os.listdir(path):
movie_info = guessit(folder)
movie_name = movie_info['title']
old_path = os.path.join(path, folder)
View flurl.py
"""
A simple webserver that sends colors to curl & HTML to browsers.
Inspired by @chubin's work on curl compatible webservices.
"""
from flask import Flask
from flask import request
app = Flask(__name__)
View json2gsheet.py
import os
import json
import pygsheets
import pandas as pd
from pandas.io.json import json_normalize
OAUTHFILE = "" # path to the credential file
def read_json_files(path):
"""Reads multiple JSON files from the given path
View New-machine.md

New Machine

  • Firefox

    • copy ~.mozilla/firefox/<user-id>/chrome
  • Telegram

    • Download Telegram from https://desktop.telegram.org/
    • move extracted folder to ~/.apps/
    • Dracula theme from https://draculatheme.com/telegram/
@mzfr
mzfr / duplicate.py
Created Jan 19, 2019
Find all the duplicate line of codes using AST
View duplicate.py
"""
Python code clone detector,
using Abstract Syntax Trees.
"""
import ast
import collections
class Position(ast.NodeVisitor):
View File header lookup
lookup = [(b"SQLite", "DB"),
(b"[Content_Types].xml", "DOCX"),
(b"bin/bash", "SH"),
(b"announce36", "TORRENT"),
(b"GIF89a", "GIF"),
(b"IDA1\x00", "IDB"),
(b"\x1f\x8b\x08","GZ"),
(b'BM|\x11A', "BMP"),
(b'\xff\xd8\xff\xe0', "JPG"),
(b'!<arch>\ndebian-binary', "DEB"),
View Dictionary for the conversion of international morse code
{
"di-dah": "A",
"dah-di-di-dit": "B",
"dah-di-dah-dit": "C",
"dah-di-dit": "D",
"dit": "E",
"di-di-dah-dit": "F",
"dah-dah-dit": "G",
"di-di-di-dit": "H",
"di-dit": "I",
View DNAdecoder.py
#!/bin/python3
from textwrap import wrap
mapping = {"AAA": "a",
"AAC": "b",
"AAG": "c",
"AAT": "d",
"ACA": "e",
"ACC": "f",