Skip to content

Instantly share code, notes, and snippets.

View bhuiyanmobasshir94's full-sized avatar
🎖️
Focused on achievement

Mobasshir Bhuiya bhuiyanmobasshir94

🎖️
Focused on achievement
View GitHub Profile
from fastapi import FastAPI, Request, HTTPException
from pydantic import BaseModel
import json
import requests
app = FastAPI()
PAGE_ACCESS_TOKEN = "EAAF9uJKilGYBO3t81bXI6n2BpXZBbj1JoWbzyZCbcwqdtigTHAZCiUSHowMcTUETT2ZCgZAkyrJVIqMWS2ZBm7ZAnp6ihB31oZCGn2Vc9kBIKLlYg7c2uMQZC6mzsiFBYa9adX6lAfjWERhSDpNPf49potdyEDZAk4qtwZCDdCovA89sYPt2Hv9FYwXQpRHZCCpZAOIOYrdfSA56iiAZDZD"
VERIFY_TOKEN = "ABCDE"
import pandas as pd
# Read the Excel file
df = pd.read_excel('/content/datadict_khaodao.xlsx')
# Group the DataFrame by column 'A'
grouped = df.groupby('table_nm')
# Create a new Excel writer object
with pd.ExcelWriter('/content/output_file.xlsx') as writer:
import streamlit as st
import sqlite3
import pandas as pd
from datetime import datetime, timedelta
# Function to calculate days left until a given date
def calculate_days_left(event_date):
current_date = datetime.now().date()
days_left = (event_date - current_date).days
return days_left
import pyautogui
import time
# Define the idle threshold in seconds
idle_threshold = 10 # Adjust as needed
idle_time = 0
# Store the initial mouse position
prev_mouse_position = pyautogui.position()
import os
import subprocess
from fastapi import FastAPI
app = FastAPI()
def run_command_in_folder(folder_path, command):
# Get the current working directory
import subprocess
import time
# Define the target server (e.g., Google's DNS server)
target_server = "8.8.8.8"
# Define the threshold for considering it as a drop-off (in milliseconds)
threshold_ms = 100 # Adjust this value as needed
def is_internet_up():
import speedtest
def check_speed():
st = speedtest.Speedtest()
download_speed = st.download() / 10**6 # Convert to Mbps
upload_speed = st.upload() / 10**6 # Convert to Mbps
print(f"Download Speed: {download_speed:.2f} Mbps")
print(f"Upload Speed: {upload_speed:.2f} Mbps")
from datetime import datetime, timedelta
from pprint import pprint
start_date_input=input("Please provide start date in this format(Oct 10 2023). \n>>> ")
start_date = datetime.strptime(start_date_input, "%b %d %Y")
timeline = {}
temp = start_date
for week in list(range(1,9)):
#!/bin/bash -x
VERBOSE=0
OS_NAME=
OS_VERSION=
OS_CODE_NAME=
ARCH=
export IP=
export DEBIAN_FRONTEND=noninteractive
[[ -z "$CREATE_AMI" ]] && export CREATE_AMI
import socket
def check_domain_exists(domain):
try:
socket.gethostbyname(domain)
return True
except socket.gaierror:
return False