Skip to content

Instantly share code, notes, and snippets.

View mdmmn378's full-sized avatar
💭
InDeepSleep

Mamunur Rahaman Mamun mdmmn378

💭
InDeepSleep
View GitHub Profile
@mdmmn378
mdmmn378 / get_memory_size.py
Created January 25, 2025 04:17 — forked from philschmid/get_memory_size.py
Get needed GPU per precision for a Hugging Face Model Id
from typing import Dict, Union
from huggingface_hub import get_safetensors_metadata
import argparse
import sys
# Example:
# python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct
# Dictionary mapping dtype strings to their byte sizes
bytes_per_dtype: Dict[str, float] = {
import torch
import torch.nn as nn
import torch.optim as optim
# Generate some sample data
torch.manual_seed(0)
X = torch.rand((100, 2)) # 100 samples, 2 features
y = (X[:, 0] + X[:, 1] > 1).float().unsqueeze(1) # Binary target based on a simple rule
# Define a simple neural network
@mdmmn378
mdmmn378 / README.md
Created September 19, 2024 04:19
Discord Auto Updater
  1. Run > sudo crontab -e
  2. Append > 0 0 */2 * * /home/mamun/bin/install_discord.sh
@mdmmn378
mdmmn378 / ufw_plex.md
Created October 8, 2023 04:46 — forked from nmaggioni/ufw_plex.md
Plex Media Server UFW rule

/etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
@mdmmn378
mdmmn378 / tmux-cheatsheet.markdown
Created August 22, 2023 04:38 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mdmmn378
mdmmn378 / ffmpeg.md
Created July 10, 2023 04:27 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@mdmmn378
mdmmn378 / aproducer.py
Created June 9, 2023 21:14 — forked from dabeaz/aproducer.py
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:
@mdmmn378
mdmmn378 / rust-command-line-utilities.markdown
Created April 22, 2023 20:38 — forked from sts10/rust-command-line-utilities.markdown
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
// Logiops (Linux driver) configuration for Logitech MX Master 3.
// Includes gestures, smartshift, DPI.
// Tested on logid v0.2.3 - GNOME 3.38.4 on Zorin OS 16 Pro
// What's working:
// 1. Window snapping using Gesture button (Thumb)
// 2. Forward Back Buttons
// 3. Top button (Ratchet-Free wheel)
// What's not working:
// 1. Thumb scroll (H-scroll)
// 2. Scroll button