<?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 Hammam Firdaus on Medium]]></title>
        <description><![CDATA[Stories by Hammam Firdaus on Medium]]></description>
        <link>https://medium.com/@mamxalf?source=rss-6dbbb529e7ee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Wh3HpD4Q1R7GRQW2_4h_zA.jpeg</url>
            <title>Stories by Hammam Firdaus on Medium</title>
            <link>https://medium.com/@mamxalf?source=rss-6dbbb529e7ee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 20:20:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mamxalf/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[Final Part — Realita Itu Pahit, Telan! Lalu Larilah!]]></title>
            <link>https://mamxalf.medium.com/final-part-realita-itu-pahit-telan-lalu-larilah-ac483093261b?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac483093261b</guid>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 07:41:01 GMT</pubDate>
            <atom:updated>2026-04-13T07:41:01.274Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Refleksi tentang Hidup, Penerimaan, dan Arah Pelarian yang Sering Kita Lupakan — #3</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-VKZCWbY6elx5xE5" /><figcaption>Photo by <a href="https://unsplash.com/@ohlrogge?utm_source=medium&amp;utm_medium=referral">Niklas Ohlrogge (niamoh.de)</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Artikel ini adalah final part dari 2 artikel sebelumnya yang bisa dibaca disini</p><ul><li>Part #1 <a href="https://mamxalf.medium.com/part-1-realita-itu-pahit-telan-lalu-larilah-b26af305cfef">https://mamxalf.medium.com/part-1-realita-itu-pahit-telan-lalu-larilah-b26af305cfef</a></li><li>Part #2 <a href="https://medium.com/@mamxalf/part-2-realita-itu-pahit-telan-lalu-larilah-867af1cb89d0">https://medium.com/@mamxalf/part-2-realita-itu-pahit-telan-lalu-larilah-867af1cb89d0</a></li></ul><h4>Angin dan Kapal: Tentang Batas Kendali Manusia</h4><p>Dalam untaian refleksi tentang <em>Hyakuemu</em> yang menjadi pemicu tulisan ini, disebutkan dua bait kebijaksanaan dari tradisi Arab klasik yang begitu relevan. Yang pertama dari Mutanabbi (<em>seorang penyair Arab terkenal era Abbasiyah di istana emir Hamdanid Saif ad-Daulah di Aleppo</em>) :</p><blockquote>مَا كُلُّ مَا يَتَمَنَّى الْمَرْءُ يُدْرِكُهُ، تَجْرِي الرِّيَاحُ بِمَا لَا تَشْتَهِي السُّفُنُ<br><em>“Tidak semua yang diinginkan seseorang akan tercapai. Angin berhembus ke arah yang tidak diinginkan kapal-kapal.”</em></blockquote><p>Kita adalah nahkoda kapal kehidupan kita sendiri. Kita boleh merencanakan rute perjalanan dengan detail yang luar biasa. Kita boleh membawa bekal yang cukup, memperkuat layar, dan mengasah kemampuan navigasi. Namun, kita tidak pernah bisa mengendalikan angin. Angin realita — entah itu kondisi ekonomi global, pandemi yang tiba-tiba muncul, keputusan orang lain yang mempengaruhi hidup kita, atau bahkan batasan fisik dan mental kita sendiri — akan berhembus sesuka hatinya.</p><p>Menerima bahwa kita tidak bisa mengendalikan angin adalah salah satu bentuk “menghadapi realita” yang paling fundamental. Betapa banyak dari kita yang stres, cemas, dan depresi karena terus-menerus berusaha mengendalikan arah angin? Energi kita habis untuk marah pada semesta, bukannya untuk menyesuaikan layar kapal kita.</p><p>Syair kedua datang dari Ibn Athaillah (<em>ulama besar, sufi terkemuka, dan tokoh kunci Tarekat Syadziliyah asal Mesir</em>) :</p><blockquote>سَوَابِقُ الْهِمَمِ لَا تَخْرِقُ أَسْوَارَ الْأَقْدَارِ<br><em>“Kekuatan tekad tidak akan mampu menembus dinding-dinding takdir.”</em></blockquote><p>Ini adalah pil yang paling pahit untuk ditelan. Kita hidup dalam zaman yang memuja <em>hustle culture</em>, yang mengagungkan narasi <em>“you can be anything you want if you work hard enough”</em>. Ibn Athaillah, dengan lembut namun tegas, mengingatkan kita bahwa ada dinding-dinding yang tidak bisa dirobohkan hanya dengan tekad. Ada batas-batas yang merupakan bagian dari desain kehidupan itu sendiri.</p><p>Tetapi, sekali lagi, ini bukan ajakan untuk menjadi fatalis. Ini adalah ajakan untuk menjadi realistis. Dengan menyadari keberadaan dinding-dinding itu, kita berhenti membenturkan kepala kita pada tembok yang tak akan runtuh. Kita berhenti menyalahkan diri sendiri karena tidak bisa terbang seperti burung. Kita mulai mencari pintu, jendela, atau bahkan menerima bahwa ruangan ini mungkin cukup nyaman jika kita berhenti meronta.</p><p>Menghadapi realita dinding takdir bukanlah kekalahan. Ia adalah awal dari sebuah strategi hidup yang lebih bijaksana. Ia adalah pengakuan bahwa kita adalah manusia dengan segala keterbatasan, dan di dalam batasan-batasan itulah kita bisa menemukan kebebasan yang autentik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gn5PfHPQw7qPydI3" /><figcaption>Photo by <a href="https://unsplash.com/@erimbenli?utm_source=medium&amp;utm_medium=referral">Erim Berk Benli</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Berlari dengan Sadar: Menemukan Arah Setelah Penerimaan</h4><p>Jadi, apa artinya “lari dari kenyataan” setelah kita “menghadapi realita”? Ia berarti bergerak maju tanpa beban. Ia berarti menjalani hidup bukan lagi sebagai sebuah pertarungan melawan takdir, tetapi sebagai sebuah tarian bersama realita.</p><p>Perbedaannya sangat jelas dengan fenomena yang disinggung oleh komentar tadi. Pelarian yang tidak didahului oleh penerimaan adalah pelarian yang panik, reaktif, dan tanpa arah. Pelarian yang muncul setelah penerimaan adalah pelarian yang sadar, penuh tujuan, dan membebaskan.</p><p>Ketika kita sudah menghadapi realita bahwa pekerjaan kita saat ini bukanlah passion kita, kita baru bisa “lari” dengan mencari makna di luar pekerjaan, atau mulai membangun jembatan perlahan-lahan menuju karier baru tanpa tekanan yang menghancurkan. Ini bukan <em>quiet quitting</em>; ini adalah <em>conscious moving</em>.</p><p>Ketika kita sudah menghadapi realita bahwa hubungan yang kita jalani tidak sehat, kita baru bisa “lari” dengan melangkah keluar dan membuka diri untuk kemungkinan cinta yang lebih baik. Bukan lari karena benci, tapi lari karena cinta pada diri sendiri.</p><p>Ketika kita sudah menghadapi realita bahwa kita tidak sempurna, kita baru bisa “lari” dengan menerima diri sendiri dan fokus pada pertumbuhan, bukan pada kesempurnaan yang ilusif.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*awvj44njDLIkG4y7" /><figcaption>Photo by <a href="https://unsplash.com/@masjidmaba?utm_source=medium&amp;utm_medium=referral">Masjid MABA</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Penutup: Menangislah!</h4><p>Pada akhirnya, mungkin kita semua akan sampai pada satu momen di mana realita terasa begitu berat hingga kita ingin berhenti sama sekali. Momen di mana semua usaha terasa sia-sia, dan dinding takdir terasa terlalu tinggi untuk dipanjat.</p><p>Di momen seperti itu, saran terbaik mungkin bukanlah kata-kata motivasi yang bombastis. Mungkin saran terbaik adalah: menangislah. Menangislah sepuasnya. Biarkan air mata mengalir sebagai pengakuan bahwa realita memang menyakitkan. Biarkan tangisan itu menjadi ritual “menghadapi” yang paling jujur.</p><p>Air mata mungkin tidak mengubah arah angin. Air mata mungkin tidak meruntuhkan dinding takdir. Tetapi air mata membersihkan pandangan kita. Setelah tangisan reda, kita akan melihat dunia dengan mata yang lebih jernih. Kita akan melihat bahwa meskipun angin berhembus ke arah yang tidak kita inginkan, kapal kita masih mengapung. Meskipun dinding takdir tetap berdiri, kaki kita masih bisa melangkah di atas tanah yang ada.</p><p>Saat itulah kita bisa mulai berlari lagi. Bukan lari yang penuh ambisi dan penyangkalan, bukan lari yang buta arah seperti kebanyakan orang di zaman ini. Tetapi lari yang ringan. Lari yang kita tahu dari apa, untuk apa, dan ke mana. Lari dari kenyataan pahit yang sudah kita tatap langsung, menuju sebuah kenyataan baru yang kita ciptakan sendiri di atas fondasi penerimaan.</p><p>Hadapi realita yang ada. Baru kau bisa lari dari kenyataan. Itu bukan paradoks. Itu adalah rumus paling jujur untuk tetap waras dan menemukan arah di dunia yang tak selalu berpihak pada keinginan kita.</p><h3>Terakhir,</h3><blockquote>Kamu seorang medioker, tidak perlu mencari alasan untuk menjadi hebat, menyerahlah!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac483093261b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part #2 — Realita Itu Pahit, Telan! Lalu Larilah!]]></title>
            <link>https://mamxalf.medium.com/part-2-realita-itu-pahit-telan-lalu-larilah-867af1cb89d0?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/867af1cb89d0</guid>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 23:31:01 GMT</pubDate>
            <atom:updated>2026-04-12T23:31:01.360Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Refleksi tentang Hidup, Penerimaan, dan Arah Pelarian yang Sering Kita Lupakan — #2</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g00006g6zAlgGqIk" /><figcaption>Photo by <a href="https://unsplash.com/@victoriabcphotographer?utm_source=medium&amp;utm_medium=referral">Christina Victoria Craft</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>melanjutkan artikel sebelumnya, part #1 bisa dibaca disini <a href="https://mamxalf.medium.com/part-1-realita-itu-pahit-telan-lalu-larilah-b26af305cfef">https://mamxalf.medium.com/part-1-realita-itu-pahit-telan-lalu-larilah-b26af305cfef</a></p><h4>Paradoks Pelarian untuk Bisa Berlari</h4><p>Kita hidup dalam budaya yang memuja pelarian, tetapi seringkali lupa mengajarkan tentang titik berangkat. Media sosial menawarkan filter-filter indah untuk menyembunyikan wajah asli kita yang lelah. Industri hiburan menyediakan dunia-dunia paralel tempat kita bisa tenggelam. Bahkan narasi-narasi motivasi pun seringkali adalah bentuk pelarian yang paling halus: “Jangan menyerah, kau pasti bisa!” (<em>kata yang tidak pernah saya ucapkan untuk teman saya sendiri </em>😂) — sebuah kalimat yang seringkali menutup mata kita dari kemungkinan bahwa ada hal-hal yang memang di luar batas kemampuan kita.</p><p>Kutipan “hadapi realita yang ada, baru bisa lari dari kenyataan” adalah penawar bagi pelarian yang buta arah itu. “Lari dari kenyataan” di sini bukanlah tindakan pengecut. Ia adalah sebuah gerakan maju yang hanya mungkin terjadi setelah kita berhenti bersembunyi di balik ilusi dan berani menjawab pertanyaan: <em>“Apa yang ingin kutinggalkan?”</em></p><p>Coba bayangkan. Ketika kita menolak menerima kenyataan — misalnya, menolak menerima bahwa hubungan telah berakhir, menolak menerima bahwa karier yang kita impikan mungkin tidak akan terwujud, menolak menerima bahwa kita memiliki keterbatasan — kita sebenarnya sedang berlari di tempat. Kaki kita bergerak cepat, keringat bercucuran, tetapi kita tidak maju ke mana-mana. Energi kita habis untuk melawan sesuatu yang tak bisa diubah. Kita terkunci dalam penjara penolakan. Kita lari, tapi tak ke mana-mana. Inilah yang digambarkan oleh komentar tadi: <em>lari tanpa tahu arah</em>.</p><p>Berlari dari kenyataan yang telah kita hadapi itu bukan lagi pelarian yang sia-sia. Ia adalah lari menuju kemungkinan-kemungkinan baru yang sebelumnya tersembunyi di balik kabut penyangkalan. Ia adalah lari yang autentik karena kita tahu apa yang kita tinggalkan dan ke mana kita ingin menuju.</p><blockquote>Kamu hanyalah seorang medioker! Menyerahlah!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*48hQD9nlGATm7z8g" /><figcaption>Photo by <a href="https://unsplash.com/@cloud_mind?utm_source=medium&amp;utm_medium=referral">Tobias Bjerknes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Pelajaran dari Lintasan 100 Meter: Realita yang Tak Bisa Ditawar</h4><p>Kembali sejenak pada anime <em>Hyakuemu</em> sebagai pijakan reflektif. Mengapa kisah tentang pelari 100 meter ini begitu mengguncang? Karena lintasan 100 meter adalah metafora paling telanjang dari realita hidup. Di sana, tidak ada ruang untuk negosiasi. Tidak ada waktu untuk berteori. Tidak ada kesempatan kedua. Tidak ada alasan. <strong>No Excuse!</strong></p><p>Dalam banyak aspek kehidupan, kita bisa menipu diri sendiri. Kita bisa bilang, “Aku belum berhasil karena aku belum maksimal,” atau “Aku gagal karena faktor eksternal.” Kita bisa menyusun narasi-narasi alternatif yang membuat kita merasa lebih baik. Tetapi di lintasan 100 meter, semuanya transparan. Waktu tidak berbohong. Urutan finis tidak bisa dibantah. Kalah ya kalah. Tidak ada cerita “sebenarnya aku bisa lebih cepat.”</p><p>Anime itu tidak berusaha menghibur penontonnya dengan romantisme usaha. Ia justru menunjukkan bagaimana realita bisa begitu kejam: seseorang yang telah berlatih seumur hidupnya bisa kalah oleh seseorang yang baru pertama kali serius berlari. Seseorang yang memiliki tekad membara bisa tetap tak mampu menembus batas fisiknya. Inilah realita yang sering kita tolak dalam hidup kita sehari-hari.</p><p>Tetapi justru di situlah letak kedewasaan yang ditawarkan. Menghadapi realita bahwa kerja keras tidak selalu berbanding lurus dengan hasil bukan berarti kita harus berhenti bekerja keras. Menghadapi realita bahwa bakat alami memang ada bukan berarti kita harus iri dan berhenti berusaha. Menghadapi realita adalah langkah pertama untuk mendefinisikan ulang apa arti “berhasil” bagi diri kita sendiri.</p><p>Ketika kita sudah menghadapi realita bahwa kita mungkin tidak akan menjadi yang tercepat, kita baru bisa mulai bertanya: “Lalu, untuk apa aku berlari?” Pertanyaan itu hanya muncul setelah penyangkalan berakhir. Dan dari pertanyaan itulah, sebuah lari yang bermakna dimulai.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=867af1cb89d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part #1 — Realita Itu Pahit, Telan! Lalu Larilah!]]></title>
            <link>https://mamxalf.medium.com/part-1-realita-itu-pahit-telan-lalu-larilah-b26af305cfef?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/b26af305cfef</guid>
            <category><![CDATA[bitter-truth]]></category>
            <category><![CDATA[hyakuemu]]></category>
            <category><![CDATA[reality]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 14:16:42 GMT</pubDate>
            <atom:updated>2026-04-12T14:16:42.945Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Refleksi tentang Hidup, Penerimaan, dan Arah Pelarian yang Sering Kita Lupakan — #1</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8xGUmD382upFFfFg" /><figcaption>Photo by <a href="https://unsplash.com/@zri?utm_source=medium&amp;utm_medium=referral">Ruslan Zaplatin 🖤</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Ada satu kutipan yang akhir-akhir ini terus menggema di kepala saya</p><blockquote>Hadapi realita yang ada, baru bisa lari dari kenyataan.</blockquote><p>Kalimat tersebut diucapkan oleh salah satu karakter yang bernama Kaido dari movie bernama <em>Hyakuemu</em>.</p><p>Sekilas, kalimat itu terdengar seperti kontradiksi. Bagaimana mungkin kita bisa “lari” dari sesuatu yang justru harus kita “hadapi”? Bukankah melarikan diri adalah antitesis dari menghadapi? Di situlah letak kebijaksanaan yang tersembunyi. Kalimat ini tidak berbicara tentang pelarian dalam arti fisik — melarikan diri dari tanggung jawab, dari masalah, dari hidup yang berat. Ia berbicara tentang sebuah kondisi paradoksal: bahwa satu-satunya cara untuk benar-benar bebas dan “berlari” dalam hidup ini adalah dengan terlebih dahulu berdiri diam, menatap lurus ke depan, dan mengakui realita apa adanya.</p><p><em>Hyakuemu</em> bukan anime movie olahraga biasa yang merayakan kemenangan dan semangat tak kenal menyerah. Anime itu, seperti yang dideskripsikan oleh seorang pengamat di media sosial, terasa seperti duduk di ruang yang diisi oleh tokoh-tokoh besar filsuf, di mana kita dipaksa menelan pil pahit bernama realita. <em>Hyakuemu</em> bukanlah tentang bakat melawan kerja keras. Ia adalah cermin yang memantulkan kembali kepada kita sebuah kebenaran yang sering kita sangkal: bahwa kerja keras tak selalu mampu menembus dinding realita, dan bahwa hidup tidak selalu berjalan sesuai kehendak kapal yang kita nahkodai.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*e4vGzLdkrZkJxi4R12i4Ew.jpeg" /><figcaption><a href="https://www.youtube.com/watch?v=cofsBL4yDqg">https://www.youtube.com/watch?v=cofsBL4yDqg</a></figcaption></figure><p>Namun, izinkan saya tidak menjadikan anime itu sebagai pusat dari tulisan ini. Biarkan ia hanya menjadi percikan api kecil yang menyulut obor refleksi yang lebih besar. Sebab apa yang ingin saya bicarakan hari ini adalah tentang kita semua — tentang hidup yang kita jalani setiap hari, tentang ekspektasi yang kita bangun, dan tentang kebebasan sejati yang hanya bisa kita raih setelah kita berdamai dengan kenyataan yang tak selalu ramah.</p><h4>Pelarian yang Buta Arah: Lari, tapi Tak Tahu dari Apa</h4><p>Di kolom komentar video pendek tentang <em>Hyakuemu</em> itu, ada satu kalimat yang menusuk begitu dalam. Seorang penonton menulis:</p><blockquote>“Jujur nih anime maknanya dalem banget, sangat relate di zaman ini yang banyak orang mau lari dari kenyataan, tapi pada dasarnya mereka banyak yang gak tau lari dari apa, lari karena apa, dan lari untuk apa. Makanya mereka lari tanpa tahu arah dan sulit bisa menerima atau memahami kenyataan yang mereka hadapi.” — @Zulfitra</blockquote><p>Komentar ini adalah diagnosis sosial yang akurat. Lihatlah sekeliling kita. Generasi ini dibesarkan dengan narasi <em>“follow your passion”</em> dan <em>“you do you”</em>. Ketika hidup terasa berat dan tidak seindah unggahan Instagram, respons kita adalah: lari. <em>Scroll</em> media sosial tanpa henti. <em>Binge-watching</em> serial sampai pagi. <em>Healing</em> ke tempat yang estetik. Semua itu adalah bentuk-bentuk pelarian yang sah, tetapi seringkali dilakukan tanpa kesadaran.</p><p>Kita lari, tapi kita tidak tahu apa yang sedang kita kejar. Kita merasa sesak, tetapi kita tidak bisa menyebutkan nama setan yang menduduki dada kita. Kita ingin terbebas dari <em>realita</em>, tetapi kita bahkan tidak berani mendefinisikan apa <em>realita</em> kita yang sebenarnya. Pelarian seperti ini bukanlah gerak maju; ia adalah gerak berputar-putar di labirin kosong.</p><p><em>Hyakuemu</em> menjadi begitu relevan karena ia memaksa kita untuk berhenti sejenak dan bertanya: <em>“Aku lari dari apa?”</em> Karakter-karakternya tidak hanya berlari secara fisik di lintasan 100 meter, tetapi mereka juga terjebak dalam pelarian metaforis. <em>Togashi</em> berlari dari ketakutan akan kegagalan yang bisa meruntuhkan identitasnya. <em>Komiya</em> berlari dari kehampaan eksistensi yang mencekiknya. Mereka berlari kencang, tetapi sebelum mereka jujur pada diri sendiri, lari mereka hanya menambah jarak antara mereka dengan kedamaian.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b26af305cfef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Are All Ibrahim, and Each of Us Has an ‘Ismail’]]></title>
            <link>https://mamxalf.medium.com/we-are-all-ibrahim-and-each-of-us-has-an-ismail-c580948684ab?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/c580948684ab</guid>
            <category><![CDATA[dzulhijjah]]></category>
            <category><![CDATA[mina]]></category>
            <category><![CDATA[ibrahim]]></category>
            <category><![CDATA[ismail]]></category>
            <category><![CDATA[idul-adha]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Fri, 06 Jun 2025 05:58:42 GMT</pubDate>
            <atom:updated>2025-06-06T05:58:42.487Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uWWQrYZ7aXPjWrIG" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Mina_8.JPG">File:Mina 8.JPG — Wikimedia Commons</a></figcaption></figure><p><strong>Mina, 10 Dzulhijjah</strong></p><blockquote>Matahari membakar lembah Mina. Sebuah pisau berkilau tajam dan dingin sedang digenggam oleh tangan yang bergetar. Di hadapanya, terbaring seorang anak — dada yang masih naik-turun lembut, mata yang memancarkan ketulusan. Udara bergetar dalam bisu yang memecah langit. Di ujung jurang iman, seorang ayah mengangkat senjata untuk merenggut nyawa darah dagingnya sendiri.</blockquote><p>Salah satu momen paling paradoks dalam sejarah manusia. Nabi Ibrahim sand kekasih Allah, berdiri diambang pembunuhan atas anak yang dinantikannya begitu lama sampai puluhan tahun. Ismail, sang putra mahkota justru tersenyum lembut dan bahagia, <em>“Laksanakanlah, Ayah. Aku adalah korban cintamu kepada Yang Maha Kuasa.”</em></p><p>Waktu itu pisau yang digenggam bukan sekedar besi, tetapi ujian dari langit dibarengi dengan pertanyaan tegas — <em>“Sejauh mana kau sanggup mencinta-Ku?”. </em>Di ujung tajamnya mata pisau itu terdapat dua sisi antara kematian dan kehiduoan, antara naluri keayahan dan kesetiaan ilahiah — sebuah konflik yang merobek relung jiwa sedalam-dalamnya. Lembah itu menjadi panggung kosmis. Malaikat-malaikat membeku, Waktu terhenti, Langit menahan napas, dan ketika pisau menyentuh leher Ismail, bukan darah yang tumpah, melainkan air mata langit yang turun mengguyur bumi. Seekor domba turun dari cahaya menggantikan pengorbanan yang tak sempat diselesaikan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1PReW4jGngRcyy0-.jpg" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Makkah_Province_Saudi_Arabia_-_panoramio_%282%29.jpg">File:Makkah Province Saudi Arabia — panoramio (2).jpg — Wikimedia Commons</a></figcaption></figure><p>Maka, di tanah gersang tersebut lahir sebuah ritual abadi: <strong>Qurban Idul Adha</strong>. Bukan sekedar penyembelihan hewan, melainkan sebuah drama antara hamba dengan tuhannya, tentang pengorbanan yang lebiuh besar dari hidup, lebih kuat dari kemarian dan lebih mulia dari segalanya. Setiap tetes darah hewan qurban adalah gema dari pisau yang tak jadi menebas leher Ismail yang menjadikan pengingat bahwa <em>pengorbanan sejati bukanlah kematian, melainkan keberanian menyembelih “diri” demi sesuatu yang lebih tinggi dan cinta kepada ilahi</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3xz5L5_H02z07Gzo.jpg" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Cows_for_Eid_ul-Adha.jpg">File:Cows for Eid ul-Adha.jpg — Wikimedia Commons</a></figcaption></figure><p><strong>Darah yang Tak Sampai ke Langit</strong></p><p>Al-Qur’an tegas mengingatkan:</p><blockquote>لَنْ يَّنَالَ اللّٰهَ لُحُوْمُهَا وَلَا دِمَاۤؤُهَا وَلٰكِنْ يَّنَالُهُ التَّقْوٰى مِنْكُمْۗ كَذٰلِكَ سَخَّرَهَا لَكُمْ لِتُكَبِّرُوا اللّٰهَ عَلٰى مَا هَدٰىكُمْۗ وَبَشِّرِ الْمُحْسِنِيْنَ</blockquote><blockquote>Daging (hewan kurban) dan darahnya itu sekali-kali tidak akan sampai kepada Allah, tetapi yang sampai kepada-Nya adalah ketakwaanmu. Demikianlah Dia menundukkannya untukmu agar kamu mengagungkan Allah atas petunjuk yang Dia berikan kepadamu. Berilah kabar gembira kepada orang-orang yang muhsin. (QS. Al-Hajj: 37)</blockquote><p>Pemahaman penulis, hewan kurban hanyalah simbol. Esensi sejati adalah <em>“penyembelihan metaforis”</em> atas sifat serakah, egoisme, dan keangkuhan sosial. Kurban dramatis yang mengabaikan aspek ini ibarat panggung kosong — <em>indah dipamerkan, hampa makna.</em></p><p><strong>Akhir,</strong></p><p>Kisah Nabi Ibrahim dan Ismail bukan sekadar cerita lama. Ia adalah blueprint pengorbanan lintas zaman. Setiap generasi punya “Mina”-nya sendiri, tempat di mana kita diuji untuk memilih: <strong>tunduk pada ego, atau taat kepada Tuhan.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c580948684ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Membuang Altar Persembahan Dewa, Luis Enrique Lebih Memilih Menjadi Gembala bagi Kawanan Serigala…]]></title>
            <link>https://mamxalf.medium.com/membuang-altar-persembahan-dewa-luis-enrique-lebih-memilih-menjadi-gembala-bagi-kawanan-serigala-15e838c1fb48?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/15e838c1fb48</guid>
            <category><![CDATA[motifakes]]></category>
            <category><![CDATA[les-parisiens]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[champions-league]]></category>
            <category><![CDATA[psg]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Thu, 05 Jun 2025 03:59:04 GMT</pubDate>
            <atom:updated>2025-06-05T04:00:50.414Z</atom:updated>
            <content:encoded><![CDATA[<h3>Membuang Altar Persembahan Dewa, Luis Enrique Lebih Memilih Menjadi Gembala bagi Kawanan Serigala Muda yang Haus Akan Tekanan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*U_H64RBsG4qzdHc2.jpg" /><figcaption>Creator: Justin Setterfield | Credit: <a href="https://images.app.goo.gl/1jCKig4DmoEj7rQ1A">Getty Images</a></figcaption></figure><p><strong>Paris, Juli 2023</strong></p><p>Luis Enrique tiba di Parc des Princes dengan satu janji yang mengguncang fondasi sepak bola modern: “<em>Saya di sini untuk membunuh kultus individu.</em>” Di hadapan media yang skeptis, ia menyulap panggung konferensi pers menjadi mimbar propaganda. “<em>Kami akan bermain dengan 11 pemain, bukan satu dewa dan 10 pengawal</em>,” ujarnya, menembus diam yang mematikan.</p><p><strong>Les Parisiens</strong> bukan lagi kandang bagi para bintang yang bersinar sendiri. Enrique merobohkan patung Messi yang baru pergi, memakzulkan Neymar yang diusir, dan mempersiapkan penguburan era Mbappé — tiga dewa yang dipercaya Qatar bisa merebut surga Eropa. “<em>Kami sedang membangun identitas baru</em>,” seru Nasser Al-Khelaifi di sampingnya, tapi semua tahu, suara sesungguhnya datang dari sang pelatih berkaus training yang bicara seperti filsuf perang.</p><blockquote><em>“Fokus pada yang penting, dan bersikap bodo amat pada yang lain.”</em><br> — Ekor dari <em>Sebuah Seni untuk Bersikap Bodo Amat</em> yang menjadi kompas Enrique</blockquote><p>Ia membawa senjata sistem kolektif yang menuntut darah, keringat, dan kepatuhan mutlak. Tak peduli nama besar atau gaji selangit — jika tak mau menekan, mengejar, dan mati untuk rekan setim, silakan angkat koper. “Saya butuh 11 tentara, bukan 1 jenderal dan 10 prajurit,” gertaknya dalam dokumenter <em>No Teneis Ni P</em>** Idea*, sementara layar di belakangnya memproyeksikan statistik tekanan tanpa ampun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TwQfkT7h75sj0abX" /><figcaption><a href="https://www.psg.fr/media/291775/_am17480.jpeg?anchor=center&amp;mode=crop&amp;width=2000&amp;height=1125&amp;quality=80">PSG First Team</a></figcaption></figure><p>Musim panas 2024 menjadi saksi pemakaman simbolis. Mbappé — sang pangeran Paris dibebaskan ke Real Madrid. Media mulai membangun nisan: “PSG mati tanpa Mbappé!” Tapi Enrique malah tersenyum. Di ruang ganti, ia menggantung poster dengan angka ajaib <strong>12</strong>.</p><blockquote>“Saya ingin 4 pemain yang mencetak 12 gol, bukan satu yang mencetak 40,” teriak Enrique.</blockquote><p>Ramalannya jadi nyata:</p><ul><li>Ousmane Dembélé si pecundang dari Camp Nou yang pernah tersesat dalam labirin egonya sendiri, kini bangkit sebagai arsitek 33 gol sekaligus dukun perang yang menyihir garis pressing menjadi senjata pamungkas. Kaki kacanya yang dulu rapuh kini mencabik garis pertahanan lawan, kakinya yang pernah goyah sekarang menari di atas reruntuhan reputasi lamanya.</li><li>Désiré Doué, sang bocah 19 tahun yang harganya tak sebanding dengan selembar jersey Mbappé, dan Bradley Barcola, bersama mereka merobek jala pertahanan Inter di final seperti dua serigala yang kelaparan.</li><li>Lalu datanglah Khvicha Kvaratskhelia, sang pemburu seharga €70 juta yang lebih memilih mengorbankan diri di altar pengorbanan untuk pressing daripada berpesta di panggung bintang. Setiap tetes keringatnya adalah nyanyian kesetiaan, setiap larinya adalah puisi pengorbanan. Enrique tak butuh dewa — ia butuh pejuang yang bersedia mati untuk warna biru-merah.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*46vO7hB1iEzpXuCD" /><figcaption>PSG Official Web : <a href="https://www.psg.fr/media/284409/luis-enrique-19.jpg?center=0.39509536784741145,0.46642468239564427&amp;mode=crop&amp;width=2000&amp;height=1125&amp;quality=80">Luis Enrique</a></figcaption></figure><p>Di tangan Luis Enrique, mereka bukan lagi sekadar pemain. Mereka adalah manifestasi dari sebuah keyakinan: bahwa sepakbola sejati lahir bukan dari bintang yang bersinar sendiri, tapi dari api kolektif yang membakar segalanya.</p><p><strong>Terakhir,</strong></p><p>Paris, kota yang pernah menyembah para yang sekarang membangun sebuah altar baru. Altar yang tak meminta persembahan mewah, tapi keringat 11 manusia yang percaya:<strong> </strong>kolektivitas adalah agama tertinggi.</p><p><strong>Revolusi belum selesai. Ia baru saja menemukan nadinya.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15e838c1fb48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memilih Berdansa di Atas Medan Perang, Arsenal Terjebak dalam Ilusi tentang Keindahan yang Tak…]]></title>
            <link>https://mamxalf.medium.com/memilih-berdansa-di-atas-medan-perang-arsenal-terjebak-dalam-ilusi-tentang-keindahan-yang-tak-a9c06423e6a8?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9c06423e6a8</guid>
            <category><![CDATA[north-london]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[gooner]]></category>
            <category><![CDATA[arsenal]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Fri, 09 May 2025 07:26:14 GMT</pubDate>
            <atom:updated>2025-05-09T07:26:14.562Z</atom:updated>
            <content:encoded><![CDATA[<h3>Memilih Berdansa di Atas Medan Perang, Arsenal Terjebak dalam <strong>Ilusi tentang Keindahan yang Tak Pernah Cukup</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GELZcY_lRDEiG4bA" /><figcaption>Photo by <a href="https://unsplash.com/@whoisdenilo?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Who’s Denilo ?</a> on <a href="https://unsplash.com/photos/a-man-standing-in-front-of-the-emirates-stadium-SuBb_SiEEM8?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>2008, yap sepak bola dunia sedang mengalami transisi menuju era moderen. Cristiano Ronaldo menggila di MU, Messi si anak ajaib yang mulai bersinar di Barcelona, dan Liga Inggris mulai dijejali miliaran pound dari oligarki Rusia hingga Emirat. Sementara itu, Arsenal? Mereka berbeda. Arsenal berdiri bak pilar tembaga retak — tangguh, angkuh, dan percaya bahwa sepak bola sejatinya adalah seni yang lahir dari proses. Di tengah hegemoni kapitalisme sepakbola, Arsène Wenger menolak tunduk pada logika “beli menang”, memilih menciptakan simfoni dengan pemuda-pemuda berbakat. Filosofinya tak berubah: sepakbola adalah seni, pemuda adalah masa depan, dan kemenangan harus diraih dengan cara yang indah.</p><p>Sesepuh gooners selalu bercerita kita pernah memiliki piala emas dengan menaklukan liga Inggris tanpa sekalipun kalah, kita hampir menaklukan Eropa, bahkan Real Madrid dengan galácticos-nya kita bungkam. Sejenak saya membayangkan betapa hebatnya era itu, bagi <em>GEN-Z</em> mereka yang mulai terpesona saat Jack Wilshere memetik pujian atas keberanian larinya, atau ketika Arshavin dan Samir Nasri menari di antara bek lawan kisah itu seakan terbungkus pusaran nostalgia yang sulit dijangkau. Dongeng keemasan terasa jauh, namun tetap terdengar merdu dalam bait-bait harapan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e7ratxa8Hj9XsB3M" /><figcaption>Photo by <a href="https://unsplash.com/@gurdain?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Gurdain Bharj</a> on <a href="https://unsplash.com/photos/a-football-game-in-a-stadium-yqVCY5dWbas?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>Sebagai Gooners sejati, saya telah menapaki musim demi musim tanpa sentuhan trofi mayor. Musim 2024–2025 pun berlalu tanpa mahkota setelah kekalahan di semifinal Liga Champions dari Paris Saint-Germain dan kegagalan di ajang domestik kembali mengukuhkan Arsenal sebagai sang penjaga Trofi (dengan tidak untuk memiliki). Dalam 2 tahun terakhir, di bawah tangan dingin Mikel Arteta, Arsenal kembali menapak persaingan papan atas tak lagi sekadar memperebutkan empat besar, melainkan menatap puncak untuk gelar juara. Sejenak saya lupa, dulu kemenangan terasa bak ledakan gairah mimpi, dan kekalahan sudah menjadi santapan sehari-hari.</p><p>Sejauh ini Mikel Arteta merangkai tim dengan taktik bagaikan sajak indah yang tak kalah indah dengan karangan Mahmoud Darwish. Bukannya mengoleksi superstar, tetapi ia memupuk kesetiaan dari benih darah segar pemain muda, memadukannya dengan karakter matang para senior. Setiap kemenangan direkam sebagai bait baru, setiap kekalahan menjadi jeda yang mendidik. Dalam senyap, Arsenal menanam keyakinan bahwa proses bukan musuh, melainkan sahabat yang membimbing ke puncak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nSreMMIazOjU2n9x" /><figcaption>Photo by <a href="https://unsplash.com/@whodunelson?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Nelson Ndongala</a> on <a href="https://unsplash.com/photos/building-interior-cDUEytUiwoE?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>Terakhir,</p><p>Bagaimanapun juga, memilih klub sepak bola sejatinya tak ubahnya memilih jalan spiritual seperti sebuah agama yang menuntun kita merasakan sukma keberanian, kesetiaan, dan harapan. <strong><em>Nasi (Rice) sudah menjadi bubur</em></strong>, gambaran betapa kadang ekspektasi terbesar justru luluh lantak oleh realita pahit di lapangan. Seperti kata Dennis Bergkamp,</p><blockquote><em>“When you start supporting a club, you don’t support it for its trophies, its players or its history. You support it because you find yourself in it, you have found a place where you feel like you belong,”</em></blockquote><p>Harapan,</p><p>Do’a saya untuk suatu hari nanti, saya akan berada di tribun kuning-merah-putih itu, menyatu dalam sorakan dan merasakan getaran kemenangan. Namun hingga saat itu tiba, saya akan terus menikmati keindahan taktik, tarian pemain di lapangan, umpan satu-dua yang memukau, dan garis pertahanan tinggi yang menantang. Entah kapan trofi mayor akan singgah di lemari berdebu Emirates Stadium, semoga saat saya berkunjung, sudah ada mahkota baru yang siap saya abadikan dalam foto.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9c06423e6a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup NGINX in Ubuntu for your first Web Server]]></title>
            <link>https://mamxalf.medium.com/setup-nginx-in-ubuntu-for-your-first-web-server-ca05e82267ed?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca05e82267ed</guid>
            <category><![CDATA[web-server]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Wed, 31 May 2023 00:27:41 GMT</pubDate>
            <atom:updated>2023-05-31T00:27:41.476Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P74ZfjonMc7GAk7yZMVSQw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@tvick?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Taylor Vick</a> on <a href="https://unsplash.com/photos/M5tzZtFCOfs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>When I work as a Backend Engineer I don’t know how the server runs just and I know just in Basic or Common Cases. So, because I got a free credit of $200 in 60 days I will repeat my lesson to know deeper how the server runs as well.</p><blockquote><em>by the way, if you guys want to get free credit like me you can register in Digital Ocean with this link: </em><a href="https://m.do.co/c/a96f4e10566e"><em>https://m.do.co/c/a96f4e10566e</em></a></blockquote><blockquote><em>- Thank you 😁</em></blockquote><p>Let’s create our first Web Server!</p><p>Before creating the web server, we must know about what is a web server? and what is Nginx? in general.</p><blockquote><em>A web server is a software application that runs on a computer and is responsible for delivering web content over the internet. It responds to requests from web clients (usually web browsers) and delivers the requested files or executes specific tasks.</em></blockquote><blockquote><em>Nginx (pronounced “engine-x”) is a popular web server software known for its high performance, scalability, and efficient resource utilization.</em></blockquote><h3>Setup Nginx to the server</h3><p>Before beginning the guide, in this article I use Ubuntu 22.04 (LTS) x64.</p><h4>1. Install Nginx</h4><p>Nginx is one of the default packages in Ubuntu so we can install it from the apt but before installing the Nginx better update the apt first.</p><pre>~# sudo apt update<br>~# sudo apt install nginx</pre><h4>2. Allow the Firewall</h4><p>Before make allow the firewall and test the Nginx, you can see list of available applications in your ufw(Uncomplicated Firewall) with the command below.</p><pre>~# sudo ufw app list<br>Available applications:<br>  Nginx Full<br>  Nginx HTTP<br>  Nginx HTTPS<br>  OpenSSH</pre><p>Explanation :</p><ul><li><strong>Nginx Full</strong>: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)</li><li><strong>Nginx HTTP</strong>: This profile opens only port 80 (normal, unencrypted web traffic)</li><li><strong>Nginx HTTPS</strong>: This profile opens only port 443 (TLS/SSL encrypted traffic)</li><li><strong>OpenSSH</strong>: OpenSSH is a suite of secure networking utilities that provides encrypted communication between a client and a server. It includes programs such as ssh (Secure Shell) for secure remote login, scp (Secure Copy) for secure file transfer, and sftp (Secure FTP) for secure file access.</li></ul><p>*explanation above I got from <a href="https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04">Digital Ocean Blog</a>.</p><p>In this part, I want just to allow traffic on port 80 Nginx HTTP</p><pre>~# sudo ufw allow &#39;Nginx HTTP&#39;<br>Rules updated<br>Rules updated (v6)</pre><p>You can verify ufw allowed application with command below</p><pre>~# sudo ufw status</pre><p>But, if you get a result like this</p><pre>~# sudo ufw status<br>Status: inactive</pre><p>ufw needs to enable first, and you can run the command below (don&#39;t forget to allow with type y when procced ask you)</p><pre>~# sudo ufw enable<br>Command may disrupt existing ssh connections. Proceed with operation (y|n)? y<br>Firewall is active and enabled on system startup<br>~# sudo ufw status<br>Status: active</pre><pre>To                         Action      From<br>--                         ------      ----<br>Nginx HTTP                 ALLOW       Anywhere<br>Nginx HTTP (v6)            ALLOW       Anywhere (v6)</pre><p>after the Nginx has been allowed, you can check the nginx server status.</p><pre>~# systemctl status nginx<br>● nginx.service - A high performance web server and a reverse proxy server<br>     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)<br>     Active: active (running) since Tue 2023-05-30 13:30:27 UTC; 3min 27s ago<br>       Docs: man:nginx(8)<br>   Main PID: 23169 (nginx)<br>      Tasks: 2 (limit: 2323)<br>     Memory: 2.7M<br>        CPU: 23ms<br>     CGroup: /system.slice/nginx.service<br>             ├─23169 &quot;nginx: master process /usr/sbin/nginx -g daemon on; master_process on;&quot;<br>             └─23172 &quot;nginx: worker process&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot;<br><br>Notice: journal has been rotated since unit was started, output may be incomplete.</pre><p>if you see the Active status is active and running you can check the default Nginx website. But, if you get the status Inactive and dead like this</p><pre>~# systemctl status nginx<br>○ nginx.service - A high performance web server and a reverse proxy server<br>     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)<br>     Active: inactive (dead) since Tue 2023-05-30 15:17:24 UTC; 2s ago<br>       Docs: man:nginx(8)<br>    Process: 24365 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)<br>   Main PID: 23169 (code=exited, status=0/SUCCESS)<br>        CPU: 36ms<br><br>Notice: journal has been rotated since unit was started, output may be incomplete.</pre><p>you can start the Nginx first, with the command below.</p><pre>~# sudo systemctl start nginx</pre><p>So, visit your IP address http://your_server_ip if you don&#39;t configure it with the domain, and you got default website like this.</p><h3>3. Basic Command Nginx</h3><ul><li>Start web server</li></ul><pre>~# sudo systemctl start nginx</pre><ul><li>Stop web server</li></ul><pre>~# sudo systemctl stop nginx</pre><ul><li>Restart web server</li></ul><pre>~# sudo systemctl restart nginx</pre><ul><li>Reload web server (if you change your configuration)</li></ul><pre>~# sudo systemctl reload nginx</pre><ul><li>Disable web server</li></ul><pre>~# sudo systemctl disable nginx</pre><ul><li>Enable web server</li></ul><pre>~# sudo systemctl enable nginx</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca05e82267ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Batch Processing with Kafka using Karafka Batch]]></title>
            <link>https://mamxalf.medium.com/batch-processing-with-kafka-using-karafka-batch-ac42b6e4a4a0?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac42b6e4a4a0</guid>
            <category><![CDATA[karafka]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Sun, 28 May 2023 11:21:22 GMT</pubDate>
            <atom:updated>2023-05-31T00:29:39.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OlstDxpXjLu9oKF5wmB2Sg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@lisah_stl?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Lisa Hanly</a> on <a href="https://unsplash.com/photos/KdStCuPnH2U?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Sometimes in several cases don’t need a real-time update, but in reality there still use real-time one by one to update data, which can be burdensome I/O in the database for example. So for the solution to decrease the load in the I/O database we can use batching process. In this article, I have a use case when the application has a receiver webhook and they need to buffer the data and batching process because they don’t need real-time data update. Here is the story!</p><h3>Table of Contents</h3><ul><li>Use case Story</li><li>Setup Karafka in Ruby on Rails</li><li>Testing the Batch process</li></ul><h3>Use case Story</h3><p>I have found a case (webhook receiver) in an application they don’t need a real-time update. I will create diagrams of the existing flow (before using batching process) and how I increase performance with the batching process.</p><h4>Existing Process (Before)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*XxoG3N_l4D-E58nywo47xA.png" /><figcaption>existing diagram (before adjusted)</figcaption></figure><p>the diagram above illustrates if every request data is processed directly. So, if sometimes you got a lot of requests that can make your database I/O increased significantly.</p><h4>Adjust flow with Batching Process</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*yJSHh426QWHQiQ1urO-4rw.png" /><figcaption>diagram to adjust process flow</figcaption></figure><p>the diagram above if you see, some requests entered the webhook receiver but after they entered to webhook receiver the data has been buffered with Kafka. So, after data has been buffered the background job can run with batch and that can make decrease the database I/O significantly.</p><h3>Setup Karafka in Ruby on Rails</h3><p>Firstly, we need some gems</p><pre># core karafka<br>gem &#39;karafka&#39;<br><br># for testing<br>gem &#39;karafka-testing&#39;<br>gem &#39;rspec&#39;</pre><p>and when I install them I got this versions in Gemfile.lock maybe if you follow this article in someday that can be different 😄</p><pre># .....<br>    karafka (2.1.2)<br>      karafka-core (&gt;= 2.0.13, &lt; 3.0.0)<br>      thor (&gt;= 0.20)<br>      waterdrop (&gt;= 2.5.3, &lt; 3.0.0)<br>      zeitwerk (~&gt; 2.3)<br>    karafka-core (2.0.13)<br>      concurrent-ruby (&gt;= 1.1)<br>      karafka-rdkafka (&gt;= 0.12.3)<br>    karafka-rdkafka (0.12.3)<br>      ffi (~&gt; 1.15)<br>      mini_portile2 (~&gt; 2.6)<br>      rake (&gt; 12)<br>    karafka-testing (2.1.0)<br>      karafka (&gt;= 2.1.0, &lt; 3.0.0)<br>    karafka-web (0.5.2)<br>      erubi (~&gt; 1.4)<br>      karafka (&gt;= 2.0.40, &lt; 3.0.0)<br>      karafka-core (&gt;= 2.0.12, &lt; 3.0.0)<br>      roda (~&gt; 3.63)<br>      tilt (~&gt; 2.0)<br># ........</pre><p>After the gem is installed in Rails, make a file karafka.rb in the root directory.</p><pre>class KarafkaApp &lt; Karafka::App<br>  setup do |config|<br>    config.kafka = { &#39;bootstrap.servers&#39;: &#39;127.0.0.1:9092&#39; }<br>    config.client_id = &#39;Conto&#39;<br>    config.concurrency = 2<br>    config.max_wait_time = 500 # 0.5 second<br>    config.max_messages = 10 # You can adjust with your requirement if you don&#39;t change this (default: 100)<br>    # Recreate consumers with each batch. This will allow Rails code reload to work in the<br>    # development mode. Otherwise Karafka process would not be aware of code changes<br>    config.consumer_persistence = !Rails.env.development?<br>  end<br>  # Comment out this part if you are not using instrumentation and/or you are not<br>  # interested in logging events for certain environments. Since instrumentation<br>  # notifications add extra boilerplate, if you want to achieve max performance,<br>  # listen to only what you really need for given environment.<br>  Karafka.monitor.subscribe(Karafka::Instrumentation::LoggerListener.new)<br>  # Karafka.monitor.subscribe(Karafka::Instrumentation::ProctitleListener.new)<br>  Karafka.producer.monitor.subscribe(<br>    WaterDrop::Instrumentation::LoggerListener.new(Karafka.logger)<br>  )<br>  routes.draw do<br>    # This needs to match queues defined in your ActiveJobs<br>    active_job_topic :default do<br>      # Expire jobs after 1 day<br>      config(partitions: 5, &#39;retention.ms&#39;: 86_400_000)<br>    end<br>    topic :batch_example do<br>      config(partitions: 2)<br>      consumer Kafka::Consumers::BatchExample # consumer class name<br>    end<br>  end<br>end<br><br>Karafka::Web.enable!<br><br># You can tag your processes with any info you want and it is going to be visible via the Web UI<br>git_hash = `git rev-parse --short HEAD`.strip<br>Karafka::Process.tags.add(:commit, &quot;##{git_hash}&quot;)</pre><p>Actually above is the standard configuration from <a href="https://github.com/karafka/example-apps">https://github.com/karafka/example-apps</a>.</p><h3>Create the producer, consumer and integrate web UI if you need</h3><p>Because in this article just want to make an example to make batch process. So. I will create an example just for testing so the reader can get illustrated. In this example the directory I will put inside ./app/jobs/kafka/... like this :</p><pre>❯ tree app/jobs<br>app/jobs<br>├── application_job.rb<br>└── kafka<br>    ├── consumers<br>    │   └── batch_example.rb<br>    └── producers<br>        └── batch_example.rb<br>4 directories, 3 files</pre><pre># ../consumers/batch_example.rb<br># note: this class will be used in karafka.rb (you can see at above)<br><br># frozen_string_literal: true<br><br>class Kafka::Consumers::BatchExample &lt; Karafka::BaseConsumer<br>  def consume<br>    Rails.logger.debug &#39;==================== BATCH CONSUMER START ====================&#39;<br>    messages.each do |message|<br>      Rails.logger.debug message.payload<br>    end<br>    Rails.logger.debug &#39;==================== BATCH CONSUMER END ====================&#39;<br>    sum = messages.sum { |message| message.payload[&#39;number&#39;] }<br>    Karafka.logger.info &quot;Sum of #{messages.count} elements equals to: #{sum}&quot;<br>  rescue =&gt; e<br>    Karafka.logger.error e<br>  end<br>end</pre><blockquote>Actually, in this consumer you can make something with batch data, like update data with bathing process or many more. But, in this article i just give you example to imagine batching process with kafka.</blockquote><pre># ../producers/batch_example<br><br># frozen_string_literal: true<br><br>class Kafka::Producers::BatchExample<br>  def initialize(messages)<br>    @messages = messages<br>  end<br><br>  def perform<br>    ::Karafka.producer.produce_async(<br>      topic:   &#39;batch_example&#39;,<br>      payload: @messages.to_json,<br>        )<br>  end<br>end</pre><p>and the last don’t forget to integrate karafka UI too, in routers.rb if you need 👌</p><pre># config/routes.rb<br><br># frozen_string_literal: true<br><br>require &#39;karafka/web&#39;<br>Rails.application.routes.draw do<br>  # another router ....<br>  mount Karafka::Web::App, at: &#39;/karafka&#39;<br>end</pre><h3>Testing the batch process</h3><p>This is the last part of this article. So, firstly I will give an example to execute manual from the terminal. Check this out!</p><p>before we try to test whether it’s manual or with rspec, you need to run kafka locally. In this article I run kafka with docker. So, here my docker-compose.yml</p><pre>version: &#39;3&#39;<br>services:<br>  kafka:<br>    image: bitnami/kafka:latest<br>    container_name: kafka<br>    environment:<br>      - KAFKA_ENABLE_KRAFT=yes<br>      - KAFKA_CFG_PROCESS_ROLES=broker,controller<br>      - KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER<br>      - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093<br>      - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT<br>      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092<br>      - KAFKA_CFG_BROKER_ID=1<br>      - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=1@127.0.0.1:9093<br>      - ALLOW_PLAINTEXT_LISTENER=yes<br>      - KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true<br>      - KAFKA_CFG_NODE_ID=1  # Set the KAFKA_CFG_NODE_ID for the quorum controller<br>    ports:<br>      - &#39;9092:9092&#39;</pre><h3>Manual Test</h3><p>Firstly, in root directory execute this command</p><pre>❯ bundle exec karafka server<br>@@@                                             @@@@@  @@@<br>@@@                                            @@@     @@@<br>@@@  @@@    @@@@@@@@@   @@@ @@@   @@@@@@@@@  @@@@@@@@  @@@  @@@@   @@@@@@@@@<br>@@@@@@     @@@    @@@   @@@@@    @@@    @@@    @@@     @@@@@@@    @@@    @@@<br>@@@@@@@    @@@    @@@   @@@     @@@@    @@@    @@@     @@@@@@@    @@@    @@@<br>@@@  @@@@  @@@@@@@@@@   @@@      @@@@@@@@@@    @@@     @@@  @@@@   @@@@@@@@@@<br><br>Upgrade to Karafka Pro for more features and support: &lt;https://karafka.io&gt;<br>Running in ruby 3.2.1 (2023-02-08 revision 31819e82c8) [arm64-darwin22]<br>Running Karafka 2.1.2 server<br>See LICENSE and the LGPL-3.0 for licensing details<br>[0a124f3e4679] Async producing of 1 messages to 1 topics took 1.6779999732971191 ms<br>[0a124f3e4679] [{:topic=&gt;&quot;karafka_consumers_reports&quot;, :payload=&gt;&quot;{\\&quot;schema_version\\&quot;:\\&quot;1.2.0\\&quot;,\\&quot;type\\&quot;:\\&quot;consumer\\&quot;,\\&quot;dispatched_at\\&quot;:1685269658.467652,\\&quot;process\\&quot;:{\\&quot;started_at\\&quot;:1685269658.1541078,\\&quot;name\\&quot;:\\&quot;MacBooks-MacBook-Air.local:17317:ba2141f30114\\&quot;,\\&quot;status\\&quot;:\\&quot;running\\&quot;,\\&quot;listeners\\&quot;:2,\\&quot;concurrency\\&quot;:2,\\&quot;memory_usage\\&quot;:145456,\\&quot;memory_total_usage\\&quot;:3384120,\\&quot;memory_size\\&quot;:8589934592,\\&quot;cpu_count\\&quot;:8,\\&quot;cpu_usage\\&quot;:[2.58,2.48,2.48],\\&quot;tags\\&quot;:[\\&quot;#33bce0e\\&quot;]},\\&quot;versions\\&quot;:{\\&quot;ruby\\&quot;:\\&quot;ruby 3.2.1-31 31819e\\&quot;,\\&quot;karafka\\&quot;:\\&quot;2.1.2\\&quot;,\\&quot;waterdrop\\&quot;:\\&quot;2.5.3\\&quot;,\\&quot;karafka_core\\&quot;:\\&quot;2.0.13\\&quot;,\\&quot;rdkafka\\&quot;:\\&quot;0.12.3\\&quot;,\\&quot;librdkafka\\&quot;:\\&quot;2.0.2\\&quot;},\\&quot;stats\\&quot;:{\\&quot;busy\\&quot;:0,\\&quot;enqueued\\&quot;:0,\\&quot;utilization\\&quot;:0,\\&quot;total\\&quot;:{\\&quot;batches\\&quot;:0,\\&quot;messages\\&quot;:0,\\&quot;errors\\&quot;:0,\\&quot;retries\\&quot;:0,\\&quot;dead\\&quot;:0}},\\&quot;consumer_groups\\&quot;:{},\\&quot;jobs\\&quot;:[]}&quot;, :key=&gt;&quot;MacBooks-MacBook-Air.local:17317:ba2141f30114&quot;, :partition=&gt;0}]<br>[4aa7272886bc] Polling messages...<br>[881a45a6e649] Polling messages...<br>#............</pre><p>So after karafka server is up, you can test with rails console to test if the batching process if succeed. to test I executed command like this.</p><pre>❯ rails c<br>Loading development environment (Rails 7.0.4.2)<br>irb(main):001:0&gt; 213.times.each { |_|  Kafka::Producers::BatchExample.new({ &#39;number&#39; =&gt; rand }).perform }<br>[9a66dd3bbb9b] Async producing of a message to &#39;batch_example&#39; topic took 13.630000114440918 ms<br>[9a66dd3bbb9b] {:topic=&gt;&quot;batch_example&quot;, :payload=&gt;&quot;{\\&quot;number\\&quot;:0.6800771225867617}&quot;}<br>[9a66dd3bbb9b] Async producing of a message to &#39;batch_example&#39; topic took 0.026000261306762695 ms<br>[9a66dd3bbb9b] {:topic=&gt;&quot;batch_example&quot;, :payload=&gt;&quot;{\\&quot;number\\&quot;:0.6247043818551317}&quot;}<br>[9a66dd3bbb9b] Async producing of a message to &#39;batch_example&#39; topic took 0.012000083923339844 ms<br>[9a66dd3bbb9b] {:topic=&gt;&quot;batch_example&quot;, :payload=&gt;&quot;{\\&quot;number\\&quot;:0.41191365984889317}&quot;}<br>[9a66dd3bbb9b] Async producing of a message to &#39;batch_example&#39; topic took 0.009999990463256836 ms<br>[9a66dd3bbb9b] {:topic=&gt;&quot;batch_example&quot;, :payload=&gt;&quot;{\\&quot;number\\&quot;:0.9100126240824636}&quot;}<br>[9a66dd3bbb9b] Async producing of a message to &#39;batch_example&#39; topic took 0.009999752044677734 ms<br>[9a66dd3bbb9b] {:topic=&gt;&quot;batch_example&quot;, :payload=&gt;&quot;{\\&quot;number\\&quot;:0.07528866104859089}&quot;}<br>#.........</pre><p>after executing the command above, you can see the batch process has succeeded by seeing the log from the terminal that has executed bundle exec karafka server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UBP8mFHI3sTububS6CAFbw.jpeg" /><figcaption>log from karafka</figcaption></figure><p>the message executed by 10 and the last 3 executed just 3 because that doesn’t have another message when the karafka configured max_wait_time = 500 # 0.5 second. So, if you increase the number you will see by yourself with yourself configuration 🤝.</p><h3>Testing with Rspec and kafka-testing</h3><p>After trying testing manually way. So, I will try with unit test by rspec and kafka-testing.</p><p>Firstly, create the _spec.rb file inside test/karafka (Actually, this is uptoyou guys 😃).</p><pre># test/karafka/batch_example_spec.rb<br><br># frozen_string_literal: true<br><br>require &#39;rails_helper&#39;<br>RSpec.describe Kafka::Consumers::BatchExample do<br>  subject(:consumer) { karafka.consumer_for(:batch_example) }<br>  <br>  let(:nr1_value) { rand }<br>  let(:nr2_value) { rand }<br>  let(:sum) { nr1_value + nr2_value }<br><br>  before do<br>    # Sends first message to Karafka consumer<br>    karafka.produce({ &#39;number&#39; =&gt; nr1_value }.to_json)<br>    # Sends second message to Karafka consumer<br>    karafka.produce({ &#39;number&#39; =&gt; nr2_value }.to_json)<br>    allow(Karafka.logger).to receive(:info)<br>  end<br>    <br>  it &#39;expects to log a proper message&#39; do<br>    expect(Karafka.logger).to receive(:info).with(&quot;Sum of 2 elements equals to: #{sum}&quot;)<br>    consumer.consume<br>  end<br>end</pre><p>but don’t forget to include the karafka rspec helper in rails_helper.rb</p><pre># .....<br>require &#39;karafka/testing/rspec/helpers&#39;<br># .....<br>RSpec.configure do |config|<br># .....<br>config.include Karafka::Testing::RSpec::Helpers<br># .....<br>end</pre><p>So, run the rspec command</p><pre>❯ bundle exec rspec test/karafka/batch_example_spec.rb<br>.<br><br>Finished in 0.02734 seconds (files took 1.61 seconds to load)<br>1 example, 0 failures</pre><p>Thank you guys, that’s all from me.</p><p>Bye bye ✋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac42b6e4a4a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rubygems in the making, First Step!]]></title>
            <link>https://mamxalf.medium.com/rubygems-in-the-making-first-step-766251c29ee5?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/766251c29ee5</guid>
            <category><![CDATA[rubygems]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Sat, 27 May 2023 16:17:31 GMT</pubDate>
            <atom:updated>2023-05-27T16:18:11.638Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SjhP7drTguzQdQT40XwBJg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jasondeblooisphotography?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jason D</a> on <a href="https://unsplash.com/photos/VKLJ-BJlszE?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In this opportunity, I want to share how to make Rubygems study case and the name is Watesan.</p><blockquote><em>Watesan is a name taken from Javanese language (my hometown) which mean limit<br>- </em>just intermezzo guys 😄</blockquote><p>So, firstly let’s build our own rubygems</p><h3>Build own rubygems</h3><h4>1. Generate with boilerplate from rubygems</h4><p>In the first step don’t be confused about how to make rubygems, because there (bundle-gem) is a boilerplate for us to make some gem.</p><pre>bundle gem watesan --coc --mit -t=rspec --ci=github --linter=rubocop</pre><p>command in the above is the first command for how to build rubygems. here is the explanation.</p><ul><li>--coc : Add a CODE_OF_CONDUCT.md file to the root of the generated project. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler´s global config for future bundle gem use.</li><li>--mit : Add an MIT license to a LICENSE.txt file in the root of the generated project. Your name from the global git config is used for the copyright statement. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler´s global config for future bundle gem use.</li><li>-t : Specify the test framework that Bundler should use when generating the project and in this case I choose rspec</li><li>--ci : Specify the continuous integration service that Bundler should use when generating the project and in this case I choose github because i want to save this repository at Github</li><li>—-linter : Specify the linter and code formatter that Bundler should add to the project´s development dependencies and I choose rubocop</li></ul><p>and after you execute the first command you can see the directory</p><pre>❯ tree watesan<br>watesan<br>├── CHANGELOG.md<br>├── CODE_OF_CONDUCT.md<br>├── Gemfile<br>├── LICENSE.txt<br>├── README.md<br>├── Rakefile<br>├── bin<br>│   ├── console<br>│   └── setup<br>├── lib<br>│   ├── watesan<br>│   │   └── version.rb<br>│   └── watesan.rb<br>├── sig<br>│   └── watesan.rbs<br>├── spec<br>│   ├── spec_helper.rb<br>│   └── watesan_spec.rb<br>└── watesan.gemspec<br><br>6 directories, 14 files</pre><p>here is the explanation (I will explain just for the important and workspace when we develop rubygems) :</p><ul><li>Gemfile : specifies the gem dependencies required by the project.</li><li>lib/ : almost code has been written in this place.</li><li>spec/ : the place for unit test.</li><li>watesan.gemspec : it is used to define metadata and dependencies for a rubygems it self.</li></ul><h4>2. Configure .gemspec</h4><p>before we start writing code, we must configure the .gemspec first. So, you can write by following the instruction, don’t forget to create account at <a href="https://rubygems.org/">Rubygems</a>. and here my own .gemspec :</p><pre># frozen_string_literal: true<br><br>require_relative &#39;lib/watesan/version&#39;<br>Gem::Specification.new do |spec|<br>  spec.name = &#39;watesan&#39;<br>  spec.version = Watesan::VERSION<br>  spec.authors = [&#39;Hammam Firdaus&#39;]<br>  spec.email = [&#39;hammamxalf@gmail.com&#39;]<br>  spec.summary = &#39;Gem for Rate Limiter using Redis&#39;<br>  spec.description = &#39;Gem for Rate Limiter using Redis&#39;<br>  spec.homepage = &#39;&lt;https://github.com/mamxalf&gt;&#39;<br>  spec.license = &#39;MIT&#39;<br>  spec.required_ruby_version = &#39;&gt;= 2.6.0&#39;<br>  # spec.metadata[&quot;allowed_push_host&quot;] = &quot;TODO: Set to your gem server &#39;&lt;https://example.com&gt;&#39;&quot;<br>  #<br>  spec.metadata[&quot;homepage_uri&quot;] = spec.homepage<br>  spec.metadata[&quot;source_code_uri&quot;] = &quot;&lt;https://github.com/mamxalf/watesan&gt;&quot;<br>  # spec.metadata[&quot;changelog_uri&quot;] = &quot;TODO: Put your gem&#39;s CHANGELOG.md URL here.&quot;<br>  # Specify which files should be added to the gem when it is released.<br>  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.<br>  spec.files = Dir.chdir(__dir__) do<br>    `git ls-files -z`.split(&quot;\\x0&quot;).reject do |f|<br>      (f == __FILE__) || f.match(%r{\\A(?:(?:bin|test|spec|features)/|\\.(?:git|circleci)|appveyor)})<br>    end<br>  end<br>  spec.bindir = &#39;exe&#39;<br>  spec.executables = spec.files.grep(%r{\\Aexe/}) { |f| File.basename(f) }<br>  spec.require_paths = [&#39;lib&#39;]<br>  # Uncomment to register a new dependency of your gem<br>  spec.add_dependency &#39;redis&#39;, &#39;~&gt; 5.0&#39;, &#39;&gt;= 5.0.6&#39;<br>  spec.metadata[&#39;rubygems_mfa_required&#39;] = &#39;true&#39;<br>end</pre><h3>3. Build and Push Rubygems</h3><p>after we have configured about the gemspec, you can to next step to build the gem.</p><pre>❯ gem build watesan.gemspec<br>WARNING:  description and summary are identical<br>WARNING:  See &lt;https://guides.rubygems.org/specification-reference/&gt; for help<br>  Successfully built RubyGem<br>  Name: watesan<br>  Version: 0.1.0<br>  File: watesan-0.1.0.gem</pre><p>command above will generate file with format .gem and with this file you can put this library into rubygems. after watesan-0.1.0.gem generated you can push (upload) with this command.</p><pre>❯ gem push watesan-0.1.0.gem<br>Enter your RubyGems.org credentials.<br>Don&#39;t have an account yet? Create one at &lt;https://rubygems.org/sign_up&gt;<br>   Email:   hammamxalf@gmail.com<br>Password:   <br>Signed in with API key: MacBooks-MacBook-Air.local-mamxalf-20230523192526.<br>Pushing gem to &lt;https://rubygems.org&gt;...<br>Rubygem requires owners to enable MFA. You must enable MFA before pushing new version.</pre><p>if you get result same as above you can create or integrate Multi-factor authentication first. and in this case i&#39;m use Authy. after you configured the MFA you can retry to push the gem.</p><pre>❯ gem push watesan-0.1.0.gem<br>Pushing gem to &lt;https://rubygems.org&gt;...<br>You have enabled multi-factor authentication. Please enter OTP code.<br>Code:   416545<br>Successfully registered gem: watesan (0.1.0)</pre><p>After you got a message Successfully registered gem you can check in your rubygems profile. and congratulation you have built your first ruby gems.</p><p>After this article i will write rubygems for rate limiter backed by Redis.</p><p>Bye bye 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=766251c29ee5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kick far away N+1 from your Rails App (Part 2)]]></title>
            <link>https://mamxalf.medium.com/kick-far-away-n-1-from-your-rails-app-part-2-94ddebfc27f3?source=rss-6dbbb529e7ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/94ddebfc27f3</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[database-development]]></category>
            <dc:creator><![CDATA[Hammam Firdaus]]></dc:creator>
            <pubDate>Sun, 07 May 2023 06:15:15 GMT</pubDate>
            <atom:updated>2023-05-07T06:15:15.585Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QNHEC6isXlDdyWgRgrEw_Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jmuniz?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joel Muniz</a> on <a href="https://unsplash.com/photos/lel3XAEWngM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>By the way, previous article we talk about N+1 in Rails App for retrieving and inserting data. So, in this article, we will go to talk about How to prevent N+1 or How to know, what are your Rails App is N+1 free</p><h4>Bullet (helps to kill N+1 queries and unused eager loading)</h4><p>They said The Bullet gem is designed to help you increase your application&#39;s performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries), when you&#39;re using eager loading that isn&#39;t necessary and when you should use counter cache.</p><p>That was very cool, here I will show you how to configure Rails App with Gem and I will give an example too 👌</p><h4>Setup the Stuff</h4><p>Actually, I just need Bullet for development and Test environment. So, I put to group :development, :test only</p><pre>group :development, :test do<br>	# helps to kill N+1 queries and unused eager loading<br>  gem &#39;bullet&#39;<br>end</pre><p>after gem is installed in your rails app, you can run</p><pre>bundle exec rails g bullet:install</pre><p>So, in config/environments/development.rb and config/environments/test.rb you will get code from Bullet like this.</p><pre># config/environments/development.rb<br>config.after_initialize do<br>  Bullet.enable        = true # enable Bullet gem, otherwise do nothing<br>  Bullet.alert         = true # pop up a JavaScript alert in the browser<br>  Bullet.bullet_logger = true # log to the Bullet log file (Rails.root/log/bullet.log)<br>  Bullet.console       = true # log warnings to your browser&#39;s console.log (Safari/Webkit browsers or Firefox w/Firebug installed)<br>  Bullet.rails_logger  = true # add warnings directly to the Rails log<br>  Bullet.add_footer    = true # adds the details in the bottom left corner of the page. Double click the footer or use close button to hide footer.<br>end<br><br># config/environments/test.rb<br>config.after_initialize do<br>    Bullet.enable        = true # enable Bullet gem, otherwise do nothing<br>    Bullet.bullet_logger = true # log to the Bullet log file (Rails.root/log/bullet.log)<br>    Bullet.raise         = true # raise an error if n+1 query occurs<br>  end</pre><h3>Let’s try!</h3><h4>Test environment</h4><p>After everything is ready, we can try the utility from Bullet. So, I will show you the test environment first with the unit test (I use rspec).</p><p>Here I have some code examples.</p><pre># controller<br>class UserController &lt; ApplicationController<br>  before_action :authenticate_user!<br>  layout &#39;dashboard&#39;<br><br>  def index<br>    @pagy, @users = pagy(User.where(organization_id: current_user.organization_id))<br>  end<br>end</pre><pre>&lt;!-- &lt;tbody&gt; --&gt;<br>&lt;% @users.each do |user| %&gt; &lt;tr&gt;<br>    &lt;td class=&quot;px-4 py-4 text-sm font-medium whitespace-nowrap&quot;&gt;<br>      &lt;div&gt;<br>        &lt;h2 class=&quot;font-medium text-gray-800 dark:text-white &quot;&gt;&lt;%= user.name %&gt; &lt;/h2&gt;<br>				&lt;!-- WATCH HERE --&gt;<br>        &lt;p class=&quot;text-sm font-normal text-gray-600 dark:text-gray-400&quot;&gt;&lt;%= user.organization.name %&gt;&lt;/p&gt;<br>				&lt;!-- HERE --&gt;<br>      &lt;/div&gt;<br>    &lt;/td&gt;<br>&lt;% end %&gt; <br>&lt;!-- &lt;/tbody&gt; --&gt;</pre><p>and here is the unit test</p><pre># frozen_string_literal: true<br>require &#39;rails_helper&#39;<br>RSpec.describe &quot;Users&quot;, type: :request do<br>  include Warden::Test::Helpers<br>  let(:model_organization) { create :organization }<br><br>  def sign_in(resource_or_scope, resource = nil)<br>    resource ||= resource_or_scope<br>    scope = Devise::Mapping.find_scope!(resource_or_scope)<br>    login_as(resource, scope: scope)<br>  end<br><br>  before do<br>    create_list(:user, 100, organization: model_organization)<br>  end<br>  it &#39;should be true when get list user&#39; do<br>    sign_in create(:user, organization: model_organization)<br>    get &#39;/user/index&#39;<br>    expect(response.status).to eq(200)<br>  end<br>end</pre><p>and here are the results</p><pre>❯ bundle exec rspec test/controllers/user_controller_rspec.rb<br>F<br>Failures:<br><br>     1) Users should be true when get list user<br>     Failure/Error: get &#39;/user/index&#39;<br>     <br>     Bullet::Notification::UnoptimizedQueryError:<br>       user: mamxalf<br>       GET /user/index<br>       USE eager loading detected<br>         User =&gt; [:organization]<br>         Add to your query: .includes([:organization])<br>       Call stack<br>         /Users/mamxalf/Repository/Project/Conto/Conto/app/views/user/index.html.erb:42:in `block in _app_views_user_index_html_erb__3089862282655144503_31580&#39;<br>         /Users/mamxalf/Repository/Project/Conto/Conto/app/views/user/index.html.erb:37:in `_app_views_user_index_html_erb__3089862282655144503_31580&#39;<br>         /Users/mamxalf/Repository/Project/Conto/Conto/test/controllers/user_controller_rspec.rb:21:in `block (2 levels) in &lt;top (required)&gt;&#39;<br>     # ./test/controllers/user_controller_rspec.rb:21:in `block (2 levels) in &lt;top (required)&gt;&#39;Finished in 0.57007 seconds (files took 1.65 seconds to load)<br>1 example, 1 failure<br>Failed examples:<br>rspec ./test/controllers/user_controller_rspec.rb:19 # Users should be true when get list user<br>~/Repository/Project/Conto/Conto expreiment*                                                                                                                                                                                                                 07:16:49 AM<br>❯</pre><p>The bullet will rise the error, and how to fix it? Of course, you should go to the <a href="https://medium.com/@mamxalf/kick-far-away-n-1-from-your-rails-app-part-1-36499ab63957">previous article</a> in part 1 🤣.</p><p>If you has been fix it, here are the results.</p><pre>❯ bundle exec rspec test/controllers/user_controller_rspec.rb<br>.<br>Finished in 0.49415 seconds (files took 1.64 seconds to load)<br>1 example, 0 failures<br>~/Repository/Project/Conto/Conto expreiment*                                                                                                                                                                                                                 07:48:54 AM<br>❯</pre><p>Yeaayy Bullet did not raise the N+1 warning again</p><h3>Development Environment</h3><p>Because I’m setup in development too. So, let me show you if in development any N+1 errors what it looks like?</p><p>Go to the router from user_controller#index and you will see an alert like this. and you can change the config in config/environment/development.rb so, you can change the alert place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*UHJOKYRITppZws1NGQSNwA.jpeg" /><figcaption>Error in browser (This is Safari Browser)</figcaption></figure><p>How to fix it? Of course, you should go to the <a href="https://medium.com/@mamxalf/kick-far-away-n-1-from-your-rails-app-part-1-36499ab63957">previous article</a> in part 1 🤣.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94ddebfc27f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>