Skip to content

Instantly share code, notes, and snippets.

View raghavmri's full-sized avatar
🎯
Focusing

Raghav Mrituanjaya raghavmri

🎯
Focusing
View GitHub Profile
# FCFS Scheduling Algorithm Implementation in Python
def find_waiting_time(processes, n, burst_time, waiting_time):
waiting_time[0] = 0
for i in range(1, n):
waiting_time[i] = burst_time[i-1] + waiting_time[i-1]
def find_turn_around_time(processes, n, burst_time, waiting_time, turnaround_time):
for i in range(n):
turnaround_time[i] = burst_time[i] + waiting_time[i]
#!/bin/bash
set -euo pipefail
# === Variables ===
USERNAME="username" # Change this
RPC_PASSWORD="password123" # Change this
echo "📦 Installing Transmission..."
sudo apt-get update -y
sudo apt-get install -y transmission-daemon jq
#!/bin/bash
set -euo pipefail
# --- Helper: detect package manager ---
detect_pkg_mgr() {
if command -v apt-get &>/dev/null; then echo "apt-get"
elif command -v yum &>/dev/null; then echo "yum"
elif command -v dnf &>/dev/null; then echo "dnf"
elif command -v pacman &>/dev/null; then echo "pacman"
elif command -v zypper &>/dev/null; then echo "zypper"
#!/bin/bash
# Check for a URL argument
if [ -z "$1" ]; then
echo "Usage: $0 <URL>"
exit 1
fi
URL=$1
#!/bin/bash
# ==============================================================================
# Configuration Variables - Edit these values as needed
# ==============================================================================
DB_NAME="wordpress"
DB_USER="wordpressuser"
DB_PASSWORD="your_strong_password"
WP_URL="https://wordpress.org/latest.tar.gz"
WP_DIR="/var/www/html"
@raghavmri
raghavmri / app.py
Created January 12, 2023 11:57
Automatic Attendance System
import numpy as np
import speech_recognition as sr
import cv2
import face_recognition
from datetime import datetime
from core import *
from db import *
from vars import *
from art import text2art
@raghavmri
raghavmri / Concatenation.py
Created December 24, 2022 07:37
Added Two lists
import time
a = []
b = []
for i in range(1000000): # Adding 1000000 element to both the lists
a.append(i)
b.append(i+10)
start_time = time.time()
c = a+b # Adding The lists using + operator
print("Time Taken To Concatenate using + Operator {}s".format(round(time.time()-start_time, 4)))
[Unit]
Description = pocketbase
[Service]
Type = simple
User = YOUR_USER
Group = YOUR_GROUP
LimitNOFILE = 4096
Restart = always
RestartSec = 5s
console.log("Hello World!")
import random
import string
# In this video, we'll create a simple random password generator for staying safe.
# Let's import the required modules first
# Now we will create a function to generate random characters