Skip to content

Instantly share code, notes, and snippets.

View alirezapla's full-sized avatar
😮

alireza hajli alirezapla

😮
View GitHub Profile
#!/bin/bash
status=$(curl -I $1 2>/dev/null | head -n 1 | cut -d$' ' -f2)
while [ $status -ne 200 ];
do
echo ret is: [$status]
status=$(curl -I $1 2>/dev/null | head -n 1 | cut -d$' ' -f2)
done
#!/bin/bash
free=$(df -h / | tail -n 1 | awk '{print $4}')
total=$(df -h / | tail -n 1 | awk '{print $2}')
use=$(df -h / | tail -n 1 | awk '{print $5}')
echo Free/Total memory: $free / $total
echo Percentage: $use | sed 's/%//'
@alirezapla
alirezapla / xo.py
Last active December 14, 2022 20:03
from dataclasses import dataclass
import random
@dataclass
class States:
start: str = "start"
gameover: str = "gameover"
next: str = "next"
import schedule
import time
"""
period interval
input-> 12:22 hours,...
input-> :22 seconds,...
input-> 12 minutes,...
"""
import schedule
import time
"""
period type
input-> 12:22 hours,...
input-> :22 seconds,...
input-> 12 minutes,...
"""
import schedule
import time
"""
period interval
input-> 12:22 hours,...
input-> :22 seconds,...
input-> 12 minutes,...
"""