This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check for a URL argument | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <URL>" | |
exit 1 | |
fi | |
URL=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description = pocketbase | |
[Service] | |
Type = simple | |
User = YOUR_USER | |
Group = YOUR_GROUP | |
LimitNOFILE = 4096 | |
Restart = always | |
RestartSec = 5s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Hello World!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
NewerOlder