<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hosam Hani on Medium]]></title>
        <description><![CDATA[Stories by Hosam Hani on Medium]]></description>
        <link>https://medium.com/@s0sta?source=rss-0643e61a3930------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*R3RzFqwG7tfd_gpGhDtxiw.jpeg</url>
            <title>Stories by Hosam Hani on Medium</title>
            <link>https://medium.com/@s0sta?source=rss-0643e61a3930------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 04:23:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@s0sta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[إصلاح: فشل bind() (98: العنوان قيد الاستخدام بالفعل)]]></title>
            <link>https://s0sta.medium.com/%D8%A5%D8%B5%D9%84%D8%A7%D8%AD-%D9%81%D8%B4%D9%84-bind-98-%D8%A7%D9%84%D8%B9%D9%86%D9%88%D8%A7%D9%86-%D9%82%D9%8A%D8%AF-%D8%A7%D9%84%D8%A7%D8%B3%D8%AA%D8%AE%D8%AF%D8%A7%D9%85-%D8%A8%D8%A7%D9%84%D9%81%D8%B9%D9%84-812b8b08c498?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/812b8b08c498</guid>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[sysadmin]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sun, 08 Nov 2026 20:22:23 GMT</pubDate>
            <atom:updated>2026-11-08T20:22:23.484Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKFF5PoJhWkSms9hOR7xeg.gif" /></figure><h3>‏المنفذ ليس معطوبًا. شيء آخر يستخدمه.‏</h3><p>‏فشل ⁦bind⁩() برمز 98: العنوان قيد الاستخدام بالفعل. خدمتك سليمة. شيء آخر وصل إلى المنفذ قبلك.‏</p><h3>‏شخّص‏</h3><pre>ss -tlnp | grep &#39;:80 &#39;</pre><p>‏كل مقبس ⁦TCP⁩ يستمع، مع اسم العملية ومعرّفها. شغّله بـ ⁦sudo⁩، وإلا بقي عمود العملية فارغًا.‏</p><pre>lsof -i :80</pre><p>‏الإجابة نفسها من أداة أخرى، مع المستخدم الذي يملك العملية.‏</p><pre>ps -fp 2231</pre><p>‏سطر الأمر الكامل، والعملية الأب، ووقت البداية لذلك المعرّف. الآن تعرف ما هو ومن أين جاء.‏</p><h3>‏أصلِح‏</h3><pre>systemctl stop apache2</pre><p>‏إن كان المنفذ ملكًا لخدمة أخرى، فأوقفها بشكل صحيح بدلًا من قتلها.‏</p><pre>systemctl disable apache2</pre><p>‏وإلا فإنها ستأخذ المنفذ مجددًا عند إعادة الإقلاع التالية، وتعود إلى هنا في الثالثة فجرًا.‏</p><pre>kill 2231</pre><p>‏إن كانت عملية شاردة، مثل نسخة قديمة من تطبيقك، فاطلب منها التوقف. استخدم -9 فقط إن تجاهلتك.‏</p><h3>‏امنع‏</h3><p>‏<strong>منفذ واحد، مالك واحد</strong> — احتفظ بقائمة قصيرة بأي خدمة تملك 80 و443 و3306 و5432 على كل خادم.‏</p><p>‏<strong>⁦ss⁩ ⁦-tlnp⁩ بعد كل تثبيت</strong> — بعض الحزم تبدأ خدمتها الخاصة لحظة تثبيتها. خادم ويب جاء كتبعية حالة كلاسيكية.‏</p><p>‏<strong>اربط الخدمات الداخلية بـ 127.0.0.1</strong> — قاعدة بيانات أو ذاكرة مؤقتة تستخدمها التطبيقات المحلية فقط لا سبب لها للاستماع على 0.0.0.0. تعارضات أقل، وتعريض أقل للشبكة.‏</p><h3>‏الفكرة الأساسية‏</h3><p>‏رسالة الخطأ تخبرك بالمنفذ أصلًا. أمر ⁦ss⁩ واحد يخبرك بالباقي.‏</p><p>‏المنفذ ليس معطوبًا. شيء آخر يستخدمه.‏</p><p>‏ما كان المالك المفاجئ لمنفذك؟‏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=812b8b08c498" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix: bind() Failed (98: Address Already in Use)]]></title>
            <link>https://s0sta.medium.com/fix-bind-failed-98-address-already-in-use-aac3812c70db?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/aac3812c70db</guid>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sun, 08 Nov 2026 20:21:21 GMT</pubDate>
            <atom:updated>2026-11-08T20:21:21.091Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKFF5PoJhWkSms9hOR7xeg.gif" /></figure><h3>The port is not broken. Something else is using it.</h3><p>bind() failed (98: Address already in use). Your service is fine. Something else got to the port first.</p><h3>Diagnose</h3><pre>ss -tlnp | grep &#39;:80 &#39;</pre><p>Every listening TCP socket, with the process name and PID. Run it with sudo, or the process column stays empty.</p><pre>lsof -i :80</pre><p>The same answer from a different tool, including the user that owns the process.</p><pre>ps -fp 2231</pre><p>The full command line, parent process and start time of that PID. Now you know what it is and where it came from.</p><h3>Fix</h3><pre>systemctl stop apache2</pre><p>If the port belongs to another service, stop it properly instead of killing it.</p><pre>systemctl disable apache2</pre><p>Otherwise it takes the port again on the next reboot and you are back here at 3 AM.</p><pre>kill 2231</pre><p>If it is a stray process, like an old copy of your app, ask it to stop. Use -9 only if it ignores you.</p><h3>Prevent</h3><p><strong>One port, one owner</strong> — keep a short list of which service owns 80, 443, 3306 and 5432 on each server.</p><p><strong>ss -tlnp after every install</strong> — some packages start their own service the moment they are installed. A web server pulled in as a dependency is a classic.</p><p><strong>Bind internal services to 127.0.0.1</strong> — a database or cache that only local apps use has no reason to listen on 0.0.0.0. Fewer clashes, and less exposed to the network.</p><h3>The key insight</h3><p>The error message already tells you the port. One ss command tells you the rest.</p><p>The port is not broken. Something else is using it.</p><p>What was the surprise owner of your port?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aac3812c70db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[تسعة أوامر من systemctl وjournalctl لكل خادم]]></title>
            <link>https://s0sta.medium.com/%D8%AA%D8%B3%D8%B9%D8%A9-%D8%A3%D9%88%D8%A7%D9%85%D8%B1-%D9%85%D9%86-systemctl-%D9%88journalctl-%D9%84%D9%83%D9%84-%D8%AE%D8%A7%D8%AF%D9%85-cc5fe8af7078?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc5fe8af7078</guid>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[it-infrastructure]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sun, 08 Nov 2026 20:20:20 GMT</pubDate>
            <atom:updated>2026-11-08T20:20:20.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yQxE5lRqzUEM1r5LAUHheQ.gif" /></figure><h3>‏اقرأ السجلات قبل أن تعيد التشغيل.‏</h3><p>‏في كل خادم لينكس حديث تقريبًا، تُدار الخدمات بواسطة ⁦systemd⁩. تسعة أوامر تغطي معظم ما ستحتاجه.‏</p><h3>‏التحكّم‏</h3><pre>systemctl restart nginx</pre><p>‏إيقاف كامل ثم تشغيل. بسيط، لكن الاتصالات المفتوحة تنقطع للحظة.‏</p><pre>systemctl reload nginx</pre><p>‏يعيد قراءة الإعدادات دون إيقاف العملية. لا تدعمه كل الخدمات، لكن حين تدعمه لا يلاحظ المستخدمون شيئًا.‏</p><pre>systemctl enable --now nginx</pre><p>‏تشغيل الآن وعند كل إقلاع. مهمّتان بأمر واحد.‏</p><h3>‏الفحص‏</h3><pre>systemctl status nginx</pre><p>‏يعمل أو لا، ومعرّف العملية الرئيسية، واستخدام الذاكرة، وآخر أسطر السجل. دائمًا الأمر الأول.‏</p><pre>systemctl --failed</pre><p>‏كل وحدة في حالة فشل. أول ما تشغّله بعد إعادة الإقلاع.‏</p><pre>systemctl cat nginx</pre><p>‏ملف الوحدة مع كل التجاوزات، تمامًا كما تراها ⁦systemd⁩. هذا ينهي كثيرًا من الحيرة: لكنني غيّرت ذلك الإعداد.‏</p><h3>‏السجلات‏</h3><pre>journalctl -u nginx -f</pre><p>‏متابعة سجلات خدمة واحدة مباشرةً، مثل ⁦tail⁩ ⁦-f⁩.‏</p><pre>journalctl -u nginx --since &quot;1 hour ago&quot;</pre><p>‏نافذة زمنية فقط. يفهم أيضًا “⁦today⁩” و”⁦yesterday⁩” والتواريخ المحددة.‏</p><pre>journalctl -p err -b</pre><p>‏الأخطاء وما هو أسوأ فقط، منذ آخر إقلاع. فحص صحة للجهاز كله في ثلاثين ثانية.‏</p><h3>‏العادة التي تستحقّ البناء‏</h3><p>‏حين يفشل شيء، شغّل ⁦systemctl⁩ ⁦status⁩ وjournalctl ⁦-xeu⁩ قبل أن تعيد التشغيل. إعادة التشغيل غالبًا تُخفي العَرَض وتأخذ التفسير معه.‏</p><p>‏اقرأ السجلات قبل أن تعيد التشغيل.‏</p><p>‏أي أمر من أوامر ⁦systemd⁩ تستخدمه أكثر؟‏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc5fe8af7078" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[9 systemctl and journalctl Commands for Every Server]]></title>
            <link>https://s0sta.medium.com/9-systemctl-and-journalctl-commands-for-every-server-b64db6356089?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/b64db6356089</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[it-infrastructure]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sysadmin]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sun, 08 Nov 2026 20:10:00 GMT</pubDate>
            <atom:updated>2026-11-08T20:10:00.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yQxE5lRqzUEM1r5LAUHheQ.gif" /></figure><h3>Read the logs before you restart.</h3><p>On almost every modern Linux server, services are managed by systemd. Nine commands cover most of what you will ever need.</p><h3>Control</h3><pre>systemctl restart nginx</pre><p>A full stop and start. Simple, but open connections drop for a moment.</p><pre>systemctl reload nginx</pre><p>Re-read the configuration without stopping the process. Not every service supports it, but when it does, users notice nothing.</p><pre>systemctl enable --now nginx</pre><p>Start it right now and on every boot. Two jobs, one command.</p><h3>Inspect</h3><pre>systemctl status nginx</pre><p>Running or not, the main PID, memory use, and the last log lines. Always the first command.</p><pre>systemctl --failed</pre><p>Every unit that is in a failed state. The first thing to run after a reboot.</p><pre>systemctl cat nginx</pre><p>The unit file plus every override, exactly as systemd sees it. This ends a lot of “but I changed that setting” confusion.</p><h3>Logs</h3><pre>journalctl -u nginx -f</pre><p>Follow the logs of one service live, like tail -f.</p><pre>journalctl -u nginx --since &quot;1 hour ago&quot;</pre><p>Only a time window. It also understands “today”, “yesterday” and exact dates.</p><pre>journalctl -p err -b</pre><p>Only errors and worse, since the last boot. A thirty-second health check for the whole machine.</p><h3>The habit worth building</h3><p>When something fails, run systemctl status and journalctl -xeu before you restart. A restart often makes the symptom disappear and takes the explanation with it.</p><p>Read the logs before you restart.</p><p>Which systemd command do you use most?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b64db6356089" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[متى تستخدم kill ومتى تستخدم kill -9]]></title>
            <link>https://s0sta.medium.com/%D9%85%D8%AA%D9%89-%D8%AA%D8%B3%D8%AA%D8%AE%D8%AF%D9%85-kill-%D9%88%D9%85%D8%AA%D9%89-%D8%AA%D8%B3%D8%AA%D8%AE%D8%AF%D9%85-kill-9-4381d5ac12c3?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/4381d5ac12c3</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[sysadmin]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sun, 08 Nov 2026 19:55:46 GMT</pubDate>
            <atom:updated>2026-11-08T19:55:46.616Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j8-m9mdQMIMdIYtYdanflg.gif" /></figure><h3>‏الإشارة 15 تطلب، والإشارة 9 تأخذ.‏</h3><p>‏⁦kill⁩ -9 هو أمر لينكس الذي يلجأ إليه الناس مبكّرًا جدًا.‏</p><p>‏الأمر ⁦kill⁩ ⁦PID⁩ يرسل ⁦SIGTERM⁩، أي الإشارة رقم 15. إنه طلب: توقّف من فضلك. تستطيع العملية التقاطه، وإنهاء الطلب الذي تعالجه، وتفريغ البيانات إلى القرص، وحذف ملف القفل، ثم الخروج بنظافة. هذا ما يرسله ⁦systemctl⁩ ⁦stop⁩ أولًا.‏</p><p>‏الأمر ⁦kill⁩ -9 ⁦PID⁩ يرسل ⁦SIGKILL⁩، أي الإشارة رقم 9. إنه ليس طلبًا. تزيل النواة العملية فورًا. لا ترى العملية الإشارة أبدًا، ولا تستطيع التنظيف ولا الرفض.‏</p><h3>‏أين يخطئ -9‏</h3><p>‏قاعدة بيانات قُتلت بـ -9 قد تحتاج إلى استعادة بعد الانهيار عند التشغيل التالي، وكل ما لم تُكتبه بعد يكون قد ضاع.‏</p><p>‏تطبيق قُتل بـ -9 قد يترك ملف ⁦PID⁩ أو ملف قفل قديمًا، ثم يرفض العمل لأنه يظن أنه ما زال يعمل.‏</p><p>‏قد تُترك العمليات الفرعية خلفها وهي ما زالت تحتجز منافذ أو ملفات.‏</p><h3>‏الترتيب الصحيح‏</h3><pre>kill PID</pre><p>‏انتظر خمس إلى عشر ثوانٍ.‏</p><pre>ps -p PID</pre><p>‏تحقّق من أنه ما زال موجودًا. عندها فقط استخدم ⁦kill⁩ -9.‏</p><h3>‏تحفّظان صادقان‏</h3><p>‏العملية الزومبي (الحالة ⁦Z⁩) ميتة أصلًا، ولن تزيلها أي إشارة؛ الحل هو العملية الأم.‏</p><p>‏العملية العالقة في الحالة ⁦D⁩، التي تنتظر إدخالًا أو إخراجًا على القرص أو الشبكة، لن تموت حتى يعود ذلك الإدخال، ولا حتى بـ -9.‏</p><p>‏الإشارة 15 تطلب، والإشارة 9 تأخذ. اطلب أولًا.‏</p><p>‏أيّهما ردّ فعلك التلقائي؟‏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4381d5ac12c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kill vs kill -9: SIGTERM and SIGKILL]]></title>
            <link>https://s0sta.medium.com/kill-vs-kill-9-sigterm-and-sigkill-d854b058f778?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/d854b058f778</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 20:21:00 GMT</pubDate>
            <atom:updated>2026-11-07T20:21:00.471Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j8-m9mdQMIMdIYtYdanflg.gif" /></figure><h3>SIGTERM asks. SIGKILL takes.</h3><p>kill -9 is the Linux command people reach for too early.</p><p>kill PID sends SIGTERM, signal 15. It is a request: please stop. The process can catch it, finish the request it is handling, flush data to disk, remove its lock file and exit cleanly. This is what systemctl stop sends first.</p><p>kill -9 PID sends SIGKILL, signal 9. It is not a request. The kernel removes the process immediately. The process never sees the signal, cannot clean up and cannot refuse.</p><h3>Where -9 goes wrong</h3><p>A database killed with -9 may need crash recovery on the next start, and anything it had not written yet is gone.</p><p>An app killed with -9 can leave a stale PID or lock file behind, and then refuses to start because it thinks it is still running.</p><p>Child processes can be left behind, still holding ports or files.</p><h3>The right order</h3><pre>kill PID</pre><p>Wait five to ten seconds.</p><pre>ps -p PID</pre><p>Check it is still there. Only if it is, use kill -9.</p><h3>Two honest caveats</h3><p>A zombie process (state Z) is already dead, so no signal will remove it; the fix is its parent.</p><p>A process stuck in state D, waiting on disk or network I/O, will not die until that I/O returns, not even with -9.</p><p>SIGTERM asks. SIGKILL takes. Ask first.</p><p>Which one is your reflex?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d854b058f778" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[إصلاح: لا توجد مساحة متبقية على الجهاز]]></title>
            <link>https://s0sta.medium.com/%D8%A5%D8%B5%D9%84%D8%A7%D8%AD-%D9%84%D8%A7-%D8%AA%D9%88%D8%AC%D8%AF-%D9%85%D8%B3%D8%A7%D8%AD%D8%A9-%D9%85%D8%AA%D8%A8%D9%82%D9%8A%D8%A9-%D8%B9%D9%84%D9%89-%D8%A7%D9%84%D8%AC%D9%87%D8%A7%D8%B2-67ebdc59e159?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/67ebdc59e159</guid>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 20:19:55 GMT</pubDate>
            <atom:updated>2026-11-07T20:19:55.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1x_Z3maStiTqpNMZ6iFmHA.gif" /></figure><h3>‏الأقراص الممتلئة لا تحدث فجأة. إنها فقط بلا مراقبة.‏</h3><p>‏لا توجد مساحة متبقية على الجهاز. الخطأ الذي يوقف قواعد البيانات وعمليات النشر والنسخ الاحتياطي في اللحظة نفسها.‏</p><h3>‏شخّص‏</h3><pre>df -h</pre><p>‏أي نظام ملفات ممتلئ. يُظهر عمود ⁦Use⁩% أين يجب أن تبحث.‏</p><pre>df -i</pre><p>‏تحقّق من الـ ⁦inodes⁩ أيضًا. قد ينفد القرص من الـ ⁦inodes⁩ بسبب ملايين الملفات الصغيرة بينما ما يزال ⁦df⁩ ⁦-h⁩ يُظهر مساحة حرة.‏</p><pre>du -xh --max-depth=1 / | sort -h</pre><p>‏أكبر المجلدات على ذلك القرص، والأكبر في الأسفل. أعِد الأمر بعمق مستوى واحد حتى تجد السبب.‏</p><h3>‏أصلِح‏</h3><pre>journalctl --vacuum-size=200M</pre><p>‏يمكن أن ينمو سجل ⁦systemd⁩ بصمت حتى يبلغ جيجابايت. هذا الأمر يقلّصه إلى 200 ميغابايت.‏</p><pre>lsof +L1</pre><p>‏ملفات حُذفت لكن عملية ما ما زالت تحتفظ بها مفتوحة. لا تعود المساحة إلا عند إعادة تشغيل تلك العملية. هذه هي الحالة الكلاسيكية: حذفت السجل ولم تتغيّر نتيجة ⁦df⁩.‏</p><pre>apt clean</pre><p>‏يحذف حزم التنزيل المخزّنة مؤقتًا. على خادم يعمل منذ سنوات، قد يحرّر هذا وحده مساحة كبيرة.‏</p><h3>‏امنع‏</h3><pre>logrotate -d /etc/logrotate.conf</pre><p>‏تجربة تشغيل تُظهر ما سيفعله ⁦logrotate⁩. إن لم يكن سجل تطبيقك في القائمة، فسيزداد إلى ما لا نهاية.‏</p><p>‏<strong>أنذِر عند 80%</strong> — لا عند 100%. القرص لا يمتلئ في ثانية واحدة تقريبًا، وهذا يمنحك أيامًا من الإنذار إذا كان هناك من يراقب.‏</p><p>‏<strong>افصل /⁦var⁩</strong> — عندما تعيش السجلات على قسم خاص بها، لا يستطيع سجل جامح أن يُسقط النظام كله.‏</p><h3>‏الفخ الذي يجب تجنّبه‏</h3><p>‏أمر ⁦rm⁩ ⁦-rf⁩ على مجلد السجلات أثناء تشغيل الخدمة. تفقد الأدلة، وغالبًا لا تعود المساحة على أي حال.‏</p><p>‏الأقراص الممتلئة لا تحدث فجأة أبدًا. إنها فقط بلا مراقبة.‏</p><p>‏ما الذي ملأ قرصك في المرة الأخيرة؟‏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67ebdc59e159" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix: No Space Left on Device]]></title>
            <link>https://s0sta.medium.com/fix-no-space-left-on-device-0df1846cadf6?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/0df1846cadf6</guid>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[storage]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 20:18:45 GMT</pubDate>
            <atom:updated>2026-11-07T20:18:45.338Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1x_Z3maStiTqpNMZ6iFmHA.gif" /></figure><h3>Full disks are never sudden. They are just unwatched.</h3><p>No space left on device. The error that stops databases, deployments and backups at the same moment.</p><h3>Diagnose</h3><pre>df -h</pre><p>Which filesystem is full. The Use% column tells you where to look.</p><pre>df -i</pre><p>Check inodes too. A disk can run out of inodes from millions of tiny files while df -h still shows free space.</p><pre>du -xh --max-depth=1 / | sort -h</pre><p>The biggest folders on that disk, largest at the bottom. Repeat one level deeper until you find the culprit.</p><h3>Fix</h3><pre>journalctl --vacuum-size=200M</pre><p>The systemd journal can quietly grow to gigabytes. This shrinks it to 200 MB.</p><pre>lsof +L1</pre><p>Files that were deleted but are still held open by a process. The space only comes back when that process restarts. This is the classic “I deleted the log but df did not change”.</p><pre>apt clean</pre><p>Removes cached package downloads. On a server that has run for years, this alone can free a lot.</p><h3>Prevent</h3><pre>logrotate -d /etc/logrotate.conf</pre><p>A dry run that shows what logrotate would do. If your app log is not in the list, it will grow forever.</p><p><strong>Alert at 80%</strong> — not at 100%. A disk almost never fills in one second. It gives you days of warning if something is watching.</p><p><strong>Separate /var</strong> — when logs live on their own partition, a runaway log cannot take the whole system down.</p><h3>The one to avoid</h3><p>rm -rf on a log folder while the service is running. You lose the evidence, and the space often does not come back anyway.</p><p>Full disks are never sudden. They are just unwatched.</p><p>What filled up your last disk?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0df1846cadf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[تسعة أوامر تحوّل سجلات الخادم إلى إجابات]]></title>
            <link>https://s0sta.medium.com/%D8%AA%D8%B3%D8%B9%D8%A9-%D8%A3%D9%88%D8%A7%D9%85%D8%B1-%D8%AA%D8%AD%D9%88%D9%91%D9%84-%D8%B3%D8%AC%D9%84%D8%A7%D8%AA-%D8%A7%D9%84%D8%AE%D8%A7%D8%AF%D9%85-%D8%A5%D9%84%D9%89-%D8%A5%D8%AC%D8%A7%D8%A8%D8%A7%D8%AA-8004e7069bf2?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/8004e7069bf2</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 20:06:07 GMT</pubDate>
            <atom:updated>2026-11-07T20:06:07.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZoHfZAAhkn3-jCVGj6W6w.gif" /></figure><h3>‏اعثر على السطر، ثم شكّله، ثم احسبه‏</h3><p>‏لا تحتاج السجلات إلى أداة معقّدة. يمكن الإجابة عن معظم أسئلة الخادم باستخدام تسعة أوامر وأنبوب واحد ⁦(pipe)⁩.‏</p><h3>‏اعثر عليه‏</h3><pre>grep -i &quot;error&quot; app.log</pre><p>‏كل سطر يذكر كلمة ⁦error⁩، بأي حالة من الأحرف. أضف ⁦-c⁩ لعدّ الأسطر بدلًا من طباعتها.‏</p><pre>grep -rn &quot;DB_HOST&quot; /etc/app/</pre><p>‏ابحث في مجلد كامل. يمنحك ⁦-n⁩ رقم السطر، فتنتقل إليه مباشرة.‏</p><pre>grep -v &quot;healthcheck&quot; access.log</pre><p>‏أخفِ الضجيج. يعرض ⁦-v⁩ كل سطر لا يطابق النمط.‏</p><h3>‏شكّله‏</h3><pre>awk &#39;{print $1, $9}&#39; access.log</pre><p>‏اطبع الحقول التي تهمّك فقط. في سجل وصول ⁦nginx⁩، الحقل الأول هو عنوان ⁦IP⁩ للعميل، والحقل التاسع هو رمز الحالة.‏</p><pre>cut -d: -f1 /etc/passwd</pre><p>‏اقسم كل سطر عند النقطتين واحتفظ بالحقل الأول. تلك قائمة بكل مستخدم على الجهاز.‏</p><pre>sed &#39;s/http:/https:/g&#39; links.txt</pre><p>‏بحث واستبدال في كل سطر. أضف ⁦-i⁩ لتعديل الملف في مكانه، بعد أخذ نسخة منه.‏</p><h3>‏احسبه‏</h3><pre>sort ips.txt | uniq -c | sort -rn</pre><p>‏احسب التكرارات وضع الأكبر في الأعلى. يدمج ⁦uniq⁩ الأسطر المتجاورة فقط، ولهذا يأتي ⁦sort⁩ أولًا.‏</p><pre>wc -l access.log</pre><p>‏عدد الأسطر. طريقة سريعة لعدّ الطلبات أو الأخطاء أو المستخدمين.‏</p><pre>tail -f app.log | grep ERROR</pre><p>‏تابع السجل مباشرةً، وأظهر الأخطاء فقط عند وصولها.‏</p><h3>‏اجمعها معًا‏</h3><pre>awk &#39;{print $1}&#39; access.log | sort | uniq -c | sort -rn | head</pre><p>‏يعرض هذا عشرة عناوين ⁦IP⁩ تزور خادمك أكثر من غيرها. سطر واحد، بلا لوحة متابعة.‏</p><p>‏الفكرة الأساسية: كل أداة من هذه الأدوات تؤدي مهمة صغيرة واحدة، والأنبوب ⁦(pipe)⁩ هو ما يجعلها قوية.‏</p><p>‏أيّها تستخدمه أكثر؟‏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8004e7069bf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[9 Commands That Turn Logs Into Answers]]></title>
            <link>https://s0sta.medium.com/9-commands-that-turn-logs-into-answers-2d428b28ac30?source=rss-0643e61a3930------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d428b28ac30</guid>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Hosam Hani]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 19:54:45 GMT</pubDate>
            <atom:updated>2026-11-07T19:54:45.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZoHfZAAhkn3-jCVGj6W6w.gif" /></figure><h3>Find the line, shape it, count it</h3><p>Logs do not need a fancy tool. Most questions about a server can be answered with nine commands and a pipe.</p><h3>Find it</h3><pre>grep -i &quot;error&quot; app.log</pre><p>Every line that mentions error, in any case. Add -c to count instead of print.</p><pre>grep -rn &quot;DB_HOST&quot; /etc/app/</pre><p>Search a whole folder. -n gives you the line number, so you can jump straight to it.</p><pre>grep -v &quot;healthcheck&quot; access.log</pre><p>Hide the noise. -v prints every line that does not match.</p><h3>Shape it</h3><pre>awk &#39;{print $1, $9}&#39; access.log</pre><p>Print only the fields you care about. In an nginx access log, field 1 is the client IP and field 9 is the status code.</p><pre>cut -d: -f1 /etc/passwd</pre><p>Split each line on a colon and keep the first field. That is a list of every user on the box.</p><pre>sed &#39;s/http:/https:/g&#39; links.txt</pre><p>Find and replace on every line. Add -i to change the file in place, after you have a copy.</p><h3>Count it</h3><pre>sort ips.txt | uniq -c | sort -rn</pre><p>Count duplicates and put the biggest at the top. uniq only merges neighbours, which is why sort comes first.</p><pre>wc -l access.log</pre><p>How many lines. A quick way to count requests, errors or users.</p><pre>tail -f app.log | grep ERROR</pre><p>Follow the log live and only show the errors as they arrive.</p><h3>Put them together</h3><pre>awk &#39;{print $1}&#39; access.log | sort | uniq -c | sort -rn | head</pre><p>This shows the ten IPs hitting your server the most. One line, no dashboard.</p><p>The key insight: each of these tools does one small thing. The pipe is what makes them powerful.</p><p>Which one do you use the most?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d428b28ac30" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>