Skip to content

Instantly share code, notes, and snippets.

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

Hamza Abbad Hamza5

🏠
Working from home
View GitHub Profile
@slowpeek
slowpeek / nvidia-smi
Last active February 26, 2025 02:18
nvidia-smi dmon adapter: 525, 530, 535, 545
#!/usr/bin/env bash
# MIT license (c) 2022-2024 https://github.com/slowpeek
# Homepage: https://gist.github.com/slowpeek/006680bb06e671bc489d4a3274ff3d19
: <<'README'
--- THIS SCRIPT IS NO LONGER MAINTAINED ---
@madkoding
madkoding / pair-dual-boot-bluetooth.md
Last active April 26, 2025 17:57
Pairing bluetooth devices in dual boot with Linux Ubuntu and Windows 10/11

Pairing Bluetooth Devices in Dual Boot with Linux Ubuntu and Windows 10/11

Introduction

This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.

Instructions

1. Pair in Linux First

  • Pair your Bluetooth device in Linux. This is crucial to ensure the LinkKey remains consistent.
  • Note: Do not re-pair the device in Linux after completing the pairing in Windows.
@tylerneylon
tylerneylon / rwlock.py
Last active January 15, 2025 00:16
A simple read-write lock implementation in Python.
# -*- coding: utf-8 -*-
""" rwlock.py
A class to implement read-write locks on top of the standard threading
library.
This is implemented with two mutexes (threading.Lock instances) as per this
wikipedia pseudocode:
https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Using_two_mutexes
@ibigbug
ibigbug / flask-serve-static.py
Created June 24, 2015 06:07
Very simple static folder server using Flask
from flask import Flask
from flask import request
from flask import jsonify
from flask import send_from_directory
app = Flask(__name__)
@app.route('/', defaults=dict(filename=None))
@turicas
turicas / email_utils.py
Last active August 1, 2024 15:47
Send emails easily in Python (with attachments and multipart)
#!/usr/bin/env python
# coding: utf-8
# This little project is hosted at: <https://gist.github.com/1455741>
# Copyright 2011-2020 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
import os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText