Skip to content

Instantly share code, notes, and snippets.

View musahibrahimali's full-sized avatar
🥰
The expert has written more failed programs than the beginner

Musah Ibrahim Ali musahibrahimali

🥰
The expert has written more failed programs than the beginner
View GitHub Profile
@musahibrahimali
musahibrahimali / website_blocker.pyw
Created February 5, 2022 01:49
It is very good to control the websites a computer can visit especially when you want to control kid. in this gist we create a simple yet effective website blocker with python. the script can be rename to the .py extension to run as a normal python file. note that this is only texted on windows.
# the needed libraries
import time
from datetime import datetime as dt
# the host path
host_temp = r"C:\Users\<username>\folderName\Host File\hosts" # make a copy of the host file from the line below and replace this url string
host_path = r"C:\Windows\System32\drivers\etc\hosts" # The path to the original host file
redirect = "127.0.0.1"
website_list = [
# add as many websites as you want
@musahibrahimali
musahibrahimali / asci_images.py
Created February 5, 2022 01:41
Lets create ASCI images with python
import PIL.Image
ASCII_CHAR = ["@", "#", "S", "%", "?", "*", "+", ";", ":", ",", "."]
def resize_image(image, new_width=100):
width, height = image.size
ratio = height / width
new_height = int(new_width * ratio)
resized_image = image.resize((new_width, new_height))
@musahibrahimali
musahibrahimali / wifi_password_revealer.py
Last active February 5, 2022 01:42
This is a minimal python code to reveal the password for all wifi networks both private and public a device has connected to in the past
# importing subprocess
import subprocess
# getting meta data
meta_data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles'])
# decoding meta data
data = meta_data.decode('utf-8', errors ="backslashreplace")
# splitting data by line by line
@musahibrahimali
musahibrahimali / 2-image_processing.ipynb
Created October 18, 2021 22:48
2.Image_processing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.