Skip to content

Instantly share code, notes, and snippets.

@hwpplayer1
Created June 6, 2026 05:33
Show Gist options
  • Select an option

  • Save hwpplayer1/abb5fb868e433cb518695e7e8424a3a4 to your computer and use it in GitHub Desktop.

Select an option

Save hwpplayer1/abb5fb868e433cb518695e7e8424a3a4 to your computer and use it in GitHub Desktop.
sistem_analiz.sh Linux Development Machine Requirements
#!/bin/bash
# Çıktı dosya adı
RAPOR_DOSYASI="rapor.txt"
# Renk tanımlamaları
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
BOLD='\033[1m'
# Rapor dosyasını sıfırla
> "$RAPOR_DOSYASI"
echo -e "${BLUE}${BOLD}==================================================" | tee -a "$RAPOR_DOSYASI"
echo -e " SİSTEM DONANIM VE PERFORMANS ANALİZİ" | tee -a "$RAPOR_DOSYASI"
echo -e "==================================================${NC}" | tee -a "$RAPOR_DOSYASI"
echo "Tarih: $(date)" >> "$RAPOR_DOSYASI"
# 1. DONANIM BİLEŞENLERİNİN LİSTELENMESİ
echo -e "\n${BOLD}[1/2] Donanım Bileşenleri Listeleniyor...${NC}" | tee -a "$RAPOR_DOSYASI"
echo "--------------------------------------------------" | tee -a "$RAPOR_DOSYASI"
# CPU Bilgisi
CPU_MODEL=$(lscpu | grep "Model name:" | sed 's/Model name:[[:space:]]*//')
CPU_LOGICAL=$(lscpu | grep "^CPU(s):" | awk '{print $2}')
CPU_CORES=$(lscpu | grep "^Core(s) per socket:" | awk '{print $4}')
echo -e "${BLUE}CPU:${NC} $CPU_MODEL ($CPU_CORES Gerçek Çekirdek / $CPU_LOGICAL İş Parçacığı)" | tee -a "$RAPOR_DOSYASI"
# GPU Bilgisi
GPU_INFO=$(lspci | grep -E "VGA|3D" | cut -d':' -f3 | sed 's/^[[:space:]]*//')
echo -e "${BLUE}GPU:${NC} $GPU_INFO" | tee -a "$RAPOR_DOSYASI"
# RAM Bilgisi
RAM_TOTAL=$(free -h | grep "Mem:" | awk '{print $2}')
RAM_GB=$(free -g | grep "Mem:" | awk '{print $2}')
echo -e "${BLUE}RAM (Toplam):${NC} $RAM_TOTAL" | tee -a "$RAPOR_DOSYASI"
# Disk Bilgisi
DISK_INFO=$(lsblk -d -o NAME,SIZE,TYPE,MODEL | grep -E "disk" | grep -v "zram")
echo -e "${BLUE}Fiziksel Diskler:${NC}\n$DISK_INFO" | tee -a "$RAPOR_DOSYASI"
# Ağ Kartı Bilgisi
NET_INFO=$(lspci | grep -i net | cut -d':' -f3 | sed 's/^[[:space:]]*//')
echo -e "${BLUE}Ağ Kartları:${NC}\n$NET_INFO" | tee -a "$RAPOR_DOSYASI"
echo "--------------------------------------------------" | tee -a "$RAPOR_DOSYASI"
# 2. DONANIM YETERLİLİK VE YÜZDELİK ANALİZ RAPORU
echo -e "\n${BOLD}[2/2] Donanım Yeterlilik Analiz Raporu${NC}" | tee -a "$RAPOR_DOSYASI"
echo "--------------------------------------------------" | tee -a "$RAPOR_DOSYASI"
SCORE=0
# CPU Puanlaması (Max 30)
if [ "$CPU_LOGICAL" -ge 8 ]; then SCORE=$((SCORE + 30)); elif [ "$CPU_LOGICAL" -ge 4 ]; then SCORE=$((SCORE + 20)); else SCORE=$((SCORE + 10)); fi
# RAM Puanlaması (Max 30)
if [ "$RAM_GB" -ge 15 ]; then SCORE=$((SCORE + 30)); elif [ "$RAM_GB" -ge 7 ]; then SCORE=$((SCORE + 22)); else SCORE=$((SCORE + 10)); fi
# Disk Türü Puanlaması (Max 25)
if echo "$DISK_INFO" | grep -iq "nvme"; then SCORE=$((SCORE + 25)); elif echo "$DISK_INFO" | grep -iq "ssd"; then SCORE=$((SCORE + 20)); else SCORE=$((SCORE + 10)); fi
# Grafik ve Ağ Uyumluluk Puanlaması (Max 15)
if echo "$NET_INFO" | grep -q "802.11ax"; then SCORE=$((SCORE + 15)); else SCORE=$((SCORE + 10)); fi
# Yüzdelik Hesaplama
POSITIVE_PCT=$SCORE
NEGATIVE_PCT=$((100 - POSITIVE_PCT))
echo -e "Analiz Sonucu: ${BOLD}100 üzerinden $POSITIVE_PCT Puan${NC}" | tee -a "$RAPOR_DOSYASI"
echo -e "${GREEN}Olumlu Skor (Donanım Yeterliliği): %$POSITIVE_PCT${NC}" | tee -a "$RAPOR_DOSYASI"
echo -e "${RED}Olumsuz Skor (Geliştirme Alanı): %$NEGATIVE_PCT${NC}" | tee -a "$RAPOR_DOSYASI"
echo "--------------------------------------------------" | tee -a "$RAPOR_DOSYASI"
# Özet Değerlendirme
if [ "$POSITIVE_PCT" -ge 85 ]; then
echo -e "${GREEN}${BOLD}Değerlendirme:${NC} Sisteminiz güncel ve yüksek hızlı bileşenlere sahip." | tee -a "$RAPOR_DOSYASI"
elif [ "$POSITIVE_PCT" -ge 65 ]; then
echo -e "${BLUE}${BOLD}Değerlendirme:${NC} Dengeli ve modern bir günlük kullanım bilgisayarı. NVMe SSD ve güncel işlemci performansı kurtarıyor ancak ağır yükler altında RAM sınırı hissedilebilir." | tee -a "$RAPOR_DOSYASI"
else
echo -e "${RED}${BOLD}Değerlendirme:${NC} Donanım performansı giriş seviyesinde." | tee -a "$RAPOR_DOSYASI"
fi
# 3. SİSTEME ÖZEL OPTİMİZASYON ÖNERİLERİ
if [ "$NEGATIVE_PCT" -gt 0 ]; then
echo -e "\n${BLUE}${BOLD}==================================================" | tee -a "$RAPOR_DOSYASI"
echo -e " SİSTEMİNİZİ HIZLANDIRACAK OPTİMİZASYONLAR" | tee -a "$RAPOR_DOSYASI"
echo -e "==================================================${NC}" | tee -a "$RAPOR_DOSYASI"
echo -e "${BOLD}Mevcut donanımınıza göre Ubuntu üzerinde yapabileceğiniz iyileştirmeler:${NC}\n" | tee -a "$RAPOR_DOSYASI"
echo -e "1. ${GREEN}ZRAM Yapılandırması:${NC} Sisteminizde halihazırda zram0 aktif görünüyor. Bu çok iyi! RAM sıkışmalarını önlemek için 'swappiness' değerini optimize edin:" | tee -a "$RAPOR_DOSYASI"
echo -e " -> Komut: sudo sysctl vm.swappiness=10" | tee -a "$RAPOR_DOSYASI"
echo -e "2. ${GREEN}Tarayıcı Ayarları:${NC} Chrome veya Firefox kullanırken 'Donanım İvmesi (Hardware Acceleration)' özelliğini mutlaka açın. Mendocino grafik kartınız video oynatırken işlemciye binen yükü hafifletir." | tee -a "$RAPOR_DOSYASI"
echo -e "3. ${GREEN}Masaüstü Performansı:${NC} Ağır GNOME eklentilerini devre dışı bırakın. Ayarlar > Kurumsal/Gizlilik kısmından animasyonları kapatarak pencerelerin anında açılmasını sağlayabilirsiniz." | tee -a "$RAPOR_DOSYASI"
echo -e "4. ${GREEN}NVMe Disk Sağlığı:${NC} Micron NVMe diskinizin tam performansta çalışması için periyodik fstrim işleminin açık olduğundan emin olun:" | tee -a "$RAPOR_DOSYASI"
echo -e " -> Komut: sudo systemctl enable --now fstrim.timer" | tee -a "$RAPOR_DOSYASI"
echo -e "==================================================" | tee -a "$RAPOR_DOSYASI"
fi
# Dosyadaki terminal renk kodlarını temizle
sed -i 's/\x1b\[[0-9;]*m//g' "$RAPOR_DOSYASI"
echo -e "\n${GREEN}${BOLD}✔ Analiz ve Optimizasyon önerileri '${RAPOR_DOSYASI}' dosyasına kaydedildi.${NC}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment