Skip to content

Instantly share code, notes, and snippets.

View SharafatKarim's full-sized avatar
🎯
focusing...

Sharafat Karim SharafatKarim

🎯
focusing...
View GitHub Profile
@SharafatKarim
SharafatKarim / telegram-all-users-in-group-list-gen.py
Created February 4, 2026 08:40
Generate list of all users (userid) in Telegram...
from telethon.sync import TelegramClient
from telethon.tl.functions.channels import GetParticipantsRequest
from telethon.tl.types import ChannelParticipantsSearch
from telethon.sessions import StringSession
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
@SharafatKarim
SharafatKarim / Linux Community structure.md
Created May 8, 2025 05:51
A structure that can be followed for building a Linux based coummunity.

PSTU Linux Society Index

Server

  • Welcome - Say hi and introduce yourself!
  • Guides ⭐ - Must-read resources for all Linux users.
  • News - Stay updated with Linux news.
  • Announcements - Important community updates.
  • Invitation - Invite friends to join.
  • Events - Hackathons, meetups, and more.

linux-server

Initial Linux Server Setup Guide

This guide covers the initial setup process for a new Linux server, focusing on basic security and maintenance tasks.

1. Update and Upgrade System Packages (Must-Do)

Keeping your system packages up to date is crucial for security and stability.

@SharafatKarim
SharafatKarim / IUPC contest sites blocking script.bat
Created November 30, 2024 01:36
A simple windows batch script to block every single unwanted websites, except one!
@echo off
setlocal enabledelayedexpansion
:menu
cls
echo Site-Blocker
echo -----------------
echo 1. Block everything except toph.co and its subdomains
echo 2. Restore hosts file from backup
echo 3. Exit
@SharafatKarim
SharafatKarim / break.sh
Created July 24, 2023 09:30
A bash script to remind you to take a break once in 20 minutes! (128K average ram usage)
#!/bin/bash
# Function to display the break reminder notification
function show_notification()
{
notify-send "Take a Break" "It's time for a 20-minute break!"
}
# Main loop to remind every 20 minutes
while true; do
# sharafat specials
# bash script to automate running a single c file
#
# to use, just put those lines in your bashrc/ zshrc,
# restart your shell or source from bashrc/ zshrc
# in any directory you can just type
# cl file_path/file_name.cpp
#
# (c file compile and run and then delete the compiled binary, all in one)
# it should work out of the box for c and c++
@SharafatKarim
SharafatKarim / pymongo_to_csv.py
Created January 22, 2023 13:05
A simple program to convert pymongo data to csv file by using 'pymongo' and 'pandas'
# @Author: Sharafat Karim
# @Date: 6:59 PM Sunday, 22 January 2023
# @Email: sharafat2004@gmail.com
# @Last modified time: 6:59 PM Sunday, 22 January 2023
# @Credit: https://kb.objectrocket.com/mongo-db/export-mongodb-documents-as-csv-html-and-json-files-in-python-using-pandas-347
# Pip packages import
try:
# library import
import pymongo
@SharafatKarim
SharafatKarim / tic_tac_toe.py
Last active November 4, 2023 08:39
Tick-tack-toe game with python. Supports singleplayer (easy mode for now) and multiplayer!
# Global variables
one = "1"
two = "2"
three = "3"
four = "4"
five = "5"
six = "6"
seven = "7"
eight = "8"
nine = "9"
@SharafatKarim
SharafatKarim / simple_two_cipher.py
Created November 16, 2022 04:08
Caesar Cipher and The Vigenère Cipher - encoder or decoder
# Caesar Cipher!
def decoder(message, offset):
result=""
for i in range(len(message)):
if not(ord("a")<=ord(message[i])<=ord("z")):
result+=message[i]
continue
elif ord(message[i])+offset>ord("z"):
result += chr(ord(message[i])-26+offset)