<?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 Farhan Sadik on Medium]]></title>
        <description><![CDATA[Stories by Farhan Sadik on Medium]]></description>
        <link>https://medium.com/@rkfarhansadik?source=rss-4f7e269dff83------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*z3FqPrwhGSiLjcJXvdznzw.jpeg</url>
            <title>Stories by Farhan Sadik on Medium</title>
            <link>https://medium.com/@rkfarhansadik?source=rss-4f7e269dff83------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 06:53:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rkfarhansadik/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[Part 2 — Memberstack user registration]]></title>
            <link>https://medium.com/@rkfarhansadik/part-2-memberstack-user-registration-e8c2d3f1a04f?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8c2d3f1a04f</guid>
            <category><![CDATA[webflow]]></category>
            <category><![CDATA[memberstack]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 10:45:19 GMT</pubDate>
            <atom:updated>2026-07-01T10:49:46.413Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WTvxhmxDS0Zhim1Z.png" /><figcaption>Source: <a href="https://www.memberstack.com/webflow/elearning-sign-up-form">https://www.memberstack.com/webflow/elearning-sign-up-form</a></figcaption></figure><p>In the previous article, you’ve connected Memberstack with your Webflow project. Now it’s time to build a fully functional user registration system.</p><p>Instead of relying on a default signup form, you’ll create a completely custom registration form in Webflow while allowing Memberstack to handle authentication, member creation, and login behind the scenes. With just a few custom attributes, your beautifully designed Webflow form becomes a powerful membership registration system.</p><h3>What You’ll Build</h3><p>By the end of this tutorial, you’ll have:</p><ul><li>A custom registration form</li><li>First Name and Last Name fields</li><li>Email and Password authentication</li><li>Google and Facebook social login</li><li>Member-only content gating</li><li>Automatic redirect after signup</li><li>Email pre-filling from another page</li></ul><p>Let’s get started.</p><h3>Create and setup the Registration Form</h3><p>First, design your registration form in Webflow.</p><p>Your form should include:</p><ul><li>First Name</li><li>Last Name</li><li>Email</li><li>Password</li><li>Google Signup Button</li><li>Facebook Signup Button</li><li>Submit Button</li></ul><p>Here is the webflow design pattern:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IGI11EO2JXGIZlsg6tUWLA.png" /></figure><p>On the design, you’ll have to attached some of the items with attributes. Here is the list of items and attribues.</p><ol><li><strong>Form</strong></li></ol><pre>// Those must be setup to the inner div of form. <br>ID: REGISTRATION_FORM<br>Name: Registration Form<br>Attributes: data-ms-form=&quot;signup&quot;</pre><p><strong>2. Name input field</strong></p><pre>ID: REG_NAME<br>Field Name: REG_NAME<br>Type: Plain<br>Attributes: data-ms-member=&quot;first-name&quot;<br><br>// if you&#39;ve last name field<br>Attributes: data-ms-member=&quot;last-name&quot;</pre><p><strong>3. Email input field</strong></p><pre>ID: REG_EMAIL<br>Field Name: REG_EMAIL<br>Type: Email<br>Attributes: data-ms-member=&quot;email&quot;</pre><p><strong>4. Password input filed</strong></p><pre>ID: REG_PASSWORD<br>Field Name: REG_PASSWORD<br>Type: Password<br>Attributes: data-ms-member=&quot;password&quot;</pre><p><strong>5. Checkbox (Terms of Service)</strong></p><p>User’s must have to check the checkbox otherwise the ‘<strong>register</strong>’ button won’t be active. The checkbox itself does not required any attributes. But It does need an ID and custom Code.</p><p>Checkbox id: reg-chkbox-terms</p><p>Custom code for checkbox:</p><pre><br>document.addEventListener(&#39;DOMContentLoaded&#39;, function () {<br>  const form = document.getElementById(&#39;REGISTRATION_FORM&#39;);<br>  const element = document.getElementById(&#39;reg-chkbox-terms&#39;);<br>  const submitButton = document.getElementById(&#39;create-acc-submit-btn&#39;);<br><br>  if (!form || !element || !submitButton) {<br>    console.warn(&#39;Registration form, checkbox, or submit button not found.&#39;);<br>    return;<br>  }<br><br>  let checkbox = null;<br><br>  // Case 1: ID is directly on the real checkbox input<br>  if (element.matches(&#39;input[type=&quot;checkbox&quot;]&#39;)) {<br>    checkbox = element;<br>  }<br><br>  // Case 2: ID is on a wrapper that contains the checkbox input<br>  if (!checkbox) {<br>    checkbox = element.querySelector(&#39;input[type=&quot;checkbox&quot;]&#39;);<br>  }<br><br>  // Case 3: ID is on a custom Webflow checkbox div inside a label<br>  if (!checkbox) {<br>    const parentLabel = element.closest(&#39;label&#39;);<br>    if (parentLabel) {<br>      checkbox = parentLabel.querySelector(&#39;input[type=&quot;checkbox&quot;]&#39;);<br>    }<br>  }<br><br>  if (!checkbox) {<br>    console.warn(&#39;Real checkbox input not found.&#39;);<br>    return;<br>  }<br><br>  // Create error message<br>  let errorMessage = document.getElementById(&#39;terms-error-message&#39;);<br><br>  if (!errorMessage) {<br>    errorMessage = document.createElement(&#39;div&#39;);<br>    errorMessage.id = &#39;terms-error-message&#39;;<br>    errorMessage.textContent = &#39;Please accept the terms and conditions before creating an account.&#39;;<br>    errorMessage.style.color = &#39;#d93025&#39;;<br>    errorMessage.style.fontSize = &#39;14px&#39;;<br>    errorMessage.style.marginTop = &#39;8px&#39;;<br>    errorMessage.style.display = &#39;none&#39;;<br><br>    submitButton.insertAdjacentElement(&#39;beforebegin&#39;, errorMessage);<br>  }<br><br>  function enableSubmit() {<br>    submitButton.disabled = false;<br>    submitButton.removeAttribute(&#39;disabled&#39;);<br>    submitButton.setAttribute(&#39;aria-disabled&#39;, &#39;false&#39;);<br>    submitButton.style.opacity = &#39;1&#39;;<br>    submitButton.style.cursor = &#39;pointer&#39;;<br>    errorMessage.style.display = &#39;none&#39;;<br>  }<br><br>  function disableSubmit() {<br>    submitButton.disabled = true;<br>    submitButton.setAttribute(&#39;disabled&#39;, &#39;disabled&#39;);<br>    submitButton.setAttribute(&#39;aria-disabled&#39;, &#39;true&#39;);<br>    submitButton.style.opacity = &#39;0.5&#39;;<br>    submitButton.style.cursor = &#39;not-allowed&#39;;<br>  }<br><br>  function updateSubmitState() {<br>    console.log(&#39;Checkbox checked:&#39;, checkbox.checked);<br><br>    if (checkbox.checked) {<br>      enableSubmit();<br>    } else {<br>      disableSubmit();<br>    }<br>  }<br><br>  function blockSubmitIfUnchecked(event) {<br>    if (!checkbox.checked) {<br>      event.preventDefault();<br>      event.stopPropagation();<br>      event.stopImmediatePropagation();<br><br>      errorMessage.style.display = &#39;block&#39;;<br>      disableSubmit();<br><br>      console.warn(&#39;Registration blocked: terms checkbox is not checked.&#39;);<br>      return false;<br>    }<br><br>    enableSubmit();<br>  }<br><br>  // Default state<br>  updateSubmitState();<br><br>  // Update when checkbox changes<br>  checkbox.addEventListener(&#39;change&#39;, updateSubmitState);<br><br>  // Helpful for Webflow custom checkbox UI<br>  checkbox.addEventListener(&#39;click&#39;, function () {<br>    setTimeout(updateSubmitState, 10);<br>  });<br><br>  // Block submit button click if checkbox is unchecked<br>  submitButton.addEventListener(&#39;click&#39;, blockSubmitIfUnchecked, true);<br><br>  // Block form submit if checkbox is unchecked<br>  form.addEventListener(&#39;submit&#39;, blockSubmitIfUnchecked, true);<br>});</pre><p><strong>6. hCaptcha</strong></p><p>Its a captcha, to prevent spam. To use this, at first you’ll have to enable it from memberstack.</p><p><strong>Memberstack:</strong></p><p>Memberstack &gt; Settings &gt; Application &gt; Security</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFDLGSTsRiAlLiL2Yj6MdQ.png" /><figcaption>Memberstack Settings</figcaption></figure><p>On webflow, you’ll have to create a div. And then add the attribute data-ms-hcaptcha=&quot;light&quot; <strong>or</strong> data-ms-hcaptcha=&quot;dark&quot;. Use &quot;light&quot; to create a light mode Captcha and &quot;dark&quot; for dark mode.</p><p><strong>Note:</strong> The hCaptcha element is an iframe and has a max width of 302px. You can make the box more compact by adding the attribute data-size=&quot;compact&quot;. More info in the <a href="https://docs.hcaptcha.com/configuration/#hcaptcha-container-configuration">hCaptcha Docs</a>.</p><p><strong>7. Register Button</strong></p><p>It does need an id, otherwise it cannot interact with checkbox script.</p><p>Register button id: create-acc-submit-btn</p><p>At first, take a look at the finished form layout before recreating it in Webflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDbBvFGMNF1rojEH93wndw.png" /><figcaption>Source: <a href="https://farhans-dawn-ticket-experiment.webflow.io/authentication/register">https://farhans-dawn-ticket-experiment.webflow.io/authentication/register</a></figcaption></figure><h3>Configure Social Authentication</h3><p>Modern users expect a fast and convenient signup experience, and social authentication makes that possible. Instead of filling out a registration form and creating a new password, users can sign up or log in with their existing Google or Facebook accounts in just a few clicks.</p><p>Memberstack uses secure <strong>OAuth authentication</strong>, which means it never handles or stores users’ social account passwords. Authentication is securely managed by the selected provider, while Memberstack creates and manages the member profile after a successful login.</p><p>Before using social authentication, you’ll need to enable your preferred providers in the <strong>Memberstack Dashboard</strong> under <strong>Settings → Auth Providers</strong>. Follow the setup instructions to connect your Google and/or Facebook developer credentials. Once configured, Memberstack handles the entire authentication flow automatically.</p><p>After enabling the providers, create two buttons beside your signup form in Webflow.</p><p>Create two buttons beside your signup form.</p><h4>Google Signup</h4><p>Select your <strong>Google Signup</strong> button and add the following custom attribute:</p><p>Attribute value: data-ms-auth-provider=“google”</p><h4>Facebook Signup</h4><p>Select your <strong>Facebook Signup</strong> button and add the following custom attribute:</p><p>Attribute value: data-ms-auth-provider=&quot;facebook&quot;</p><p>When a visitor clicks one of these buttons, Memberstack automatically redirects them to the selected provider’s authentication page. After they grant permission, Memberstack creates a new member account (or logs them into an existing one), starts their session, and returns them to your website. This entire process happens without requiring users to manually enter their email address or password, resulting in a faster signup experience and often improving registration conversion rates.</p><h3>Memberstack</h3><p>When someone successfully register into your website, he will be logged in to your website and the user data will visible on memberstack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfbRBLNZncnTyhCQrBONXg.png" /></figure><h3>How Registration Works</h3><p>Once everything is connected, the workflow becomes incredibly simple.</p><p>When a visitor:</p><ol><li>Enters their information</li><li>Clicks <strong>Create Account</strong></li></ol><p>Memberstack will automatically:</p><ul><li>Validate the form</li><li>Create the member account</li><li>Save all custom field data</li><li>Log the user in</li><li>Create their member profile</li></ul><p>No backend development is required.</p><h3>Redirect Users After Registration</h3><p>A polished user experience usually sends new members directly to their dashboard after signup.</p><p>Add the following JavaScript before the closing &lt;/body&gt; tag of your page.</p><pre>// Wait for the page to load<br>document.addEventListener(&quot;DOMContentLoaded&quot;, function() {<br>    // Target the specific form<br>    const signupForm = document.querySelector(&#39;[data-ms-form=&quot;signup&quot;]&#39;);<br>    <br>    if (signupForm) {<br>        // Memberstack will handle the submit, but we watch for the success state<br>        const observer = new MutationObserver(function(mutations) {<br>            mutations.forEach(function(mutation) {<br>                // Check if a member is now logged in (success)<br>                if (window.$memberstackDom &amp;&amp; localStorage.getItem(&#39;memberstack_logged_in&#39;) === &#39;true&#39;) {<br>                    window.location.href = &quot;/dashboard&quot;;<br>                }<br>            });<br>        });<br>        observer.observe(document.body, { childList: true, subtree: true });<br>    }<br>});</pre><p>Once registration succeeds, users will automatically be redirected to:</p><pre>/dashboard</pre><h3>Pre-Fill the Email Field</h3><p>If your website captures an email address on a landing page before sending users to the signup page, you can automatically populate the email field.</p><p>Add the following JavaScript to your signup page:</p><pre><br>window.onload = function() {<br>  const urlParams = new URLSearchParams(window.location.search);<br>  const email = urlParams.get(&#39;email&#39;);<br>  if (email) {<br>    const emailField = document.querySelector(&#39;[data-ms-member=&quot;email&quot;]&#39;);<br>    if (emailField) emailField.value = email;<br>  }<br>};</pre><p>Your landing page should redirect users like this:</p><pre>/signup?email=user@example.com</pre><p>When the signup page loads, the email field will already be filled in, reducing friction during registration.</p><h3>Troubleshooting &amp; Best Practices</h3><p>If your registration form isn’t working as expected, here are a few things to check:</p><ul><li>Ensure the form has the data-ms-form=&quot;signup&quot; attribute.</li><li>Verify that each input field has the correct data-ms-member value.</li><li>Make sure your custom field IDs in Memberstack match the attribute values exactly.</li><li>Set the password field type to <strong>Password</strong>.</li><li>Disable Webflow’s built-in reCAPTCHA if it conflicts with Memberstack’s submission handler.</li><li>Hidden fields can also be used by adding data-ms-member to an &lt;input type=&quot;hidden&quot;&gt;.</li><li>Test the complete signup flow using Memberstack’s free plan before launching your site.</li></ul><h3>Conclusion</h3><p>Congratulations! You have successfully built a fully customized Memberstack registration system in Webflow.</p><p>By using a few simple attributes like data-ms-form, data-ms-member, and data-ms-auth-provider, your custom-designed Webflow form now functions as a complete membership registration system. You also added social login, protected member-only content, automatic redirects, and email pre-filling to create a smooth and professional signup experience.</p><p>In the next section, you’ll learn how to build a custom login experience and manage authenticated user sessions with Memberstack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8c2d3f1a04f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1 — Memberstack implementation with webflow]]></title>
            <link>https://medium.com/@rkfarhansadik/part-1-memberstack-implementation-with-webflow-289af26d59b8?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/289af26d59b8</guid>
            <category><![CDATA[memberstack]]></category>
            <category><![CDATA[webflow]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 09:24:19 GMT</pubDate>
            <atom:updated>2026-07-01T09:24:19.748Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EjQDBSz97naod6aZ.jpg" /><figcaption>Source: <a href="https://webflow.com/apps/detail/memberstack">https://webflow.com/apps/detail/memberstack</a></figcaption></figure><h3>Introduction</h3><p>Building modern websites often requires more than just design. You also need user authentication, member management, and database-like functionality. This is where <strong>Memberstack + Webflow</strong> becomes a powerful combination.</p><p>In this article, we will understand what Memberstack is, how it works, and how you can connect it with Webflow to build real-world applications without a backend.</p><blockquote>Stop thinking Webflow is just for static websites. With Memberstack, you can turn it into a full SaaS-level application.</blockquote><h3>What is Memberstack?</h3><p><strong>Memberstack</strong> is a no-code/low-code authentication and membership tool that allows you to add:</p><ul><li>User signup and login</li><li>Paid memberships</li><li>Private content access</li><li>User-specific data storage (Data Tables)</li><li>Secure member dashboards</li></ul><p>It works as a backend layer for websites built in platforms like Webflow, Wordpress or custom frontend apps.</p><h3>What you can build with this setup</h3><p>Once Webflow and Memberstack are connected, you can build:</p><ul><li>CRM systems</li><li>Member dashboards</li><li>Booking systems</li><li>Job boards</li><li>SaaS MVPs</li><li>User-based applications</li></ul><h3>How does Memberstack work?</h3><p>Memberstack works by connecting your frontend website with a secure backend system. It is not a traditional backend like Node.js or Django, but it behaves like a <strong>backend-as-a-service layer</strong> that handles authentication, user data, and storage behind the scenes.</p><p>This means you don’t need to build servers, databases, or authentication logic from scratch.</p><p>Instead, Memberstack gives you a ready-made system that your frontend (Webflow) can talk to using JavaScript.</p><h4>Step-by-step flow:</h4><ol><li>User interacts with Webflow UI</li><li>Memberstack handles authentication</li><li>Data is stored in Memberstack’s system</li><li>JavaScript API connects frontend with backend</li><li>Data is displayed dynamically on the website</li></ol><p>So instead of building a backend from scratch, you simply use Memberstack’s API.</p><h3>How to connect Memberstack with Webflow?</h3><p>Connecting Memberstack with Webflow is very simple.</p><h4>Step 1: Install Memberstack script</h4><p>Add Memberstack script in Webflow:</p><ul><li>Go to <strong>Project Settings</strong></li><li>Open <strong>Custom Code</strong></li><li>Paste Memberstack script in &lt;head&gt;</li></ul><pre>&lt;!-- Memberstack webflow package --&gt;<br>&lt;script data-memberstack-app=&quot;app_cmfxsmur6012q0wuba6nf2cib&quot; src=&quot;https://static.memberstack.com/scripts/v2/memberstack.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mEMjbb2csEIlTiPo6r83zA.png" /></figure><h4>Step 2: Publish the website</h4><p>After adding the cdn script, then publish the website. After publishing the website, you’ll able to see ‘Test Mode’ at the middle bottom of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_wY1kFXBOMH0XreZ7o7Lg.png" /></figure><h3>Final Thoughts</h3><p>Memberstack + Webflow is a powerful combination for building scalable web applications without traditional backend development.</p><p>It allows designers and developers to focus on UI/UX while still enabling real data functionality like authentication and databases.</p><p>If you understand this system well, you can build almost any SaaS MVP using just Webflow and JavaScript.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=289af26d59b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Custom Cookie Consent System for a Webflow Website]]></title>
            <link>https://medium.com/@rkfarhansadik/building-a-custom-cookie-consent-system-for-a-webflow-website-a494d085c774?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/a494d085c774</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[webflow]]></category>
            <category><![CDATA[website-cookies]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Wed, 24 Jun 2026 04:32:08 GMT</pubDate>
            <atom:updated>2026-06-24T04:33:46.825Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CCliUYAS3Z6wfP1e" /><figcaption>Photo by <a href="https://unsplash.com/@vyshnavibisani?utm_source=medium&amp;utm_medium=referral">Vyshnavi Bisani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Cookies are one of those website features that most users see every day, but many beginner developers do not fully understand how they work behind the scenes.</p><p>Recently, I worked on building a custom cookie consent system for a Webflow website. Instead of using a third-party cookie banner plugin, I wanted to understand the logic myself and create a custom solution with HTML, CSS, and JavaScript.</p><p>In this article, I’ll explain what website cookies are, why they are used, and how I created a custom cookie preference system with toggles, localStorage, and browser cookies.</p><h3>What Is a Website Cookie?</h3><p>A cookie is a small piece of data that a website stores in the user’s browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aM5A0mBJSgO21dq8.png" /></figure><p>Websites use cookies to remember information about the user or their activity. For example, cookies can help a website remember that a user is logged in, that they selected a language preference, or that they accepted or rejected cookie tracking.</p><p><strong>A simple example:</strong></p><ol><li>User visits website</li><li>Website shows cookie banner</li><li>User accepts or rejects cookies</li><li>Website saves that choice in the browser</li><li>Next time user visits, website remembers the choice</li></ol><p>Cookies are not harmful by themselves. They are just small data records. However, cookies can be used for tracking, analytics, advertising, and personalization, so it is important to give users control over what they allow.</p><h3>Common Types of Cookies</h3><p>For my cookie preference system, I used four common cookie categories:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbhSs3HpHSFCXPQyfRVcRA.png" /></figure><h4>1. Strictly Necessary Cookies</h4><p>These are required for the website to work properly.</p><p><strong>Examples include:</strong></p><ul><li>Login sessions</li><li>Security settings</li><li>Form protection</li><li>Basic website functionality</li></ul><p>These cookies are usually always enabled because the website may not function correctly without them.</p><h4>2. Functional Cookies</h4><p>Functional cookies help remember user preferences.</p><p><strong>Examples include:</strong></p><ul><li>Language preference</li><li>Region preference</li><li>Theme preference</li><li>Saved UI settings</li></ul><p>These are not always required, but they improve the user experience.</p><h4>3. Analytics Cookies</h4><p>Analytics cookies help website owners understand how visitors use the site.</p><p><strong>Examples include:</strong></p><ul><li>Page views</li><li>Button clicks</li><li>Visitor behavior</li><li>Traffic sources</li></ul><p>Tools like Google Analytics often use this type of cookie.</p><h4>4. Marketing Cookies</h4><p>Marketing cookies are usually used for advertising and retargeting.</p><p><strong>Examples include:</strong></p><ul><li>Facebook Pixel</li><li>Google Ads tracking</li><li>Retargeting campaigns</li><li>Personalized ads</li></ul><p>These should only be enabled if the user gives permission.</p><h3>What I Wanted to Build</h3><p>The goal was to build a custom cookie consent popup that works like a professional website cookie banner.</p><p><strong>The system needed to have:</strong></p><ul><li>Accept All button</li><li>Reject All button</li><li>Cookie preference popup</li><li>Custom toggle switches</li><li>Save Preferences button</li><li>Browser cookie storage</li><li>localStorage backup</li><li>Professional consent data structure</li></ul><p>I also wanted the user’s choice to be remembered, so the cookie popup does not keep appearing every time the user refreshes the website.</p><h3>The User Flow</h3><p>The final behavior of the system is simple:</p><pre>Accept All<br>→ Enables functional, analytics, and marketing cookies<br>→ Saves the consent data<br>→ Closes the cookie popup<br><br>Reject All<br>→ Disables functional, analytics, and marketing cookies<br>→ Keeps necessary cookies enabled<br>→ Saves the consent data<br>→ Closes the cookie popup<br><br>Open Preferences<br>→ User can manually choose cookie categories<br><br>Reject All inside Preferences<br>→ Deselects all optional toggles<br><br>Save Preferences<br>→ Saves the selected toggle choices<br>→ Closes the cookie popup</pre><p>This gives the user proper control over their cookie choices.</p><h3>Getting Started to the workaround</h3><p>Prepare a basic cookies dessign on your own, if you’d like you can follow the below structure. I’m going to share the entire structure with you.</p><p><strong>Sample Design</strong></p><ul><li>Live Link: <a href="https://farhans-custom-cookies-concent.webflow.io/">https://farhans-custom-cookies-concent.webflow.io/</a></li><li>Sandbox Link: <a href="https://preview.webflow.com/preview/farhans-custom-cookies-concent?utm_medium=preview_link&amp;utm_source=designer&amp;utm_content=farhans-custom-cookies-concent&amp;preview=1f54394da62bd46478dd0e64ee07eb15&amp;workflow=preview">view_sandbox</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIoNfGwlQFIjOc1eQbC56A.png" /><figcaption>Cookie Main Wrapper</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SNozRMZaM4IBUMNjZlUPA.png" /><figcaption>Manage preferences</figcaption></figure><h3>Webflow Design View</h3><p>Prepare the first cookies wrapper based on the below structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zb1_bZy4X6J5uB56hy22_A.png" /><figcaption>Main Div Wrapper</figcaption></figure><p>Here is the css of main div wrapper:</p><pre>&lt;style&gt;<br>  .cookie-switch {<br>    position: relative;<br>    display: inline-flex;<br>    flex-shrink: 0;<br>    width: 38px;<br>    height: 22px;<br>    cursor: pointer;<br>  }<br><br>  .cookie-switch input {<br>    position: absolute;<br>    opacity: 0;<br>    width: 0;<br>    height: 0;<br>  }<br><br>  .cookie-slider {<br>    position: absolute;<br>    inset: 0;<br>    border-radius: 999px;<br>    background: #e7edf5;<br>    transition: background 0.25s ease;<br>    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);<br>  }<br><br>  .cookie-slider::before {<br>    content: &#39;&#39;;<br>    position: absolute;<br>    width: 16px;<br>    height: 16px;<br>    left: 3px;<br>    top: 3px;<br>    border-radius: 50%;<br>    background: #ffffff;<br>    transition: transform 0.25s ease;<br>    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);<br>  }<br><br>  .cookie-switch input:checked + .cookie-slider {<br>    background: #070b1d;<br>  }<br><br>  .cookie-switch input:checked + .cookie-slider::before {<br>    transform: translateX(16px);<br>  }<br><br>  .cookie-switch input:focus + .cookie-slider {<br>    box-shadow: 0 0 0 3px rgba(7, 11, 29, 0.12);<br>  }<br><br>  .cookie-switch input:disabled + .cookie-slider {<br>    background: #8d929d;<br>    cursor: not-allowed;<br>  }<br>&lt;/style&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8L9fVmOjma4Z49DHGWC8g.png" /><figcaption>Preferrence Div Wrapper</figcaption></figure><h3>Why I Used Custom Toggles</h3><p>Instead of using default checkboxes, I created custom toggle switches using HTML and CSS.</p><p>The toggle still works like a normal checkbox internally, but visually it looks like a modern on/off switch.</p><pre>&lt;!-- Always On --&gt;<br>&lt;!-- necessary-cookies --&gt;<br>&lt;label class=&quot;cookie-switch&quot;&gt;<br>  &lt;input type=&quot;checkbox&quot; checked disabled id=&quot;necessary-cookies&quot;&gt;<br>  &lt;span class=&quot;cookie-slider&quot;&gt;&lt;/span&gt;<br>&lt;/label&gt;<br><br>&lt;!-- functional-cookies --&gt;<br>&lt;label class=&quot;cookie-switch&quot;&gt;<br>  &lt;input type=&quot;checkbox&quot; id=&quot;functional-cookies&quot;&gt;<br>  &lt;span class=&quot;cookie-slider&quot;&gt;&lt;/span&gt;<br>&lt;/label&gt;<br><br>&lt;!-- analytics-cookies --&gt;<br>&lt;label class=&quot;cookie-switch&quot;&gt;<br>  &lt;input type=&quot;checkbox&quot; id=&quot;analytics-cookies&quot;&gt;<br>  &lt;span class=&quot;cookie-slider&quot;&gt;&lt;/span&gt;<br>&lt;/label&gt;<br><br>&lt;!-- marketing-cookies --&gt;<br>&lt;label class=&quot;cookie-switch&quot;&gt;<br>  &lt;input type=&quot;checkbox&quot; id=&quot;marketing-cookies&quot;&gt;<br>  &lt;span class=&quot;cookie-slider&quot;&gt;&lt;/span&gt;<br>&lt;/label&gt;</pre><p>The checkbox stores the actual checked/unchecked state, while the span element creates the visual switch design.</p><p>This is useful because it gives full styling control while still keeping the input accessible and functional.</p><h3>Main Cookies Concent Full JS Code</h3><pre>&lt;script&gt;<br>  document.addEventListener(&#39;DOMContentLoaded&#39;, function () {<br>    const CONSENT_VERSION = &#39;1.0&#39;;<br>    const DRAFT_STORAGE_KEY = &#39;cookieConsentDraft&#39;;<br>    const FINAL_STORAGE_KEY = &#39;cookieConsent&#39;;<br>    const COOKIE_NAME = &#39;cookie_consent&#39;;<br>    const COOKIE_EXPIRE_DAYS = 180;<br><br>    // Wrappers<br>    const mainWrapper = document.getElementById(&#39;cc.main&#39;);<br>    const preferenceWrapper = document.getElementById(&#39;cc.preference&#39;);<br><br>    // Main buttons<br>    const acceptBtn = document.getElementById(&#39;cc.accept-btn&#39;);<br>    const rejectBtn = document.getElementById(&#39;cc.reject-btn&#39;);<br><br>    // Preference buttons<br>    const prefRejectBtn = document.getElementById(&#39;cc.pref-reject-btn&#39;);<br>    const prefSaveBtn = document.getElementById(&#39;cc.pref-save.all-btn&#39;);<br><br>    // Preference checkboxes<br>    const functionalToggle = document.getElementById(&#39;functional-cookies&#39;);<br>    const analyticsToggle = document.getElementById(&#39;analytics-cookies&#39;);<br>    const marketingToggle = document.getElementById(&#39;marketing-cookies&#39;);<br><br>    function getExpiryDate(days) {<br>      return new Date(Date.now() + days * 24 * 60 * 60 * 1000);<br>    }<br><br>    function createConsentId() {<br>      const timestamp = new Date()<br>        .toISOString()<br>        .replace(/[-:.TZ]/g, &#39;&#39;)<br>        .slice(0, 14);<br><br>      const random = Math.random().toString(36).substring(2, 8);<br><br>      return &#39;cc_&#39; + timestamp + &#39;_&#39; + random;<br>    }<br><br>    function buildConsentData(status, method, categories) {<br>      const savedAt = new Date();<br>      const expiresAt = getExpiryDate(COOKIE_EXPIRE_DAYS);<br><br>      return {<br>        version: CONSENT_VERSION,<br>        consentId: createConsentId(),<br>        status: status,<br>        method: method,<br>        categories: {<br>          necessary: true,<br>          functional: Boolean(categories.functional),<br>          analytics: Boolean(categories.analytics),<br>          marketing: Boolean(categories.marketing),<br>        },<br>        savedAt: savedAt.toISOString(),<br>        expiresAt: expiresAt.toISOString(),<br>      };<br>    }<br><br>    function buildConsentFromCheckboxes(status, method) {<br>      return buildConsentData(status, method, {<br>        functional: functionalToggle ? functionalToggle.checked : false,<br>        analytics: analyticsToggle ? analyticsToggle.checked : false,<br>        marketing: marketingToggle ? marketingToggle.checked : false,<br>      });<br>    }<br><br>    function setCookie(name, value, days) {<br>      const expires = getExpiryDate(days).toUTCString();<br>      const secureAttribute = location.protocol === &#39;https:&#39; ? &#39;; Secure&#39; : &#39;&#39;;<br><br>      document.cookie = name + &#39;=&#39; + encodeURIComponent(JSON.stringify(value)) + &#39;; expires=&#39; + expires + &#39;; path=/; SameSite=Lax&#39; + secureAttribute;<br>    }<br><br>    function getCookie(name) {<br>      const cookies = document.cookie ? document.cookie.split(&#39;; &#39;) : [];<br><br>      for (let i = 0; i &lt; cookies.length; i++) {<br>        const cookie = cookies[i];<br>        const separatorIndex = cookie.indexOf(&#39;=&#39;);<br><br>        const cookieName = cookie.substring(0, separatorIndex);<br>        const cookieValue = cookie.substring(separatorIndex + 1);<br><br>        if (cookieName === name) {<br>          try {<br>            return JSON.parse(decodeURIComponent(cookieValue));<br>          } catch (error) {<br>            console.warn(&#39;Invalid cookie consent data&#39;);<br>            return null;<br>          }<br>        }<br>      }<br><br>      return null;<br>    }<br><br>    function saveDraftPreferences() {<br>      const draftConsent = buildConsentFromCheckboxes(&#39;draft&#39;, &#39;save_preferences&#39;);<br><br>      localStorage.setItem(DRAFT_STORAGE_KEY, JSON.stringify(draftConsent));<br><br>      console.log(&#39;Draft cookie preferences saved:&#39;, draftConsent);<br><br>      return draftConsent;<br>    }<br><br>    function saveFinalPreferences(status, method, categories) {<br>      const finalConsent = buildConsentData(status, method, categories);<br><br>      localStorage.setItem(FINAL_STORAGE_KEY, JSON.stringify(finalConsent));<br>      setCookie(COOKIE_NAME, finalConsent, COOKIE_EXPIRE_DAYS);<br><br>      updateCheckboxes(finalConsent);<br>      applyCookiePreferences(finalConsent);<br><br>      console.log(&#39;Final cookie consent saved:&#39;, finalConsent);<br><br>      return finalConsent;<br>    }<br><br>    function getDraftPreferences() {<br>      const draftData = localStorage.getItem(DRAFT_STORAGE_KEY);<br><br>      if (draftData) {<br>        try {<br>          return JSON.parse(draftData);<br>        } catch (error) {<br>          console.warn(&#39;Invalid draft cookie consent data&#39;);<br>          return null;<br>        }<br>      }<br><br>      return null;<br>    }<br><br>    function getFinalPreferences() {<br>      const localData = localStorage.getItem(FINAL_STORAGE_KEY);<br><br>      if (localData) {<br>        try {<br>          return JSON.parse(localData);<br>        } catch (error) {<br>          console.warn(&#39;Invalid final cookie consent data&#39;);<br>        }<br>      }<br><br>      return getCookie(COOKIE_NAME);<br>    }<br><br>    function updateCheckboxes(consentData) {<br>      if (!consentData || !consentData.categories) return;<br><br>      if (functionalToggle) {<br>        functionalToggle.checked = Boolean(consentData.categories.functional);<br>      }<br><br>      if (analyticsToggle) {<br>        analyticsToggle.checked = Boolean(consentData.categories.analytics);<br>      }<br><br>      if (marketingToggle) {<br>        marketingToggle.checked = Boolean(consentData.categories.marketing);<br>      }<br>    }<br><br>    function deselectAllPreferenceCheckboxes() {<br>      if (functionalToggle) functionalToggle.checked = false;<br>      if (analyticsToggle) analyticsToggle.checked = false;<br>      if (marketingToggle) marketingToggle.checked = false;<br>    }<br><br>    function showElement(element) {<br>      if (element) {<br>        element.style.display = &#39;&#39;;<br>      }<br>    }<br><br>    function hideElement(element) {<br>      if (element) {<br>        element.style.display = &#39;none&#39;;<br>      }<br>    }<br><br>    function closeCookiePopups() {<br>      hideElement(mainWrapper);<br>      hideElement(preferenceWrapper);<br>    }<br><br>    function applyCookiePreferences(consentData) {<br>      if (!consentData || !consentData.categories) return;<br><br>      const categories = consentData.categories;<br><br>      /*<br>      Add tracking scripts here later.<br><br>      Example:<br>      if (categories.analytics) {<br>        loadGoogleAnalytics();<br>      }<br><br>      if (categories.marketing) {<br>        loadMetaPixel();<br>      }<br>    */<br><br>      if (categories.functional) {<br>        console.log(&#39;Functional cookies allowed&#39;);<br>      }<br><br>      if (categories.analytics) {<br>        console.log(&#39;Analytics cookies allowed&#39;);<br>      }<br><br>      if (categories.marketing) {<br>        console.log(&#39;Marketing cookies allowed&#39;);<br>      }<br>    }<br><br>    // Page load behavior<br>    const finalPreferences = getFinalPreferences();<br><br>    if (finalPreferences) {<br>      updateCheckboxes(finalPreferences);<br>      applyCookiePreferences(finalPreferences);<br>      closeCookiePopups();<br>    } else {<br>      const draftPreferences = getDraftPreferences();<br><br>      if (draftPreferences) {<br>        updateCheckboxes(draftPreferences);<br>      }<br><br>      showElement(mainWrapper);<br>      hideElement(preferenceWrapper);<br>    }<br><br>    // Accept All: save final consent to localStorage + cookie, then close<br>    if (acceptBtn) {<br>      acceptBtn.addEventListener(&#39;click&#39;, function () {<br>        saveFinalPreferences(&#39;accepted&#39;, &#39;accept_all&#39;, {<br>          functional: true,<br>          analytics: true,<br>          marketing: true,<br>        });<br><br>        closeCookiePopups();<br>      });<br>    }<br><br>    // Reject All from main popup: save final consent to localStorage + cookie, then close<br>    if (rejectBtn) {<br>      rejectBtn.addEventListener(&#39;click&#39;, function () {<br>        saveFinalPreferences(&#39;rejected&#39;, &#39;reject_all&#39;, {<br>          functional: false,<br>          analytics: false,<br>          marketing: false,<br>        });<br><br>        closeCookiePopups();<br>      });<br>    }<br><br>    // Reject All inside preference popup: only deselect checkboxes, do not save cookie, do not close<br>    if (prefRejectBtn) {<br>      prefRejectBtn.addEventListener(&#39;click&#39;, function () {<br>        deselectAllPreferenceCheckboxes();<br>      });<br>    }<br><br>    // Save Preferences: save selected toggles to localStorage + cookie, then close popup<br>    if (prefSaveBtn) {<br>      prefSaveBtn.addEventListener(&#39;click&#39;, function () {<br>        saveFinalPreferences(&#39;custom&#39;, &#39;save_preferences&#39;, {<br>          functional: functionalToggle ? functionalToggle.checked : false,<br>          analytics: analyticsToggle ? analyticsToggle.checked : false,<br>          marketing: marketingToggle ? marketingToggle.checked : false,<br>        });<br><br>        closeCookiePopups();<br>      });<br>    }<br><br>    // Helper functions for testing in browser console<br>    window.getCookieConsent = function () {<br>      return getFinalPreferences();<br>    };<br><br>    window.getCookieConsentDraft = function () {<br>      return getDraftPreferences();<br>    };<br><br>    window.resetCookieConsent = function () {<br>      localStorage.removeItem(DRAFT_STORAGE_KEY);<br>      localStorage.removeItem(FINAL_STORAGE_KEY);<br><br>      document.cookie = COOKIE_NAME + &#39;=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;&#39;;<br><br>      location.reload();<br>    };<br>  });<br>&lt;/script&gt;</pre><h3>Saving Cookie Consent Data</h3><p>When a user makes a final choice, the system saves the consent data in two places:</p><pre>localStorage<br>Browser cookie</pre><h3>Why localStorage?</h3><p>localStorage is useful because it is easy to read and update with JavaScript.</p><p>Example:</p><pre>localStorage.setItem(&quot;cookieConsent&quot;, JSON.stringify(consentData));</pre><h3>Why browser cookies?</h3><p>Cookies are more traditional for saving cookie consent because they are part of the browser’s cookie system. They can also have expiry dates and path settings.</p><pre>document.cookie =<br>  &quot;cookie_consent=&quot; +<br>  encodeURIComponent(JSON.stringify(consentData)) +<br>  &quot;; expires=&quot; + expires +<br>  &quot;; path=/; SameSite=Lax&quot;;</pre><p>Using both localStorage and cookies makes the system more flexible.</p><h3>Showing or Hiding the Cookie Popup</h3><p>When the page loads, the script checks if cookie consent already exists.</p><p>If consent exists, the popup stays hidden.</p><p>If no consent exists, the popup appears.</p><p>Basic logic:</p><pre>const savedConsent = getFinalPreferences();<br><br>if (savedConsent) {<br>  closeCookiePopups();<br>} else {<br>  showElement(mainWrapper);<br>}</pre><p>This prevents the popup from showing again after the user has already made a choice.</p><h3>Applying Cookie Preferences</h3><p>The system also includes a function called applyCookiePreferences().</p><p>This function checks the saved cookie categories and can be used later to load scripts conditionally.</p><p>Example:</p><pre>function applyCookiePreferences(consentData) {<br>  const categories = consentData.categories;<br><br>  if (categories.analytics) {<br>    // Load Google Analytics here<br>  }<br><br>  if (categories.marketing) {<br>    // Load Meta Pixel here<br>  }<br><br>  if (categories.functional) {<br>    // Load functional scripts here<br>  }<br>}</pre><p>This is one of the most important parts of a real cookie consent system.</p><p>A cookie banner should not only save the user’s choice. It should also respect that choice by loading or blocking scripts based on permission.</p><h3>Testing the Cookie Consent System</h3><p>I added two helper functions for testing in the browser console.</p><p>To check saved consent:</p><pre>getCookieConsent()</pre><p>To reset consent and test again:</p><pre>resetCookieConsent()</pre><p>This makes development much easier because I can reset the cookie banner without manually clearing browser storage every time.</p><h3>What I Learned</h3><p>While building this system, I learned that cookie consent is not just about showing a banner.</p><p>A proper cookie system needs to handle:</p><pre>User choice<br>Consent categories<br>Data storage<br>Expiry date<br>Popup visibility<br>Custom preferences<br>Script loading behavior<br>Testing and resetting</pre><p>I also learned the difference between saving data in localStorage and saving data as a browser cookie.</p><p>Most importantly, I understood that a professional cookie system should be structured, readable, and future-friendly.</p><h3>Important Note</h3><p>This project is a technical implementation of a cookie preference system. Cookie laws can vary depending on country or region, such as GDPR in Europe or other privacy regulations in different places.</p><p>So, if this is used on a real production website, it is important to review the cookie policy and legal requirements properly.</p><h3>Final Thoughts</h3><p>Building this cookie consent system helped me understand how websites remember user choices and how cookie preferences can be handled with JavaScript.</p><p>Instead of depending completely on a plugin, I created a custom solution that works with Webflow and gives more control over the design, behavior, and saved data structure.</p><p>For beginner developers, building a cookie consent system is a great practical project because it teaches how user interaction, data storage, and website behavior work together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a494d085c774" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Cycle of True Learning: From Research to Experience]]></title>
            <link>https://medium.com/@rkfarhansadik/the-cycle-of-true-learning-from-research-to-experience-2bfc04d63772?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bfc04d63772</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Wed, 17 Jun 2026 17:33:46 GMT</pubDate>
            <atom:updated>2026-06-17T17:33:46.670Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NKEIIjnltpCW8t5H" /><figcaption>Photo by <a href="https://unsplash.com/@windows?utm_source=medium&amp;utm_medium=referral">Windows</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>You want to learn something new. So you open YouTube. You type in your topic. And within seconds, you’re watching a polished, well-edited video from someone who claims to have all the answers. It feels productive. It feels like learning.</p><blockquote>But here’s the problem: You’re not learning. You’re consuming.</blockquote><p>What you’re watching is someone else’s interpretation filtered, simplified, and packaged for mass consumption. You’re seeing the destination, not the journey. The struggles, the dead ends, the late nights of confusion, all edited out.</p><p>And worse, you’re being biased from the original source. You’re not learning from the creator. You’re learning from someone who learned from someone who learned from someone. The signal gets weaker with every retelling.</p><p>If you truly want to master a skill, technology, or subject, you need a different approach, one that focuses on research, experimentation, and experience.</p><h3>Start With Curiosity</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k14vM5qGy_iSziP_" /><figcaption>Photo by <a href="https://unsplash.com/@slidebean?utm_source=medium&amp;utm_medium=referral">Slidebean</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Learn something because you genuinely want to understand it, not just because someone told you it’s valuable. Real learning happens when curiosity and passion drive the process.</p><p>Before diving in, create a learning roadmap or syllabus that takes you from the fundamentals to more advanced concepts. This structure gives you a clear path to follow and helps you measure your progress.</p><p>When curiosity provides the motivation and structure provides the direction, learning becomes far more effective and the knowledge stays with you for life.</p><h3>Step 1: Research — Go to the Source</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BYBuHC3QlJZAaZQT" /><figcaption>Photo by <a href="https://unsplash.com/@ourlifeinpixels?utm_source=medium&amp;utm_medium=referral">Our Life in Pixels</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Skip the YouTube tutorials. Skip the “explained in 5 minutes” videos. Whenever you want to learn something, begin by researching the fundamentals.</p><p>Don’t jump directly into tutorials or shortcuts. Instead, start with the original documentation, official resources and reliable written materials. Learn the basics of the basics. Understand the core concepts, terminology, and principles that make the subject work.</p><p>Read extensively. Compare different perspectives. Explore articles, discussions, and documentation. The goal is not just to know what to do, but to understand why things work the way they do. Strong foundations create strong learners.</p><p><strong>Why?</strong></p><ul><li>Documentation is accurate and unopinionated</li><li>It covers the “boring” fundamentals that videos skip</li><li>It forces you to think, not just follow along</li></ul><h3>Step 2: Experiment — Get Your Hands Dirty</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SuPkNHqR-qNO5YH0" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Knowledge without application is fragile.</blockquote><p>After learning the fundamentals, start building things. Create small projects. Test ideas. Break things intentionally. Take notes about what works and what doesn’t.</p><blockquote>This is where real learning begins.</blockquote><p>Many people stay in “research mode” forever because it feels safe. But true understanding comes when theory meets reality. When you start experimenting, you’ll quickly discover that things don’t always work as expected.</p><blockquote>And that’s a good thing.</blockquote><p><strong>What to do:</strong></p><ul><li>Start a small project based on what you’ve learned</li><li>Don’t follow a tutorial, build from scratch</li><li>Make decisions on your own</li><li>Accept that you’ll make mistakes</li><li>Expect to fail. That’s the point.</li></ul><h3>Step 3: Fail — The Uncomfortable Truth</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kb9csojjaRJv8Go9" /><figcaption>Photo by <a href="https://unsplash.com/@wadewinslow129?utm_source=medium&amp;utm_medium=referral">Wade Winslow</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As you experiment, you’ll encounter bugs, mistakes, unexpected results, and challenges. Most beginners see these problems as obstacles. In reality, they are opportunities.</p><p>Every issue reveals a gap in your knowledge. Every failure points to something you need to understand better. Every mistake teaches a lesson that no tutorial can provide.</p><p>The problems you face become your best teachers.</p><p><strong>When you experiment, you’ll discover:</strong></p><ul><li>Things that work differently than expected</li><li>Edge cases you didn’t anticipate</li><li>Gaps in your understanding</li><li>Better ways to do things</li></ul><h3>Step 4: Learn — The Cycle Continues</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tN4z22lEy3fk3Boj25B4iw.png" /><figcaption>Loop by <a href="https://pixabay.com/vectors/infinity-infinite-ecg-forever-6991786/">Pixabay</a></figcaption></figure><blockquote>Once you discover what you don’t know, go back to research.</blockquote><p>Look for answers to the specific problems you’ve encountered. Read more documentation and advanced topics, explore new ideas, and focus on understanding the <strong>“why” behind the “how.”</strong> Don’t just learn what works, learn why it works.</p><blockquote>Learn from your mistakes.</blockquote><p>Now your research becomes far more effective because it is guided by real-world experience rather than curiosity alone.</p><blockquote>Then experiment again</blockquote><p>Build something more complex. Fix the mistakes from before. Try new approaches.</p><h3>The Byproduct: Experience</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tmloQAgKfzW0E4O-" /><figcaption>Photo by <a href="https://unsplash.com/@neom?utm_source=medium&amp;utm_medium=referral">NEOM</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Experience cannot be downloaded, copied, or taught directly. It is the natural result of repeatedly researching, experimenting, solving problems, and improving your understanding.</p><p>Many people want experience without going through the process that creates it. But experience is not a destination — it’s the byproduct of consistent learning and practical application.</p><blockquote>It’s important to understand what experience really is.</blockquote><p><strong>Experience is not:</strong></p><ul><li>Years spent in a job</li><li>Hours watched on YouTube</li><li>Certificates earned</li></ul><p>Those things may contribute to learning, but they don’t automatically create experience.</p><p><strong>Experience is:</strong></p><ul><li>The accumulated knowledge gained from failures and mistakes</li><li>The instinct you develop for what is likely to work</li><li>The confidence to solve problems you’ve never encountered before</li><li>The understanding that comes from recognizing patterns across multiple learning cycles</li></ul><p>Every time you research, experiment, fail, learn, and try again, you add another layer to your experience. Over time, these layers compound into something valuable that can’t be found in a course, a tutorial, or a certificate.</p><p>Eventually, you stop following instructions and start creating your own solutions. You begin making better decisions, solving problems faster, and understanding concepts more deeply.</p><p>That is when true mastery begins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TuMqRV_9Tj7jLO0KSvpvtA.png" /></figure><h3>Why This Framework Works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*719FkY8NZxE7IxpP" /><figcaption>Photo by <a href="https://unsplash.com/@fossy?utm_source=medium&amp;utm_medium=referral">Fab Lentz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>This framework works because it’s how real expertise is built.</blockquote><p>Many people spend their time watching videos, reading articles, and following tutorials. They learn <em>what to do</em>, but often don’t understand <em>why</em> they’re doing it. As soon as they face a problem that wasn’t covered in the tutorial, they get stuck.</p><blockquote>This framework combines learning with doing.</blockquote><p>Research gives you knowledge. Experimentation tests that knowledge. Problems reveal what you still need to learn. Then you research again and improve. With each cycle, you gain more understanding, confidence, and experience. Over time, you stop copying solutions and start creating your own. You learn how to think, not just what to do.</p><p><strong>In the end:</strong></p><ul><li>Knowledge shows you what’s possible.</li><li>Experimentation shows you what works.</li><li>Experience teaches you why.</li></ul><h3>One Final Thought</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p_oXs9IyhVyBv3D7" /><figcaption>Photo by <a href="https://unsplash.com/@edge2edgemedia?utm_source=medium&amp;utm_medium=referral">Edge2Edge Media</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The reason YouTube feels productive is that it gives you the illusion of learning. You feel smart watching someone else solve problems. You feel informed.</p><p>But experience doesn’t come from watching someone else’s journey. Experience comes from your own. So close the YouTube tab. Open the documentation. Build something that breaks. And then build it again.</p><p>That’s how experts are made.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bfc04d63772" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to Building Your Own Linux Server]]></title>
            <link>https://medium.com/@rkfarhansadik/create-your-own-linux-server-b5f84e01ec60?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5f84e01ec60</guid>
            <category><![CDATA[home-server]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[servers]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 08:41:49 GMT</pubDate>
            <atom:updated>2025-12-27T16:59:15.720Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are new to Linux, setting up a Linux server is a great way to learn more about Linux and server management. Whether you want to host services, run apps or build a homelab, a Linux server offers unmatched flexibility, performance, and control.</p><p>This beginner friendly guide will walk you through the essentials of setting up an efficient, stable, and secure Linux server giving you the foundation you need to explore more advanced configurations and tools with confidence.</p><h3>Why Build a Linux Server?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qOEcbM5bsPr_d7iq" /><figcaption>Photo by <a href="https://unsplash.com/@superadmins?utm_source=medium&amp;utm_medium=referral">Sammyayot254</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Unlike preconfigured hosting solutions, building and managing your own Linux server gives you full visibility into the technologies that power modern applications and services. It allows you to work directly with the operating system, networking, security, and services, making it an excellent choice for learning and for establishing a strong foundation for future Linux-based projects.</p><p><strong>By building your own Linux server, you can:</strong></p><ul><li>Gain hands-on experience with Linux system administration</li><li>Understand how servers, networking, and services work at a low level</li><li>Customize the environment to fit your exact requirements</li><li>Improve security through direct control over users, permissions, and firewalls</li><li>Host your own applications, websites, and APIs</li><li>Build and manage personal or professional homelabs</li><li>Prepare for advanced infrastructure topics such as virtualization, containers, and automation</li></ul><p>Whether your goal is to run a homelab, host your own website, experiment with advanced IT concepts, or develop practical system administration skills, a Linux server is a flexible tool that evolves with you as your knowledge and experience grow.</p><h3>Choosing the Right Linux Distribution</h3><p>Selecting the right Linux distribution is one of the most important steps when setting up your server. The distro you choose will determine the tools available to you, the kind of support you can expect, and the overall management experience you’ll have as you maintain your system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BiWGSLX1H-HzmznI" /><figcaption>Photo by <a href="https://unsplash.com/@davidschultz?utm_source=medium&amp;utm_medium=referral">David Schultz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here are some of the most popular and reliable options:</p><ul><li><strong>Ubuntu Server: </strong>Popular, beginner-friendly, and backed by a large community. It’s one of the best starting points if you’re new to Linux servers.</li><li><strong>Debian</strong>: Known for its stability and massive software repository, Debian is ideal if you want a dependable, long-term server environment.</li><li><strong>openSUSE</strong> : Equipped with powerful tools like <strong>YaST</strong>, openSUSE provides a flexible and user-friendly way to manage server configurations.</li><li><strong>Fedora Server</strong> : Built on cutting-edge technologies and closely aligned with Red Hat Enterprise Linux (RHEL), Fedora is perfect for users who enjoy staying up-to-date with the latest advancements.</li><li><strong>AlmaLinux</strong>/<strong>Rocky Linux: </strong>Both are community-driven, enterprise-grade alternatives compatible with RHEL — great options for businesses or production servers.</li></ul><p>Each Linux distribution has its unique strengths, so it’s worth considering your goals, technical comfort level, and project requirements before deciding.</p><blockquote>In this tutorial, <strong>Rocky Linux</strong> will be used as the server operating system, while <strong>Fedora</strong> will serve as the primary host system for setup and management.</blockquote><h3>Choosing Hardware or Virtual Machine (VM)</h3><p>Selecting the appropriate environment for your Linux server, whether physical hardware or a virtual machine is a foundational decision that will shape how the server is deployed, managed, and scaled. Before moving forward, it’s important to determine where your server will live.</p><p>The key consideration is whether you plan to <strong>host the server yourself</strong> (on local hardware or a homelab) or <strong>deploy it through a cloud provider</strong>. Each approach comes with different trade offs in terms of cost, control, maintenance, and flexibility, and your choice should align with your goals, experience level, and long-term plans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XlmKr_tLlOfQ41a0" /><figcaption>Photo by <a href="https://unsplash.com/@nathananderson?utm_source=medium&amp;utm_medium=referral">Nathan Anderson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Hardware</h4><p>When running a server in a self-hosted environment or homelab, you do not need high-end hardware to begin. Repurposed or older systems can handle many learning and development workloads efficiently while keeping costs low. In contrast, production environments and compute-intensive applications benefit significantly from cloud platforms, where scalability, reliability, and performance are built in.</p><p>From a compute standpoint, modern consumer CPUs such as Intel Core i5/i7 or AMD Ryzen 5/7 offer more than enough performance for personal servers and testing environments.</p><p>Memory capacity plays a critical role in overall system performance. Lightweight services can run comfortably on minimal RAM allocations, but workloads involving databases, virtualization, or container platforms require additional memory headroom. In most cases, allocating more RAM improves responsiveness and allows for future expansion.</p><p>Storage performance is equally important. Solid-state drives are strongly recommended due to their low latency and high throughput, particularly for data-heavy workloads.</p><p>Finally, networking should not be overlooked. A wired Ethernet connection provides consistent throughput and lower latency compared to wireless alternatives.</p><p>This balanced approach ensures your Linux server environment aligns with both current requirements and future growth.</p><h4>Virtual Machine</h4><p>Running your Linux server inside a virtual machine is a practical and flexible alternative to deploying it directly on physical hardware. In this case, the host system must have sufficient resources to support the VM without performance bottlenecks. Using a hypervisor such as Proxmox, VirtualBox, VMware, or KVM makes it straightforward to create, manage, and scale virtual servers. As with physical hardware, careful allocation of CPU cores, memory, and storage should be based on the expected workload.</p><p>Cloud platforms further simplify this approach by providing Linux virtual machines on reliable AMD- or Intel-based infrastructure. For users who prefer to avoid hardware management altogether, cloud VMs offer a cost-effective and low-maintenance solution with the added benefit of on-demand scalability.</p><p>One of the key advantages of virtual machines is snapshot capability. Snapshots allow you to capture the exact state of a system before making changes, which is especially valuable when testing configurations, applying updates, or experimenting with new services. If an issue occurs, the system can be quickly restored to a known working state, significantly reducing downtime and recovery effort.</p><p>By thoughtfully selecting between physical hardware, self-hosted virtualization, or cloud-based VMs, you can build a Linux server environment that aligns with your technical goals and operational needs. For those who prefer a faster setup with minimal configuration overhead, platforms such as StackLinux.com provide preconfigured and performance-optimized virtual machines, allowing you to focus on usage rather than infrastructure setup.</p><h3>Getting Started</h3><p>The first step in building your server is installing the Linux operating system. While the installation process is largely the same for physical machines and self-hosted virtual machines, this guide will focus on installing Linux on self-hosted hardware.</p><p><strong>Note:</strong> If you are deploying a Linux virtual machine from a cloud provider, these steps are typically unnecessary, as the operating system is provisioned automatically through the provider’s control panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tzMqrpQaULcoTNrX" /><figcaption>Photo by <a href="https://unsplash.com/@arianismmm?utm_source=medium&amp;utm_medium=referral">Arian Darvishi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4><strong>Download the ISO</strong></h4><p>Visit the official Rocky Linux website and download the <strong>Minimal ISO</strong> image.</p><p><a href="https://rockylinux.org/download">Download - Rocky Linux</a></p><h4><strong>Create Bootable Media</strong></h4><p>Create a bootable USB drive:</p><ul><li>Rufus (Windows)</li><li>BalenaEtcher (Windows, Linux, macOS)</li><li>Ventoy (Windows, Linux) for multi iso boot</li></ul><h4>Setup Virtual Machine</h4><p>KVM requires a CPU with virtualization extensions, found on most consumer CPUs. These extensions are called Intel VT or AMD-V. To check whether you have CPU support, run the following command:</p><pre>$ lscpu | grep &quot;Virtualization&quot;<br>## or<br>$ grep -E &#39;(vmx|svm)&#39;  /proc/cpuinfo</pre><p>If this command results in nothing printed, your system does not support the relevant virtualization extensions. You can still use QEMU/KVM, but the emulator will fall back to software virtualization, which is much slower.</p><p>For existing Fedora installations, you can install the virtualization tools via the command line using the Virtualization Package Group. To view the packages, run:</p><pre>$ dnf group info virtualization</pre><pre>Updating and loading repositories:<br>Repositories loaded.<br>Id                   : virtualization<br>Name                 : Virtualization<br>Description          : These packages provide a graphical virtualization environment.<br>Installed            : yes<br>Order                : <br>Langonly             : <br>Uservisible          : no<br>Repositories         : <a href="http://twitter.com/System">@System</a><br>Mandatory packages   : virt-install<br>Default packages     : libvirt-daemon-config-network<br>                     : libvirt-daemon-kvm<br>                     : qemu-kvm<br>                     : virt-manager<br>                     : virt-viewer<br>Optional packages    : guestfs-tools<br>                     : python3-libguestfs<br>                     : virt-top</pre><ol><li>Run the following command to install the mandatory and default packages in the virtualization group:</li></ol><pre>$ sudo dnf install @virtualization</pre><p>To start the service on boot, run:</p><pre>$ sudo systemctl enable --now libvirtd</pre><p>To verify that the KVM kernel modules are properly loaded:</p><pre>$ lsmod | grep kvm<br>kvm_amd               114688  0<br>kvm                   831488  1 kvm_amd</pre><p>If this command lists kvm_intel or kvm_amd, KVM is properly configured.</p><p>For dabian and ubuntu based distribution, please follow the instruction below:</p><p><a href="https://phoenixnap.com/kb/ubuntu-install-kvm">How to Install KVM on Ubuntu</a></p><h3>Rocky Linux Installation</h3><p>Boot into your system using usb stick, on virtual machine enter the below command to get into GUI mode:</p><pre>$ virt-manager</pre><p>Create a new virtual machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*Nw37aGse2qjGBcxZ3C4plQ.png" /><figcaption>Image 1</figcaption></figure><p>Select the system image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*uQTgNMltgy1loP4tuFNUcQ.png" /><figcaption>Image 2</figcaption></figure><p>Enter the size of vitual RAM and CPU:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*ltBcUKZcCyJtlUA0Nh4pIA.png" /><figcaption>Image 3</figcaption></figure><p>Create disk space for virtual machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*XXnW9kceg9UTNkIaih6Djg.png" /><figcaption>Image 4</figcaption></figure><p>Finilize the vm settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*E-d2GjE3dk7K9ixrCwhBHQ.png" /><figcaption>Image 5</figcaption></figure><p>After finilize, click on the finish button to start the virtual machine. If you take closer look at the image 5. I’ve setup the bridge device.</p><p>Select the boot menu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJ48swK_V3Px0mgGT-dA6Q.png" /><figcaption>Image 6</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oaf-4-T0N7IU9MXN90drdQ.png" /><figcaption>Image 7</figcaption></figure><p>Select the language:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3u_-g2B4e6uPDm6S_yECGg.png" /><figcaption>Image 8</figcaption></figure><p>Here is the installation summery:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*foUobvQI9-QU1lRRKKvkDQ.png" /><figcaption>Image 9</figcaption></figure><p>Setup Network and host name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Zl9RIMU8JPCLpKVKpTH7g.png" /><figcaption>Image 10</figcaption></figure><p>Disk Partitioning: Either you can go with manual disk partitioning or the automatic configuration. I’ve selected the automatic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owxLmkMciLTjuDQffdQDpQ.png" /><figcaption>Image 11</figcaption></figure><p>Enter password for root account:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0l9FDXxEdogL5QFglQe7FQ.png" /><figcaption>Image 12</figcaption></figure><p>Create a new user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hR5gDqEyM_79mLa4N_GgNg.png" /><figcaption>Image 13</figcaption></figure><p>Select the installation method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GEcEU9fXcs5twKODMiJwEA.png" /><figcaption>Image 14</figcaption></figure><p>Finilize the installation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkQwjKX4XSzLDztORcYOeg.png" /><figcaption>Image 15</figcaption></figure><p>After the hit the <strong>Begin Installation</strong> button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wcroaqLqrDvJlb2BFrSpdQ.png" /><figcaption>Image 16</figcaption></figure><p>Hit the reboot system after finishing the installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6eczusopeWU11mwX3fHAA.png" /><figcaption>Image 17</figcaption></figure><p>System is ready to operate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U77r3TomnVy51AQmCgs3JA.png" /><figcaption>Image 18</figcaption></figure><p>Log in to system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYfQL-A6OLUytBGGvoH3BQ.png" /><figcaption>Image 19</figcaption></figure><h3>Setup SSH for the server</h3><pre>$ sudo dnf install -y openssh-server<br>$ sudo systemctl enable --now sshd</pre><p>After that connect your pc with the server.</p><pre>// Format <br>$ ssh username@ip_address<br><br>// NOTE <br>// to find the system ip address, please enter the ip command. <br><br>[farhan@rocky ~]$ ip a <br><br>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000<br>    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br>    inet 127.0.0.1/8 scope host lo<br>       valid_lft forever preferred_lft forever<br>    inet6 ::1/128 scope host noprefixroute <br>       valid_lft forever preferred_lft forever<br>2: enp1s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000<br>    link/ether 52:54:00:3d:79:36 brd ff:ff:ff:ff:ff:ff<br>    altname enx5254003d7936<br>    inet 192.168.122.30/24 brd 192.168.122.255 scope global dynamic noprefixroute enp1s0<br>       valid_lft 3416sec preferred_lft 3416sec<br>    inet6 fe80::5054:ff:fe3d:7936/64 scope link noprefixroute <br>       valid_lft forever preferred_lft forever</pre><p>Here 192.168.122.30 is our servers ip address. Now log in to the server using another system.</p><pre>➜  ~ ssh farhan@192.168.122.30<br><br>The authenticity of host &#39;192.168.122.30 (192.168.122.30)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:KWnUQcCimyN0MXPIje1hpTvAUoBLWAA8cjngVTYXaVI.<br>This key is not known by any other names.<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;192.168.122.30&#39; (ED25519) to the list of known hosts.<br>farhan@192.168.122.30&#39;s password: <br>Last login: Sat Dec 27 17:17:18 2025<br>[farhan@rocky ~]$</pre><p>After that update full system and install necessery packages.</p><pre>$ sudo dnf update -y </pre><h3>Setup web console</h3><p>We’ve prepared our server machine, although we can controll everything using SSH. But we also can setup an web console application. We can manage our system from web browser.</p><p>Install cockpit:</p><pre>$ sudo dnf install cockpit</pre><p>Enable cockpit:</p><pre>$ sudo systemctl enable --now cockpit.socket</pre><p>Open the firewall if necessary:</p><pre>$ sudo firewall-cmd --add-service=cockpit<br>$ sudo firewall-cmd --add-service=cockpit --permanent<br>$ sudo firewall-cmd --reload</pre><p>Cockpit is installed, now point your web browser to: <a href="https://_ip-address-of-machine_:9090/">https://ip-address-of-machine:9090</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_oOoPR-kPiKnnIwC1P8og.png" /></figure><p>After that we can install some of add-ons for our web console.</p><pre>$ sudo dnf install cockpit-*</pre><p>Reload the web console and then you’ll be able to access all of those add-ons.</p><p>With the operating system installed, SSH configured, and the web console set up, your server is now fully operational and ready for any purpose. You can deploy web applications, set up file servers, create media services, run databases, or experiment with containerized environments, the server is a flexible foundation for whatever projects you choose.</p><h3>System Services</h3><p>A Linux server serves as a versatile platform for experimentation, learning, and production workloads. <strong>System services</strong> are background programs that provide essential functionality to your server. Examples include:</p><ul><li><strong>Web servers:</strong> Apache, Nginx</li><li><strong>Databases:</strong> MySQL, PostgreSQL, MongoDB</li><li><strong>File-sharing systems:</strong> Samba, Nextcloud</li><li><strong>Scripting platforms:</strong> PHP, Python</li><li><strong>Containerization platforms:</strong> Docker, Podman</li><li><strong>Mail servers:</strong> Postfix, Exim</li></ul><p>Properly configuring and managing these services is crucial for ensuring that your server runs efficiently, remains stable, and maintains a high level of security.</p><blockquote>Let’s create a web server.</blockquote><h3>Install Apache HTTP (for web hosting)</h3><p>The Apache HTTP Server httpd is a free and open-source cross-platform web server software developed and maintained by the<a href="https://www.apache.org/"> Apache Software Foundation</a></p><p>Install the httpd package.</p><pre>$ sudo dnf install httpd httpd-tools<br>$ sudo systemctl enable --now httpd.service</pre><p>Verify the installed Apache Server version.</p><pre>$ httpd -v<br>Server version: Apache/2.4.63 (Rocky Linux)<br>Server built:   Dec 10 2025 00:00:00</pre><p>Open the /etc/httpd/conf/httpd.conf configuration file and set your server name. Also, in the &lt;Directory “/var/www/html”&gt; directive, change AllowOverride to All.</p><pre>$ sudo vim /etc/httpd/conf/httpd.conf</pre><pre>&lt;Directory &quot;/var/www/html&quot;&gt;<br> …<br> AllowOverride All<br> …<br>&lt;/Directory&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*guPWc5G34tEVGQu19l4xTA.png" /></figure><p>Check the configuration to see if there are any errors.</p><pre>$ sudo apachectl configtest</pre><pre>Syntax OK</pre><h4>AH00558 Issue</h4><p>If you’ve face AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 192.168.122.69. Set the ‘ServerName’ directive globally to suppress this message error.</p><p>The error should look like this:</p><pre>[farhan@rocky ~]$ sudo apachectl configtest<br>AH00558: httpd: Could not reliably determine the server&#39;s fully qualified domain name, using 192.168.122.30. Set the &#39;ServerName&#39; directive globally to suppress this message<br>Syntax OK</pre><p>The message is mainly for informational purposes, and an AH00558 error will not prevent Apache from running correctly.</p><p><strong>Find the issue</strong></p><p>Ubuntu and Debian Systems</p><pre>sudo systemctl status apache2.service -l - no-pager</pre><p>Rocky and Red Hat Systems</p><pre>sudo systemctl status httpd.service -l - no-pager</pre><p>The -l flag will ensure that systemctl outputs the entire contents of a line, instead of substituting in ellipses (…) for long lines. The --no-pager flag will output the entire log to your screen without invoking a tool like less that only shows a screen of content at a time.</p><p>You should receive output that is similar to the following:</p><pre>Output● apache2.service - The Apache HTTP Server<br>   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)<br>  Drop-In: /lib/systemd/system/apache2.service.d<br>           └─apache2-systemd.conf<br>   Active: active (running) since Wed 2020-07-29 14:30:03 UTC; 33min ago<br>  Process: 34 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)<br> Main PID: 46 (apache2)<br>    Tasks: 55 (limit: 2344)<br>   CGroup: /system.slice/apache2.service<br>           ├─46 /usr/sbin/apache2 -k start<br>           ├─47 /usr/sbin/apache2 -k start<br>           └─48 /usr/sbin/apache2 -k start<br>Jul 29 14:30:03 68e2cf19f3f1 systemd[1]: Starting The Apache HTTP Server...<br>Jul 29 14:30:03 68e2cf19f3f1 apachectl[34]: AH00558: apache2: Could not reliably determine the server&#39;s fully qualified domain name, using 172.17.0.2. Set the &#39;ServerName&#39; directive globally to suppress this message<br>Jul 29 14:30:03 68e2cf19f3f1 systemd[1]: Started The Apache HTTP Server.</pre><p>The highlighted line that contains the AH00558 message is the important one. Essentially, it informs you that Apache couldn’t find a valid ServerName directive in its configuration file, so it will use the first IP address it detects. In this example, it’s the server’s public IP address: 172.17.02. If you are troubleshooting an AH00558 message, the IP address that is detected may be different, or it may be a human readable DNS name.</p><p><strong>Setting a Global </strong><strong>ServerName Directive</strong></p><p>The error message notes that a global ServerName directive should also be set. Doing so will ensure that Apache can gracefully handle incoming requests that do not map to a VirtualHost without generating additional errors.</p><p>For maximum compatibility with various Apache configurations, use the value of 127.0.0.1 for your global ServerName directive. You can use a different IP address or DNS name that corresponds to your server’s configuration if you need to, but it is safest to use 127.0.0.1.</p><p>On <strong>Ubuntu</strong> and <strong>Debian</strong>-derived systems, open the /etc/apache2/apache2.conf file with root privileges using vim or your preferred text editor:</p><pre>$ sudo vim /etc/apache2/apache2.conf</pre><p>Add a line containing ServerName 127.0.0.1 to the end of the file:</p><pre>. . .<br># Include the virtual host configurations:<br>IncludeOptional sites-enabled/*.conf<br><br># vim: syntax=apache ts=4 sw=4 sts=4 sr noet<br>ServerName 127.0.0.1</pre><p>On <strong>Rocky Linux</strong>, <strong>Fedora</strong>, and <strong>Red Hat</strong>-derived systems, open the /etc/httpd/conf/httpd.conf file with root privileges using vim or your preferred text editor:</p><pre>$ sudo vim /etc/httpd/conf/httpd.conf</pre><p>Add the ServerName 127.0.0.1 line to the end of the file:</p><pre>. . .<br># Supplemental configuration<br>#<br># Load config files in the &quot;/etc/httpd/conf.d&quot; directory, if any.<br>IncludeOptional conf.d/*.conf<br>ServerName 127.0.0.1</pre><p>Save and close the file when you are finished. If you used vim, do so by pressing CTRL + X, Y, and then ENTER.</p><p>Once you have added the ServerName directive to your configuration, run apachectl to test that the configuration is valid.</p><pre>$ sudo apachectl configtest</pre><p>A successful apachectl configtest invocation should result in output like this:</p><pre>Syntax OK</pre><p>You can now reload Apache’s configuration using the appropriate systemctl reload command for your Linux distribution.</p><p>On <strong>Ubuntu</strong> and <strong>Debian</strong>-derived systems, run the following:</p><pre>$ sudo systemctl reload apache2.service</pre><p>On <strong>Rocky Linux</strong>, <strong>Fedora</strong>, and <strong>Red Hat</strong>-derived systems use this command to reload Apache’s configuration:</p><pre>$ sudo systemctl reload httpd.service</pre><p>After you reload Apache, the AH00558 error message will no longer appear in your logs. You can confirm the messages are silenced by running any of the three systemctl, journalctl, or apachectl commands that are demonstrated in this tutorial.</p><h4>Firewall Setup</h4><p>Open TCP port 80 (HTTP) in the local firewall.</p><pre>$ sudo firewall-cmd --add-service=http --permanent<br>$ sudo firewall-cmd --reload<br><br>$ sudo firewall-cmd --list-services<br>dhcpv6-client http mdns samba-client ssh</pre><p>Enable and start the httpd service.</p><pre>$ sudo systemctl enable --now httpd</pre><p>Now, open a web browser and type http://your-server-ip or just localhost into the address bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nApEBeRXKkCd32Km42Wheg.png" /></figure><blockquote><em>Put your html codes on the </em><em>/var/www/html directory to live the site.</em></blockquote><p>Lets try with an sample design. Clone the repository first:</p><pre>$ git clone https://gitlab.com/web-design-farhansadik/web-layout-css.git</pre><p>Now copy and paste the files into /var/www/html directory.</p><pre>$ cd web-layout-css<br>$ sudo cp -rv * /var/www/html/</pre><p>Now visit http://your-server-ip again. And it should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gT8Bfon5nCzyjufRzgKPBA.png" /></figure><h3>Install MariaDB Database Server (for web hosting)</h3><p>Now that your Apache web server is operational with TLS encryption, you need to install the <a href="https://mariadb.org/">MariaDB</a> relational database management system to store your website data.</p><p>Now install the MariaDB database server.</p><pre>$ sudo dnf install mariadb-server</pre><p>Enable and start the mariadb service.</p><pre>$ sudo systemctl enable --now mariadb</pre><p>The installation of MariaDB is complete.</p><h4>Configure MariaDB</h4><p>By default, MariaDB is not secured. So you will need to secure it first. You can do it by running the mysql_secure_installation script:</p><pre>$ sudo mysql_secure_installation</pre><p>Answer all the questions as shown below:</p><pre>Set root password? [Y/n] Y<br>New password: <br>Remove anonymous users? [Y/n] Y<br>Disallow root login remotely? [Y/n] Y<br>Remove test database and access to it? [Y/n] Y<br>Reload privilege tables now? [Y/n] Y</pre><p>Once you have finished, you should see the following output:</p><pre>... Success!<br>Cleaning up...<br><br>All done!  If you&#39;ve completed all of the above steps, your MariaDB<br>installation should now be secure.<br><br>Thanks for using MariaDB!</pre><h3>Install phpMyAdmin (for web hosting)</h3><pre>$ sudo dnf install epel-release<br>$ sudo dnf install phpMyAdmin</pre><p>Reload apache servics</p><pre>$ sudo systemctl restart httpd</pre><p>Open your web browser and go to localhost/phpMyAdmin But it will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*gtUTwOUuqgBzR6_IkMpbHA.png" /></figure><blockquote><strong>Configuration files</strong><br>The main configuration file is /etc/phpMyAdmin/config.inc.php. A configuration file for the Apache web server, httpd, is automatically created /etc/httpd/conf.d/phpMyAdmin.conf</blockquote><h4>Configure phpMyAdmin</h4><p>By default, phpMYAdmin is accessible only from the local machine. To access the phpMyAdmin from the remote machine, you will need to edit the phpMYAdmin configuration file and make some changes.</p><pre>$ sudo vim /etc/httpd/conf.d/phpMyAdmin.conf</pre><p>Find the following line:</p><pre>Require local</pre><p>And replace it with the following line:</p><pre>Require all granted</pre><p>Save and close the file, then restart the Apache service to apply the changes.</p><pre>$ sudo systemctl restart httpd</pre><h4>Access phpMyAdmin</h4><p>Now, open your web browser and access the phpMyAdmin using the URL <a href="http://your-server-ip/phpmyadmin.">http://your-server-ip/phpmyadmin.</a> You should see the phpMyAdmin login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6WcbBSqtcEdH4VQb-hgsMA.png" /></figure><blockquote><em>BUT YOU CAN’T, BECAUSE YOU’VE TO CREATE USER ACCOUNT FOR DATABASE</em></blockquote><p><strong>Create user account for database</strong></p><pre>$ sudo mysql -u root<br><br>// Here first &#39;admin&#39; is the username and the second &#39;admin&#39; is the password<br>&gt; CREATE USER &#39;admin&#39;@localhost IDENTIFIED BY &#39;admin&#39;;<br>&gt; GRANT ALL PRIVILEGES ON *.* TO &#39;admin&#39;@localhost IDENTIFIED BY &#39;admin&#39;;</pre><p><em>Now We can access phpmyadmin by login with </em>admin<em> username and password.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhFxPnrrcO-tkv-YCEAGLA.png" /></figure><p>At this stage, your <strong>web server and web console are fully set up</strong>. In addition, you can now extend your server to perform other functions, such as:</p><ul><li><strong>Network Attached Storage (NAS)</strong> for centralized file storage and sharing</li><li><strong>Media Server</strong> for streaming audio and video across your network</li><li><strong>Additional services</strong> like backup servers, development environments, or personal cloud solutions</li></ul><p>This flexibility allows your Linux server to grow with your needs, whether for personal projects, learning, or production use.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5f84e01ec60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Shadcn UI with ReactJS with Vite]]></title>
            <link>https://medium.com/@rkfarhansadik/how-to-install-shadcn-ui-with-reactjs-with-vite-c564b9efae85?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/c564b9efae85</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[shadcn]]></category>
            <category><![CDATA[vitejs]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 21:32:55 GMT</pubDate>
            <atom:updated>2025-04-04T21:32:55.253Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pvyQDf_8FoUt61O-.png" /><figcaption>Source: <a href="https://ui.shadcn.com/">https://ui.shadcn.com/</a></figcaption></figure><h3>Setup an react with vite project</h3><p>Run the following command to create a new React Vite app:</p><pre>$ npm create vite@latest reactjs-shadcn-test - - template react<br>$ cd reactjs-shadcn-test<br>$ npm install</pre><p>Open the app in your browser, e.g., <a href="http://localhost:5174/">http://localhost:5174</a>. Ensure the default Vite app screen loads successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/0*ZRcLQiqfjkXoKjO3.png" /><figcaption>Source: <a href="https://mobisoftinfotech.com/">https://mobisoftinfotech.com</a></figcaption></figure><h3>Install and configure Tailwind</h3><p>Install tailwindcss and @tailwindcss/vite via npm.</p><pre>$ npm install tailwindcss @tailwindcss/vite</pre><p>Add the @tailwindcss/vite plugin to your Vite configuration.</p><pre>import { defineConfig } from &#39;vite&#39;<br>import react from &#39;@vitejs/plugin-react&#39;<br>import tailwindcss from &#39;@tailwindcss/vite&#39;<br><br>export default defineConfig({<br>	plugins: [react(), tailwindcss()],<br>})</pre><p>Add an @import to your CSS file that imports Tailwind CSS. Make sure you’ve removed previous CSS classes.</p><pre>@import &quot;tailwindcss&quot;;</pre><h3>Prepare Shadcn UI Configuration</h3><ol><li>Create jsconfig.json file into the root directory.</li><li>Copy and paste those lines into that file:</li></ol><pre>{<br> &quot;compilerOptions&quot;: {<br>  &quot;baseUrl&quot;: &quot;.&quot;,<br>  &quot;paths&quot;: {<br>   &quot;@/*&quot;: [&quot;./src/*&quot;]<br>  }<br> }<br>}</pre><p>3. Install Node.js types:</p><pre>$ npm install -D @types/node</pre><p>4. Add the following code to the vite.config.js so your app can resolve paths without error:</p><pre>import { defineConfig } from &#39;vite&#39;<br>import react from &#39;@vitejs/plugin-react&#39;<br>import tailwindcss from &#39;@tailwindcss/vite&#39;<br>import path from &quot;path&quot;<br>  <br>// https://vite.dev/config/<br>export default defineConfig({<br> plugins: [react(), tailwindcss()],<br> resolve: {<br>  alias: {<br>   &quot;@&quot;: path.resolve(&quot;./src&quot;),<br>  },<br> },<br>})</pre><h3>Shadcn UI Installation</h3><p>Run the shadcn UI init command to set up your project:</p><pre>$ npx shadcn@latest init</pre><p>Output for refference:</p><pre>$ npx shadcn@latest init<br>Need to install the following packages:<br>shadcn@2.4.0-canary.17<br>Ok to proceed? (y) y</pre><pre>✔ Preflight checks.<br>✔ Verifying framework. Found Vite.<br>✔ Validating Tailwind CSS config. Found v4.<br>✔ Validating import alias.<br>✔ Which color would you like to use as the base color? › Zinc<br>✔ Writing components.json.<br>✔ Checking registry.<br>✔ Updating src/index.css<br>  Installing dependencies.</pre><pre>It looks like you are using React 19. <br>Some packages may fail to install due to peer dependency issues in npm (see <a href="https://ui.shadcn.com/react-19).">https://ui.shadcn.com/react-19).</a></pre><pre>✔ How would you like to proceed? › Use --force<br>✔ Installing dependencies.<br>✔ Created 1 file:<br>  - src/lib/utils.js</pre><pre>Success! Project initialization completed.<br>You may now add components.</pre><blockquote>You’re done…</blockquote><h3>Usage</h3><p>Button</p><pre>$ npx shadcn@latest add button</pre><pre>import { Button } from &quot;./components/ui/button&quot;<br><br>&lt;Button variant=&quot;destructive&quot;&gt;Click Me&lt;/Button&gt;</pre><p>Accordion</p><pre>$ npx shadcn@latest add accordion</pre><pre>import { Accordion, AccordionContent, AccordionItem, AccordionTrigger} from &quot;@/components/ui/accordion&quot;<br><br>&lt;Accordion type=&quot;single&quot; collapsible className=&quot;w-full&quot;&gt;<br>      &lt;AccordionItem value=&quot;item-1&quot;&gt;<br>        &lt;AccordionTrigger&gt;Is it accessible?&lt;/AccordionTrigger&gt;<br>        &lt;AccordionContent&gt;<br>          Yes. It adheres to the WAI-ARIA design pattern.<br>        &lt;/AccordionContent&gt;<br>      &lt;/AccordionItem&gt;<br>      &lt;AccordionItem value=&quot;item-2&quot;&gt;<br>        &lt;AccordionTrigger&gt;Is it styled?&lt;/AccordionTrigger&gt;<br>        &lt;AccordionContent&gt;<br>          Yes. It comes with default styles that matches the other<br>          components&amp;apos; aesthetic.<br>        &lt;/AccordionContent&gt;<br>      &lt;/AccordionItem&gt;<br>      &lt;AccordionItem value=&quot;item-3&quot;&gt;<br>        &lt;AccordionTrigger&gt;Is it animated?&lt;/AccordionTrigger&gt;<br>        &lt;AccordionContent&gt;<br>          Yes. It&#39;s animated by default, but you can disable it if you prefer.<br>        &lt;/AccordionContent&gt;<br>      &lt;/AccordionItem&gt;<br>    &lt;/Accordion&gt;</pre><p>It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*ga8KYfOO8isML8WNANzh5g.png" /><figcaption>Source: Trust Me Bro….</figcaption></figure><h4>Source:</h4><ul><li><a href="https://ui.shadcn.com/docs/installation/vite">Vite</a></li><li><a href="https://mobisoftinfotech.com/resources/blog/react-19-shadcn-ui-integration-tutorial">Integrating Shadcn UI with React 19: Step-by-Step Tutorial</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c564b9efae85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implement Dark Mode in Tailwind with React]]></title>
            <link>https://medium.com/@rkfarhansadik/implement-dark-mode-in-tailwind-with-react-2fc40acf38cc?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fc40acf38cc</guid>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 21:37:53 GMT</pubDate>
            <atom:updated>2025-03-29T21:52:25.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*6qDVHz5VCTtI9is9.gif" /><figcaption>Source: Internet</figcaption></figure><p>In this tutorial, we will learn how to <strong>implement dark mode in a React application</strong> using <strong>Tailwind CSS</strong>. The dark mode functionality is achieved by toggling a dark class on the &lt;html&gt; element and persisting the user&#39;s theme preference using localStorage.</p><p>Dark mode is an essential feature in modern web applications, improving accessibility and reducing eye strain. In this tutorial, we will implement a <strong>dark mode toggle in a React application</strong> using <strong>Tailwind CSS</strong>. We will utilize React’s <strong>state management (</strong><strong>useState)</strong>, <strong>side effects (</strong><strong>useEffect)</strong>, and <strong>local storage</strong> to persist user preferences.</p><p>By the end of this tutorial, you will have a fully functional <strong>dark mode switch</strong> that updates the UI dynamically and remembers the user’s choice even after a page refresh. Tailwind’s dark: utility classes will be used to style components automatically when dark mode is enabled.</p><h3>Setup Vite project with Tailwind</h3><ol><li>Create a new vite project:</li></ol><pre>// Install Vite Project <br>$ npm create vite@latest preline-ui-test -- --template react<br><br>// Redirect to project directory <br>$ cd preline-ui-test<br><br>// Install Packages <br>$ npm install<br><br>// Run Project<br>$ npm run dev</pre><p>2. Install and Setup Tailwind</p><pre>// Tailwind <br>$ npm install tailwindcss @tailwindcss/vite</pre><p>Add the @tailwindcss/vite plugin to your Vite configuration.</p><pre>import { defineConfig } from &#39;vite&#39;<br>import react from &#39;@vitejs/plugin-react&#39;<br>import tailwindcss from &#39;@tailwindcss/vite&#39;<br><br>// https://vite.dev/config/<br>export default defineConfig({<br>  plugins: [react(), tailwindcss()],<br>})</pre><p>Add an @import to your main CSS file that imports Tailwind CSS and Preline Ui. Make sure you’ve removed previous CSS classes.</p><p>Example: src/index.css</p><pre>@import &quot;tailwindcss&quot;;<br><br>// we must add this line (from tailwindcss darkmode doc)<br>@custom-variant dark (&amp;:where(.dark, .dark *));</pre><p>Now it’s ready for the experiment.</p><h3>Prepare Component</h3><p>Now we will define and design the component, which will visible for the page.</p><pre>&lt;section className=&quot;flex flex-col items-center justify-center h-screen dark:bg-gray-800&quot;&gt;<br><br>  &lt;h1 className=&quot;text-2xl font-bold dark:text-white&quot;&gt;<br>    Tailwind CSS Dark Mode<br>  &lt;/h1&gt;<br>  &lt;p className=&quot;dark:text-white&quot;&gt;<br>    Press the button to switch dark or white mode<br>  &lt;/p&gt;<br><br>  // That&#39;s the component for dark mode implementation<br>  &lt;DarkMode/&gt;<br><br>&lt;/section&gt;</pre><h3>Implement DarkMode Functionality</h3><p>Now we will create a <strong>&lt;DarkMode/&gt;</strong> component for button and its handler.</p><pre>// It retrieves the saved theme from localStorage (if available). If no theme is found, it defaults to &#39;light&#39;. useState initializes the theme state with this value.<br>const defaultState = localStorage.getItem(&#39;theme&#39;) || &#39;light&#39;;<br>const [theme, setTheme] = useState(defaultState);<br><br>// Update Theme Using useEffect<br>useEffect(() =&gt; {<br> // Triggered every time theme changes ([theme] dependency). Saves the theme to localStorage so it persists across page reloads.<br> localStorage.setItem(&#39;theme&#39;, theme);<br> // Toggles the dark class on &lt;html&gt;, allowing Tailwind to apply dark mode styles.<br> document.documentElement.classList.toggle(&#39;dark&#39;, theme === &#39;dark&#39;);<br>}, [theme]);<br><br>// Handle Button Click to Toggle Theme<br>const handleButton = () =&gt; {<br> // Switches the theme:<br> setTheme(theme == &#39;light&#39; ? &#39;dark&#39; : &#39;light&#39;);<br>}<br><br>return (<br>&lt;div&gt;<br> {/* Button to Toggle Mode */}<br> &lt;button onClick={handleButton} className=&#39;rounded-md bg-lime-400 py-2 px-4 my-4 dark:bg-lime-600 dark:text-white&#39;&gt;<br> {theme === &#39;light&#39; ? &#39;Dark Mode&#39; : &#39;Light Mode&#39;}<br> &lt;/button&gt;<br>&lt;/div&gt;<br>);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*5yERXDPqj6FlS2-7QqZT_A.png" /><figcaption>Light Mode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*VZ3b5DTNtDyVFkY7HwpdkA.png" /><figcaption>Dark Mode</figcaption></figure><h4>So what’s happening here</h4><ol><li><strong>On First Load:</strong></li></ol><p>Fetches the theme from localStorage (or defaults to light mode). Applies the correct class (dark or not) to &lt;html&gt;.</p><p><strong>2. When Button is Clicked:</strong><br>Toggles between light and dark. Updates localStorage so it persists after a page reload.</p><p><strong>3. On Page Refresh:</strong><br>The saved theme is loaded from localStorage. The correct mode is applied automatically.</p><h4>Live View</h4><p><a href="https://tailwind-dark-mode-experiment.netlify.app/">Vite + React</a></p><h4>Source Code</h4><p><a href="https://gitlab.com/web-design-farhansadik/tailwind-dark-mode">Web Design / Tailwind Dark Mode · GitLab</a></p><h4>Source</h4><p><a href="https://tailwindcss.com/docs/dark-mode">Dark mode - Core concepts</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fc40acf38cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Preline UI on React with Vite]]></title>
            <link>https://medium.com/@rkfarhansadik/install-preline-ui-on-react-with-vite-8ae80726c234?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ae80726c234</guid>
            <category><![CDATA[preline-ui]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[vitejs]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 20:15:35 GMT</pubDate>
            <atom:updated>2025-03-29T20:18:20.245Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bQIenL1m5PPXK5eY" /></figure><p>It’s an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.</p><p>I’m writing this tutorial, because when you look at their <a href="https://preline.co/docs/frameworks.html">Framework Installation</a> guide, there’s no installation guide for <strong>Vite</strong>. That’s why I’m writing this tutorial, so you/readers can install preline ui on their <strong>Vite</strong> with <strong>React</strong> project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*4AV7Uq2FgroDY18exNv_Dg.png" /><figcaption>Source: <a href="https://preline.co/docs/frameworks.html">https://preline.co/docs/frameworks.html</a></figcaption></figure><h3>Installation</h3><ol><li>Create a new vite project:</li></ol><pre>// Install Vite Project <br>$ npm create vite@latest preline-ui-test -- --template react<br><br>// Redirect to project directory <br>$ cd preline-ui-test<br><br>// Install Packages <br>$ npm install<br><br>// Run Project<br>$ npm run dev</pre><p>2. Install Tailwind and Preline Ui</p><pre>// Tailwind <br>$ npm install tailwindcss @tailwindcss/vite<br><br>// Preline Ui<br>$ npm install preline</pre><h3>Setup Tailwind and Preline Ui</h3><ol><li>Add the @tailwindcss/vite plugin to your Vite configuration.</li></ol><pre>import { defineConfig } from &#39;vite&#39;<br>import react from &#39;@vitejs/plugin-react&#39;<br>import tailwindcss from &#39;@tailwindcss/vite&#39;<br><br>// https://vite.dev/config/<br>export default defineConfig({<br>  plugins: [react(), tailwindcss()],<br>})</pre><p>2. Add an @import to your main CSS file that imports Tailwind CSS and Preline Ui. Make sure you’ve removed previous CSS classes.</p><p>Example: src/index.css</p><pre>@import &quot;tailwindcss&quot;;<br><br>/* Preline UI */<br>@import &quot;./node_modules/preline/variants.css&quot;;</pre><p>Now it’s ready to use.</p><blockquote>But, If you’ve encounter any error, make sure ./node_modules/preline/variants.css file exists. If doesn’t then install preline package again. Shit happens.</blockquote><h3>Usage Example</h3><pre>&lt;div&gt;<br>  &lt;h1 className=&quot;text-2xl&quot;&gt;Preline Ui&lt;/h1&gt;<br><br>  &lt;button type=&quot;button&quot; className=&quot;flex justify-center items-center size-11 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none&quot;&gt;<br>    &lt;span className=&quot;animate-spin inline-block size-4 border-3 border-current border-t-transparent text-blue-600 rounded-full&quot; role=&quot;status&quot; aria-label=&quot;loading&quot;&gt;<br>      &lt;span className=&quot;sr-only&quot;&gt;Loading...&lt;/span&gt;<br>    &lt;/span&gt;<br>  &lt;/button&gt;<br>&lt;/div&gt;</pre><p>It should look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*esIFwr0scNDs8Liq__Kl1A.png" /></figure><h3>Sources</h3><ul><li><a href="https://preline.co/docs/index.html">Preline UI - Tailwind CSS component library</a></li><li><a href="https://tailwindcss.com/docs/installation/using-vite">Installing with Vite - Installation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ae80726c234" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ভিম টেক্সট এডিটর]]></title>
            <link>https://medium.com/@rkfarhansadik/vim-%E0%A6%9F%E0%A7%87%E0%A6%95%E0%A7%8D%E0%A6%B8%E0%A6%9F-%E0%A6%8F%E0%A6%A1%E0%A6%BF%E0%A6%9F%E0%A6%B0-89df77e029da?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/89df77e029da</guid>
            <category><![CDATA[learn-linux-in-bangla]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 11:13:23 GMT</pubDate>
            <atom:updated>2025-04-22T17:55:38.811Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gk7YUM494v5TZWJAf2pl1Q.png" /><figcaption>Source: Wikipedia</figcaption></figure><p>ভিম খুবই এডভান্সড এবং পাওয়ারফুল একটি টেক্সট এডিটর। Vi টেক্সট এডিটর এর আপডেট ভার্সন হলো ভিম। Vi ডিফল্টভাবে ইন্সটল করাই থাকে। তবে সাধারনত ভিম ইন্সটল করা থাকে না। ইন্সটল করা না থাকলে ইন্সটল করে নিতে হবে।</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*NGrhl7D7gcxJeOMsQQNRTg.png" /><figcaption>Image: Vim Installation on Linux Mint</figcaption></figure><h4>ভিম চালু করা</h4><p>ন্যানো টেক্সট এডিটর এর মতোই ভিমের ক্ষেত্রেও টার্মিনালে শুধু vim লিখে এন্টার দিলেই ভিম চালু হয়ে যাবে। আর ফাইলনেম সহ চালু করতে চাইলে vim filename.txt লিখে এন্টার দিতে হবে। টার্মিনালে শুধু vim লিখে দেখা যাকঃ</p><pre>farhansadik@mint:~$ vim</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*AFEv4EfZ-E9wLjWy9yKPOg.png" /></figure><p>ওপেন করারপর দেখা যাচ্ছে এখানে কিছু দরকারি তথ্যাদি রয়েছে। যেমন এক্সিট করার জন্য “:q” কমান্ড দিতে হবে। সরাসরি যদি আমরা :q কমান্ড দিতে চাই, তাহলে এভাবে কমান্ড দেয়া যাবে না। কারন ভিম এডিটর চালু করলেই যা খুশি তা করা যায় না। এটি বিভিন্ন মোডে থাকে। ভিমের কোন কমান্ড দিতে চাইলে প্রথমে <strong>ESC</strong> বাটনে প্রেস করে কমান্ড মোডে যেতে হবে এরপর কমান্ড দিতে হবে।</p><ul><li>এক্সিট করতে চাইলে <strong>ESC</strong> তে প্রেস করে :q কমান্ড দিতে হবে।</li><li>অভাররাইট (<em>কিছু লিখার পর সেভ করা না হলে</em>) করতে হলে :q!</li><li>লিখার পর সেভ এন্ড এক্সিট করতে :wq</li></ul><h4>ফাইল সেভ করা</h4><p>আগেই বলেছি ভিম বিভিন্ন মোডে ভাগ করা থাকে। চালু করা মাত্রই লিখা যায় না। এজন্য এটিকে বলা হয় Modal Editor।</p><p>উদাহরণঃ</p><p>myfile ডিরেক্টরিতে desktop_environment.txt নামে একটি ফাইল তৈরি করে সেখানে বিভিন্ন ডেস্কটপ এনভাইরনমেন্টের নাম লিখে সেভ করবো।</p><pre>farhansadik@mint:~$ vim myfile/desktop_environment.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*d1lRs7CXo5OTNLWCQq-Abg.png" /></figure><p>স্ক্রিনশটে খেয়াল করতে দেখতে পাবো অনেকগুলো লাইন আছে। যার শুরুতে “<strong>~</strong>” চিহ্ন রয়েছে। যার অর্থ হচ্ছে এখনও এখানে কিছু লেখা হয় নি। নীচে আমরা ফাইলের নাম দেখতে পাচ্ছি। অর্থাৎ ভিম এখনও কমান্ড মোডে রয়েছে। লিখার জন্য আমাদের প্রথমে ইনসার্ট মোডে যেতে হবে। ইনসার্ট মোডে যেতে চাইলে i অথবা INSERT বাটন প্রেস করতে হবে। প্রেস করার পর নীচে --INSERT-- এমন লিখা দেখতে পাবো। কয়েকটা ডেস্কটপ এনভাইরনমেন্ট এর নাম লিখা যাক।</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*B7G8CtLdpxxPqYHIvvbdUA.png" /></figure><p>এইবার এই লিখাটুকু সেভ করবো। সেভ করার জন্য প্রথমে <strong>ESC</strong> চেপে কমান্ড মোডে যাবো। এরপর :w (রাইট/write) কমান্ড দিয়ে সেভ করবো। কমান্ডটি দিলে নীচে <strong>“myfile/desktop_environment.txt” 8L, 66B written” </strong>দেখতে পাবো। অর্থাৎ সঠিকভাবে রাইট হয়েছে। এবার চাইলে :q দিয়ে এক্সিট কমান্ড দিয়ে বের হয়ে যেতে পারি।</p><h4>আনডু এবং রিডু</h4><p>আনডু করতে কমান্ড মোডে গিয়ে কমান্ড দিতে হবে u অথবা :u আর নয়তো :undo লিখে এন্টার দিলেই আনডু হয়ে যাবে। অন্যদিকে রিডু করতে হলে সরাসরি <strong>CTRL + R </strong>বাটনে প্রেস করলেই হবে।</p><h4>টেক্সট সার্চ এবং রিপ্লেস</h4><p>সার্চ করার জন্য সরাসরি কমান্ড মোডে যাওার পর / ব্যবহার করতে হবে। এরপর যা সার্চ করতে চাই তা লিখলেই হবে। যেমন, যদি XFCE খুজতে চাই তাহলে কমান্ডটি হবে অনেকটা এমন, <strong>ESC + /XFCE + Enter</strong>। আর যদি একই শব্দ পরে আরও সার্চ করতে হয়, তাহলে n দিতে হবে।</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*no7xdP6ZyH5TXIHZAsR36w.png" /></figure><p>রিপ্লেস করার কয়েকটি পদ্ধতি রয়েছে। আমি এখানে সাবস্টিটিউশন কমান্ডের মাধ্যমে সার্চ এবং রিপ্লেস কীভাবে করা যায় তা নিয়ে আলোচনা করবো।</p><p>সিন্ট্যাক্সঃ</p><pre>:s/&lt;search word&gt;/&lt;replace word&gt;/options</pre><p>কমান্ড মোডে গিয়ে আমাদের এই কমান্ড দিতে হবে। প্রথমে <strong>:</strong> চিহ্ন দিয়ে কমান্ড কনসোল চালু করতে হবে। <strong>s</strong> হচ্ছে সাবস্টিটিউট। সার্চ ওয়ার্ডে যেই অংশটুকু সার্চ করতে চাই তাঁর নাম এবং পরেরটাতে রিপ্লেস করা যা বসাতে চাই তাঁর নাম। অপশনঃ <strong>c</strong> তে কনফার্মেশন, <strong>i</strong> তে ইগ্নোর আর <strong>g</strong> তে রিপ্লেস।</p><p>XFCE কে রিপ্লেস করে XFCE Desktop Environment লিখা যাকঃ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*eGoKmIaK83jufGb_VuijHg.png" /></figure><p>এন্টার দিলে “<strong>replace with Line (y/n/a/q/l/^E/^Y)?</strong>” মেসেজ আসবে। অর্থাৎ কনফার্মেশন চাচ্ছে। ‘<strong>y</strong>’ লিখে এন্টার দিলেই রিপ্লেস হয়ে যাবে। অপশনে যদি <strong>c</strong> ব্যবহার না করতাম তাহলে কোন কনফার্মেশন চাইতো না। চেষ্টা করে দেখুন।</p><h4>লাইন নাম্বার অনুযায়ী সার্চ এবং রিপ্লেস</h4><p>সাবস্টিটিউট কমান্ড দিয়ে চাইলে নির্দিস্ট লাইন নাম্বার বসিয়ে রিপ্লেস করা যায়।</p><p>সিন্ট্যাক্সঃ</p><pre>:start_line_number, end_line_number s/&lt;search_text&gt;/&lt;replace_text&gt;/g </pre><p>Gnome কে রিপ্লেস করে Gnome Desktop লিখা যাক। ভিম টেক্সট এডিটরে লাইন নাম্বার এনাবল করতে চাইলে কমান্ড দিতে হবে <strong>:set number</strong>। তাহলে পাশে লাইন নাম্বার দেখা যাবে।</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*HoHUwRC8co2Vz3nbqU7fUg.png" /></figure><p>Gnome ২ নাম্বার লাইনে আছে। এখানে লাইন নাম্বার রেঞ্জ হিসেবে ব্যবহার হচ্ছে। তাছাড়া চাইলে option এর অংশেও শুধু লাইন নাম্বার দিয়েও রিপ্লেস করা যাবে। তাহলে আমাদের কমান্ডটি হবে অনেকটা এমনঃ</p><pre>:2,2 s/Gnome/Gnome Desktop/g</pre><p>কমান্ড দেয়া যাকঃ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*86q-yIwAVvAR7ARn5r8Wpw.png" /></figure><h4>কাট, কপি এবং পেস্ট</h4><p>ভিম টেক্সট এডিটরে কাট-কপি-পেস্টের বিভিন্ন পদ্ধতি রয়েছে। আমি এখানে ভিজুয়াল মোডে কাট-কপি-পেস্ট করা নিয়ে আলোচনা করবো। ভিজুয়াল মোডে টেক্সট সিলেক্ট করা সহজ। কপি করে পেস্ট করাও বেশ সহজ। আমার কাছে এই পদ্ধতিটা অনেক সহজ মনে হয়েছে। তাছাড়া নরমাল মোডেও এসব কাজ করা যায়। কিন্তু সেটা বেশ এডভান্সড।</p><p>ভিজুয়াল মোডে যেতে চাইলে প্রথমে <strong>ESC</strong> বাটনে প্রেস করে <strong>v</strong> বাটনে প্রেস করতে হবে। ভিজুয়াল মোডে প্রবেশ করলে <strong>--VISUAL--</strong> নীচে লিখা দেখতে পাওয়া যাবে।</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*n6A9m127vLgNMGKpdZQtBQ.png" /></figure><p>এই উদাহরনে আমরা আগের desktop_environment.txt ফাইলে কাজ করবো। ৩ নাম্বার লাইন অর্থাৎ Cinnamon কপি করে লাস্ট লাইনে বসাবো। ভিজুয়াল মোডে যাওয়ার পর মাউস দিয়ে যতটুকু অংশ দরকার সিলেক্ট করবো। সিলেক্ট করার পর <strong>y</strong> প্রেস করে <strong>copy</strong> কমান্ড দিবো। তারপর লাস্টের লাইনে কার্সর নিয়ে পেস্ট করার জন্য প্রথমে <strong>ESC</strong> বাটনে প্রেস করে এরপর <strong>p</strong> প্রেস করবো।</p><blockquote>ন্যানোর মতো ভিমেও বিভিন্ন ধরনের কনফিগারেশন ব্যবহার করা যায়। কিন্তু ভিমের কনফিগারেশন নিয়ে আলোচনা করছি না। কারন বিষয়গুলো কিছুটা এডভান্সড। নতুন অবস্থায় কিছুটা কঠিন মনে হতে পারে বলে আমার ধারনা।</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*iz1O5drV2b1wonXJOt1AzA.png" /></figure><p>কপি করা দেখা গেলো এইবার কাট করা দেখি। পদ্ধতি একই, শুধু কাট করার ক্ষেত্রে এখানে <strong>d</strong> ব্যবহৃত হবে। <strong>ESC</strong> প্রেস করে এর পর <strong>v</strong> বাটনে প্রেস করে ভিজুয়াল মোড অন করি। এর পর কোন একটি টেক্সট মাউস দিয়ে সিলেক্ট করে <strong>d</strong> দিয়ে কাট করি। এরপর লাস্ট লাইনে গিয়ে আবার <strong>ESC</strong> প্রেস করে <strong>p</strong> বাটন প্রেস করে পেস্ট করে দেই।</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*7BUlp1MjScWxJdiWNysjcQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89df77e029da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[লিনাক্সে shutdown কমান্ডের গল্প]]></title>
            <link>https://medium.com/@rkfarhansadik/%E0%A6%B2%E0%A6%BF%E0%A6%A8%E0%A6%BE%E0%A6%95%E0%A7%8D%E0%A6%B8%E0%A7%87-shutdown-%E0%A6%95%E0%A6%AE%E0%A6%BE%E0%A6%A8%E0%A7%8D%E0%A6%A1%E0%A7%87%E0%A6%B0-%E0%A6%97%E0%A6%B2%E0%A7%8D%E0%A6%AA-0eb646ca6ed1?source=rss-4f7e269dff83------2</link>
            <guid isPermaLink="false">https://medium.com/p/0eb646ca6ed1</guid>
            <category><![CDATA[learn-linux-in-bangla]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Farhan Sadik]]></dc:creator>
            <pubDate>Thu, 19 Dec 2024 18:37:46 GMT</pubDate>
            <atom:updated>2024-12-19T19:27:24.403Z</atom:updated>
            <content:encoded><![CDATA[<p>shutdown কমান্ড দিয়ে কি করে ? কম্পিউটার শাটডাউন মানে বন্ধ করে, এটা আমাদের সবারই জানা। কিন্তু এই কমান্ডের কিছু বাহারি কার্যক্ষমতা আছে। আজকে সেসব নিয়ে আলোচনা করবো।</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPvthveqLpluJ2-CSnjnDQ.jpeg" /><figcaption>Source: Freepic</figcaption></figure><p>আমি প্রায়শই রাতে সিনেমা ছেড়ে ঘুমিয়ে পড়ি। মাঝে মাঝে খেয়াল থাকে না, এরপর সারা রাতই কম্পিউটার চালু থাকে। সকালে যখন ঘুম ভাঙ্গে তখন কম্পিউটার বন্ধ করতে হয়। হুদাই ফাও ফাও কারেন্ট বিল তোলার দরকার কি? এজন্য আমি নির্দিস্ট টাইম দিয়ে রাখি, যে অমুক টাইমে মামা তুমি বন্ধ হইয়া যাইবা। সেও সুন্দর বন্ধ হয়ে যায়। তাহলে চলুন বিষয় খানা শিখে ফেলা যাক।</p><p><strong>কমান্ডের সিনট্যাক্সঃ</strong></p><pre>$ shutdown --options</pre><p>আমরা যদি এখনই কম্পিউটার বন্ধ করতে চাই, তাহলে কমান্ডটা হবে এমনঃ</p><pre>$ shutdown now </pre><p>আর যদি এখনই কম্পিউটার রি-স্টার্ট করতে চাই,</p><pre>$ shutdown -r now </pre><p>এখন যদি আমরা চাই, যে কম্পিউটার ঠিক রাত ১২:০১ মিনিটে বন্ধ হয়ে যাবে। অথবা আমরা একটি সিনেমা দেখছি, যা প্রায় ২ ঘণ্টার অর্থাৎ রাত ১২:০১ মিনিটে সিনেমাটি শেষ হয়ে যাবে। তাহলে এবার now এর বদলে সময় উল্লেখ করে দিবোঃ</p><pre>$ shutdown 12:01 AM </pre><p>আর দিনের বেলায় হলে PM উল্লেখ করবো।</p><p>আবার যদি চাই নির্দিস্ট কয়েক মিনিট পর কম্পিউটার বন্ধ হবে। আমরা তাকে নির্দিস্ট সময় না বলে তাকে উল্লেখ করে দিবো, যে মামা তুমি ৫ মিনিট পর বন্ধ হয়ে যাবা। তাহলে কমান্ডটি হবেঃ</p><pre>$ shutdown +5 </pre><p>অর্থাৎ <strong>+</strong> দেয়ার পর যত মিনিট পর বন্ধ করতে চাই, সেই সংখ্যা উল্লেখ করলেই কাজ হয়ে যাবে। তবে যদি ঘণ্টা হিসেবে করতে চাই তাহলে <strong>+</strong> এর পর যত ঘণ্টা তা লিখে এরপর মিনিট উল্লেখ করে দিবো। যেমন ১ ঘণ্টা পর,</p><pre>$ shutdown +1:00</pre><p>রিস্টার্ট করতে চাইলেও একই কমান্ড থাকবে, শুধু শুরুতে -r দিয়ে বুঝিয়ে দিতে হবে, যে মামা তোমাকে রিস্টার্ট হইতে হবে ৫ মিনিট পরে।</p><pre>$ shutdown -r +5</pre><p>পরিশেষে এক্সপেরিমেন্ট করতে গিয়ে আন্দাজি একটা টাইম দিয়ে দিলেন। জানেনই না কখন কম্পিউটার বন্ধ হবে। আমরা চাইলে সময়টা জেনে নিতে পারি অথবা শাটডাউন শিডিউল বন্ধ করে দিতে পারি।</p><p>প্রথমে জেনে নেই কম্পিউটার কখন বন্ধ হবেঃ</p><pre>$ shutdown --show<br>Shutdown scheduled for Fri 2024-12-20 00:32:27 +06, use &#39;shutdown -c&#39; to cancel.</pre><p>অর্থাৎ ১২:৩২ মিনিটে সে শাটডাউন এক্সিকিউট করবে। এবার যদি এই শিডিউল বন্ধ করে দিতে চাই, তাহলে কমান্ডটি হবেঃ</p><pre>$ shutdown -c </pre><p>ব্যাস কাজ শেষ। শাটডাউন কমান্ডের ব্যবহার কিন্তু তেমন কঠিন কিছু না। কিন্তু জানা থাকলে এটি বেশ কাজে আসে। স্পেশালি আমরা যখন ব্যাশ স্ক্রিপ্ট সিস্টেমে ব্যবহার করবো, তখন এটি বেশ কাজে আসে।</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0eb646ca6ed1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>