<?xml version="1.0"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>OnixOS Planet</title><description>Aggregating posts from the OnixOS community and developers</description><link>https://planet.onix-project.com</link><language>en-us</language><lastBuildDate>Mon, 13 Apr 2026 00:17:46 +0000</lastBuildDate><generator>OnixOS Planet RSS Generator</generator><docs>https://www.rssboard.org/rss-specification</docs><link href="https://planet.onix-project.com/feed.xml" rel="self" type="application/rss+xml"/><item><title>Beware of &#x201C;Ghost Companies&#x201D; &#x2014; My Personal Experience and Important Lessons for Job Seekers</title><link>https://oytun.org/p/beware-of-ghost-companies-my-personal-experience-and-important-lessons-for-job-seekers/</link><description>&lt;p&gt;I want to share my experience working at a company that seemed promising at first but turned out to be anything but professional or stable. It was a classic example of a &#x201C;ghost company&#x201D; &#x2014; a paravan firm with no real corporate backbone. Here&#x2019;s what happened and what I learned along the way:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Illusion of Legitimacy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I first applied, the company appeared professional. They had a website, an office address, and a friendly HR team. But as I dug deeper, I realized it was a facade. The company was essentially a shell &#x2014; no real corporate culture, no clear business model, and very limited transparency about who actually runs it. It&#x2019;s easy to get fooled by a shiny exterior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Initial Praise and False Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once I started working, they praised my skills and made me feel like a valuable team member. The atmosphere seemed positive, and they talked about growth, career advancement, and even bonuses. Naturally, I was motivated and invested myself fully in the job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Payment Issues and Withholding Rights&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Soon, the problems began. Salaries were delayed, and some promised benefits never materialized. When I raised questions, I was given vague excuses about &#x201C;cash flow problems&#x201D; and &#x201C;temporary difficulties.&#x201D; My rights as an employee were not fully respected. This is a critical warning sign that many overlook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Cost-Cutting and Attempts to Push Me Out&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As the company&#x2019;s financial situation worsened, I noticed a shift. They started pressuring me to leave, often through indirect means &#x2014; less favorable tasks, exclusion from meetings, and increased scrutiny. The goal was clear: reduce costs by forcing employees out without proper compensation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Workplace Bullying and Unpaid Wages&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The stress of not being paid on time, combined with subtle mobbing tactics, created a toxic work environment. The company failed to fulfill the basic agreement of paying me on time. This was not just unprofessional; it was unfair and harmful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Broken Hiring Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Everything they promised during recruitment &#x2014; competitive salary, career growth, a stable workplace &#x2014; turned out to be empty words. It&#x2019;s devastating to realize you&#x2019;ve been misled and that the reality is far from the initial picture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. A History of Disgruntled Employees&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I researched the company&#x2019;s background, I found countless former employees with similar stories of disappointment and frustration. This confirmed that my experience was not unique but part of a disturbing pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Can You Do to Protect Yourself?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Research deeply before applying. Don&#x2019;t just trust the website or glossy brochures. Look for company registration, financial health, and clear leadership information.&lt;/li&gt;
  &lt;li&gt;Check reviews and feedback from current and former employees on platforms like Glassdoor, LinkedIn, or industry-specific forums.&lt;/li&gt;
  &lt;li&gt;Be cautious of vague contracts or companies that hesitate to share official documentation. Transparency is key.&lt;/li&gt;
  &lt;li&gt;Watch out for companies with frequent employee turnover or negative reputations. If many people leave unhappy, there&#x2019;s likely a serious problem.&lt;/li&gt;
  &lt;li&gt;Trust your instincts. If something feels off during interviews or onboarding, don&#x2019;t ignore it. It&#x2019;s better to lose a job opportunity than your peace of mind.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Final Thought&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your career deserves to be built on a strong foundation &#x2014; a company that respects your time, effort, and rights. Don&#x2019;t let yourself be trapped by paravan firms that look good on paper but offer nothing but frustration and disappointment in reality.&lt;/p&gt;

&lt;p&gt;Stay informed. Stay cautious. And above all, value yourself enough to work where you&#x2019;re truly appreciated.&lt;/p&gt;</description><pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/beware-of-ghost-companies-my-personal-experience-and-important-lessons-for-job-seekers/</guid><author>Oytunistrator</author></item><item><title>The Overrated Myth of Networking: Why Building a Network Isn&#x2019;t as Important as You Think</title><link>https://oytun.org/p/the-overrated-myth-of-networking-why-building-a-network-isnt-as-important-as-you-think/</link><description>&lt;p&gt;We live in a world obsessed with networking. Entire industries are built on conferences, meetups, LinkedIn connections, and &#x201C;let&#x2019;s grab coffee sometime&#x201D; emails.&lt;/p&gt;

&lt;p&gt;The advice is everywhere:&lt;/p&gt;

&lt;div class="language-plaintext highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&#x201C;It&#x2019;s not what you know, it&#x2019;s who you know.&#x201D;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But here&#x2019;s the uncomfortable truth: networking, as most people practice it, is massively overrated.&lt;/p&gt;
&lt;h1 id="the-false-promise-of-endless-connections"&gt;The False Promise of Endless Connections&lt;/h1&gt;

&lt;p&gt;We&#x2019;ve been sold the idea that the bigger your network, the better your chances at success. So we chase more contacts, more followers, more &#x201C;visibility.&#x201D;&lt;/p&gt;

&lt;p&gt;But in reality, most of these connections are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Shallow&lt;/strong&gt; &#x2014; They remember your face but not your value.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;One-sided&lt;/strong&gt; &#x2014; You remember them because you need something; they don&#x2019;t remember you at all.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Disposable&lt;/strong&gt; &#x2014; They vanish the moment there&#x2019;s nothing in it for them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Having a long list of names doesn&#x2019;t mean you have influence, opportunities, or real support. It means you have a list of people who might recognize you in passing.&lt;/p&gt;

&lt;h1 id="networking-as-a-distraction"&gt;Networking as a Distraction&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Here&#x2019;s the danger: networking can easily become a socially acceptable form of procrastination.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It feels productive to attend events, hand out business cards, and grow your LinkedIn. But you might be avoiding the hard, often lonely work of:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Building deep expertise in your field.&lt;/li&gt;
  &lt;li&gt;Creating something valuable and original.&lt;/li&gt;
  &lt;li&gt;Delivering results that speak for themselves.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you substitute activity for impact, your network becomes a vanity metric.&lt;/p&gt;

&lt;h1 id="skills-outlast-social-circles"&gt;Skills Outlast Social Circles&lt;/h1&gt;

&lt;p&gt;Contacts can disappear overnight &#x2014; people change jobs, industries shift, algorithms bury your profile. But skills? Real, hard-earned competence? That stays with you.&lt;/p&gt;

&lt;p&gt;A strong network may open a door. But without skills, walking through that door just exposes you.&lt;/p&gt;

&lt;p&gt;In high-stakes situations, nobody hires you or partners with you because they &#x201C;owe you one.&#x201D; They do it because they trust your ability to deliver.&lt;/p&gt;

&lt;h1 id="the-trust-equation"&gt;The Trust Equation&lt;/h1&gt;

&lt;p&gt;Relationships in business aren&#x2019;t built on small talk alone &#x2014; they&#x2019;re built on trust plus value.&lt;/p&gt;

&lt;p&gt;Trust comes from:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Keeping promises.&lt;/li&gt;
  &lt;li&gt;Showing consistency over time.&lt;/li&gt;
  &lt;li&gt;Demonstrating integrity when it&#x2019;s inconvenient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Value comes from:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Solving problems others can&#x2019;t.&lt;/li&gt;
  &lt;li&gt;Making things better, faster, or easier.&lt;/li&gt;
  &lt;li&gt;Bringing ideas and execution, not just presence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without both, networking is just name collecting.&lt;/p&gt;
&lt;h1 id="from-who-you-know-to-who-knows-what-you-can-do"&gt;From &#x201C;Who You Know&#x201D; to &#x201C;Who Knows What You Can Do&#x201D;&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;The truth is, you don&#x2019;t need the biggest network. You need the right network &#x2014; one built naturally through your work, not forced through constant outreach.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you focus on being great at what you do, people talk. Opportunities spread. Introductions happen organically.&lt;/p&gt;

&lt;p&gt;The irony?&lt;/p&gt;

&lt;p&gt;The less you chase &#x201C;networking&#x201D; for its own sake, the more powerful your network becomes.&lt;/p&gt;

&lt;h1 id="a-better-approach"&gt;A Better Approach&lt;/h1&gt;

&lt;p&gt;Instead of asking: &#x201C;Who should I meet next?&#x201D;&lt;/p&gt;

&lt;p&gt;Ask: &#x201C;What can I create, improve, or solve that will make people want to meet me?&#x201D;&lt;/p&gt;

&lt;p&gt;Instead of measuring success by connections added, measure it by:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Projects completed.&lt;/li&gt;
  &lt;li&gt;Problems solved.&lt;/li&gt;
  &lt;li&gt;People helped.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because when you build something worth noticing, the right people will notice.&lt;/p&gt;
&lt;h1 id="final-thought"&gt;Final Thought&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Networking can be valuable &#x2014; but only when built on a foundation of trust, value, and competence. Without that foundation, it&#x2019;s just noise.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So maybe it&#x2019;s time we stop glorifying network building as the ultimate career strategy. Instead, let&#x2019;s glorify becoming valuable enough that the right network builds itself around us.&lt;/p&gt;

&lt;p&gt;Because in the end: It&#x2019;s not what you know. It&#x2019;s not who you know. It&#x2019;s who knows what you can do &#x2014; and trusts you to do it.&lt;/p&gt;</description><pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/the-overrated-myth-of-networking-why-building-a-network-isnt-as-important-as-you-think/</guid><author>Oytunistrator</author></item><item><title>Understanding and Disabling the OOM Killer in Linux</title><link>https://oytun.org/p/understanding-and-disabling-the-oom-killer-in-linux/</link><description>&lt;p&gt;Out-Of-Memory (OOM) Killer is a memory management feature in the Linux kernel designed to recover systems from situations where virtual memory is exhausted. While it aims to protect the kernel by killing processes to free up memory, the mechanism is often criticized for being abrupt, unpredictable, and sometimes destructive&#x2014;especially on production systems where killing critical services can lead to data loss, downtime, or service disruption.&lt;/p&gt;

&lt;h1 id="why-oom-killer-is-problematic"&gt;Why OOM Killer Is Problematic&lt;/h1&gt;

&lt;p&gt;OOM Killer doesn&#x2019;t always target non-essential processes. In many cases, it kills vital daemons or database instances, which leads to a cascading failure of services. This behavior can be extremely harmful in enterprise and cloud environments where uptime and reliability are crucial.&lt;/p&gt;

&lt;p&gt;Instead of letting the system operator make decisions, the kernel chooses which process to kill based on heuristics. This can result in confusion and frustration, especially when logs don&#x2019;t make the reasoning clear or the damage is already done before any human intervention is possible.&lt;/p&gt;

&lt;h1 id="disabling-the-oom-killer-triggering-a-kernel-panic-instead"&gt;Disabling the OOM Killer (Triggering a Kernel Panic Instead)&lt;/h1&gt;

&lt;p&gt;A more predictable and controlled alternative is to disable the OOM Killer by configuring the system to panic on OOM. This halts the system instead of randomly killing processes, giving administrators a chance to investigate and take action after a reboot. This method is especially favored in environments with HA (High Availability) configurations where a failover can be triggered on panic.&lt;/p&gt;

&lt;p&gt;To activate this behavior:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;sysctl vm.panic_on_oom&lt;span class="o"&gt;=&lt;/span&gt;1
sysctl kernel.panic&lt;span class="o"&gt;=&lt;/span&gt;10  &lt;span class="c"&gt;# Reboot after 10 seconds (or set to 0 to stay halted)&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"vm.panic_on_oom=1"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/sysctl.conf
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"kernel.panic=10"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/sysctl.conf
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This tells the kernel to panic instead of killing processes when an OOM condition is encountered, and to reboot after 10 seconds.&lt;/p&gt;

&lt;h1 id="a-preventive-measure-disabling-overcommit"&gt;A Preventive Measure: Disabling Overcommit&lt;/h1&gt;

&lt;p&gt;Rather than dealing with OOM situations reactively, one can prevent them by controlling memory overcommitment. By default, Linux allows processes to allocate more memory than is actually available (overcommit), which increases the chances of an OOM scenario.&lt;/p&gt;

&lt;p&gt;To restrict memory allocation to available RAM + swap:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;sysctl vm.overcommit_memory&lt;span class="o"&gt;=&lt;/span&gt;2
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"vm.overcommit_memory=2"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/sysctl.conf
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This setting ensures that the kernel denies memory allocation requests that exceed the actual limits, preventing the system from entering an OOM state in the first place.&lt;/p&gt;

&lt;h1 id="increase-swap-space-as-a-buffer"&gt;Increase Swap Space as a Buffer&lt;/h1&gt;

&lt;p&gt;Another effective way to reduce the likelihood of an OOM event is to increase the system&#x2019;s swap space. Swap acts as an emergency memory reservoir, allowing the system to continue operating under memory pressure, albeit with reduced performance.&lt;/p&gt;

&lt;p&gt;To check swap size:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;swapon &lt;span class="nt"&gt;--show&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create a new swap file:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;fallocate &lt;span class="nt"&gt;-l&lt;/span&gt; 16G /swapfile
&lt;span class="nb"&gt;chmod &lt;/span&gt;600 /swapfile
mkswap /swapfile
swapon /swapfile
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'/swapfile none swap sw 0 0'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/fstab
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;The OOM Killer may provide a last-resort safety mechanism, but in many real-world environments, it causes more harm than good. Disabling it and choosing more predictable behaviors&#x2014;such as kernel panic&#x2014;along with careful memory management (disabling overcommit and increasing swap) can lead to much more stable and reliable systems.&lt;/p&gt;</description><pubDate>Fri, 16 May 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/understanding-and-disabling-the-oom-killer-in-linux/</guid><author>Oytunistrator</author></item><item><title>Python Installation, Django Setup and React.js Integration</title><link>https://oytun.org/p/python-installation-django-setup-and-reactjs-integration/</link><description>&lt;h2 id="python-installation"&gt;Python Installation&lt;/h2&gt;

&lt;p&gt;Python is a popular programming language due to its simple syntax and extensive library support. To use frameworks like Django, we first need to install Python on our system.&lt;/p&gt;

&lt;h3 id="1-downloading-and-installing-python"&gt;1. Downloading and Installing Python&lt;/h3&gt;

&lt;p&gt;Follow these steps to install Python:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Download from the Official Website:&lt;/strong&gt;
Download the latest version of Python from &lt;a href="https://www.python.org/downloads/"&gt;https://www.python.org/downloads/&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Installation Configuration:&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;strong&gt;For Windows:&lt;/strong&gt; Run the downloaded &lt;code class="language-plaintext highlighter-rouge"&gt;python.exe&lt;/code&gt; file and check the &lt;strong&gt;&#x201C;Add Python to PATH&#x201D;&lt;/strong&gt; option.&lt;/li&gt;
      &lt;li&gt;&lt;strong&gt;For Linux/macOS:&lt;/strong&gt; Open the terminal and install Python using the following command:
        &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;python3
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
        &lt;p&gt;or for macOS:&lt;/p&gt;
        &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;python3
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;strong&gt;For Arch Linux:&lt;/strong&gt;
        &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; python
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;strong&gt;For Fedora:&lt;/strong&gt;
        &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;python3
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Verify Installation:&lt;/strong&gt;
Check if Python is installed correctly by running the following command in the terminal or command prompt:
    &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;python &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;or&lt;/p&gt;
    &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;python3 &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="django-installation-and-project-setup"&gt;Django Installation and Project Setup&lt;/h2&gt;

&lt;p&gt;Django is a powerful web framework used for rapid development. Follow these steps to install Django on your system.&lt;/p&gt;

&lt;h3 id="1-creating-a-virtual-environment"&gt;1. Creating a Virtual Environment&lt;/h3&gt;

&lt;p&gt;Using a virtual environment is a good practice to keep projects isolated.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create a virtual environment:
    &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; venv myenv
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Activate the virtual environment:
    &lt;ul&gt;
      &lt;li&gt;&lt;strong&gt;Windows:&lt;/strong&gt;
        &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;myenv&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\a&lt;/span&gt;ctivate
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;strong&gt;Linux/macOS:&lt;/strong&gt;
        &lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;source &lt;/span&gt;myenv/bin/activate
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Check if the virtual environment is active. You should see &lt;code class="language-plaintext highlighter-rouge"&gt;(myenv)&lt;/code&gt; in the terminal.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id="2-installing-django"&gt;2. Installing Django&lt;/h3&gt;

&lt;p&gt;Once the virtual environment is active, install Django using the following command:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;django
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To verify the installation:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;django-admin &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id="3-creating-a-new-django-project"&gt;3. Creating a New Django Project&lt;/h3&gt;

&lt;p&gt;Follow these steps to create a Django project:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;django-admin startproject myproject
&lt;span class="nb"&gt;cd &lt;/span&gt;myproject
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This will generate the necessary files for the project.&lt;/p&gt;

&lt;h3 id="4-running-the-development-server"&gt;4. Running the Development Server&lt;/h3&gt;

&lt;p&gt;Start Django&#x2019;s local development server:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;python manage.py runserver
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Visit &lt;code class="language-plaintext highlighter-rouge"&gt;http://127.0.0.1:8000/&lt;/code&gt; in your browser to confirm that Django is running successfully.&lt;/p&gt;

&lt;h3 id="5-creating-a-django-api"&gt;5. Creating a Django API&lt;/h3&gt;

&lt;p&gt;To create a REST API with Django, you can use the &lt;strong&gt;Django REST Framework&lt;/strong&gt; (DRF). First, install the library:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;djangorestframework
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then, add the following line to your &lt;code class="language-plaintext highlighter-rouge"&gt;settings.py&lt;/code&gt; file to enable DRF:&lt;/p&gt;
&lt;div class="language-python highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="n"&gt;INSTALLED_APPS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="bp"&gt;...&lt;/span&gt;
    &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rest_framework&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Create a simple API endpoint in &lt;code class="language-plaintext highlighter-rouge"&gt;myapp/views.py&lt;/code&gt;:&lt;/p&gt;
&lt;div class="language-python highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
6
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;rest_framework.response&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Response&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;rest_framework.decorators&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;api_view&lt;/span&gt;

&lt;span class="nd"&gt;@api_view&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;GET&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;hello_world&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, World!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, update your &lt;code class="language-plaintext highlighter-rouge"&gt;myapp/urls.py&lt;/code&gt; file to route the endpoint:&lt;/p&gt;
&lt;div class="language-python highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
6
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django.urls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;.views&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;hello_world&lt;/span&gt;

&lt;span class="n"&gt;urlpatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;api/hello/&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hello_world&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Once completed, run the server and test the API.&lt;/p&gt;

&lt;h2 id="reactjs-installation-and-integration-with-django"&gt;React.js Installation and Integration with Django&lt;/h2&gt;

&lt;p&gt;React.js is a popular JavaScript library for building modern web applications. We can integrate it with Django to create a frontend-backend architecture.&lt;/p&gt;

&lt;h3 id="1-installing-nodejs-and-npm"&gt;1. Installing Node.js and npm&lt;/h3&gt;

&lt;p&gt;To use React, you need to install Node.js and npm. Download them from:
&lt;a href="https://nodejs.org/"&gt;https://nodejs.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Verify the installation by running the following commands in the terminal:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt;
npm &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id="2-creating-a-reactjs-project"&gt;2. Creating a React.js Project&lt;/h3&gt;

&lt;p&gt;In the root directory of your Django project, create a new React application:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;npx create-react-app frontend
&lt;span class="nb"&gt;cd &lt;/span&gt;frontend
npm start
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After completion, your React application will be available at &lt;code class="language-plaintext highlighter-rouge"&gt;http://localhost:3000/&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id="3-connecting-react-with-django-api"&gt;3. Connecting React with Django API&lt;/h3&gt;

&lt;p&gt;To fetch data from the Django API in React, you can use the &lt;code class="language-plaintext highlighter-rouge"&gt;fetch&lt;/code&gt; method or the &lt;strong&gt;Axios&lt;/strong&gt; library. Install Axios using:&lt;/p&gt;
&lt;div class="language-sh highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;axios
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Example React component (&lt;code class="language-plaintext highlighter-rouge"&gt;App.js&lt;/code&gt;):&lt;/p&gt;
&lt;div class="language-javascript highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setMessage&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://127.0.0.1:8000/api/hello/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;setMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;API request failed:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This allows your React application to fetch data from the Django API.&lt;/p&gt;

&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;By following these steps, you have successfully installed Python, Django, and React.js. Now, you can build dynamic and modern web applications by using Django as the backend and React.js as the frontend. For more details, visit the &lt;a href="https://docs.djangoproject.com/en/stable/"&gt;Django Documentation&lt;/a&gt; and &lt;a href="https://react.dev/"&gt;React Documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Sat, 08 Mar 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/python-installation-django-setup-and-reactjs-integration/</guid><author>Oytunistrator</author></item><item><title>Building AI Agents with Python</title><link>https://oytun.org/p/building-ai-agents-with-python/</link><description>&lt;p&gt;AI agents are becoming an essential part of modern applications, helping automate tasks, analyze data, and make intelligent decisions. In this post, we&#x2019;ll explore how to build a simple AI agent using Python.&lt;/p&gt;

&lt;h2 id="what-is-an-ai-agent"&gt;What is an AI Agent?&lt;/h2&gt;

&lt;p&gt;An AI agent is a system that perceives its environment and takes actions to achieve a specific goal. AI agents can be reactive (responding to changes) or proactive (planning ahead). They are widely used in recommendation systems, chatbots, automated trading, and more.&lt;/p&gt;

&lt;h2 id="setting-up-your-ai-agent"&gt;Setting Up Your AI Agent&lt;/h2&gt;

&lt;p&gt;We&#x2019;ll create a simple rule-based AI agent in Python that responds to user input. To do this, we&#x2019;ll use basic Python programming concepts and the random library.&lt;/p&gt;

&lt;h2 id="step-1-define-the-ai-agent"&gt;Step 1: Define the AI Agent&lt;/h2&gt;

&lt;div class="language-python highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ai_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_text&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;responses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hi there!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hey!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;how are you&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;m just a program, but I&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;m doing great!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;m here to assist you!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bye&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Goodbye!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;See you later!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Take care!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;responses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;input_text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;responses&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;m not sure how to respond to that.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Example usage
&lt;/span&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AI:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;ai_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id="how-it-works"&gt;How It Works&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;We define a dictionary with predefined responses for specific keywords.&lt;/li&gt;
  &lt;li&gt;The function ai_agent() checks if the user input contains a known keyword.&lt;/li&gt;
  &lt;li&gt;If a match is found, the AI agent randomly selects a response from the predefined list.&lt;/li&gt;
  &lt;li&gt;The program runs in a loop, allowing continuous interaction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Expanding the AI Agent&lt;/p&gt;

&lt;p&gt;This simple rule-based agent can be improved by integrating &lt;strong&gt;Natural Language Processing (NLP)&lt;/strong&gt; techniques using libraries like &lt;strong&gt;NLTK&lt;/strong&gt; or &lt;strong&gt;spaCy&lt;/strong&gt;. We can also enhance it with machine learning models for more advanced understanding.&lt;/p&gt;

&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Building an AI agent in Python is a great way to understand the basics of AI-driven interactions. As AI continues to evolve, incorporating deep learning and reinforcement learning can make agents even more powerful.&lt;/p&gt;</description><pubDate>Mon, 03 Feb 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/building-ai-agents-with-python/</guid><author>Oytunistrator</author></item><item><title>Installing Ollama with Open WebUI in Linux Using Docker Compose</title><link>https://oytun.org/p/installing-ollama-with-open-webui-in-linux-using-docker-compose/</link><description>&lt;p&gt;In this guide, we will walk through the installation of Ollama with Open WebUI on both &lt;strong&gt;Debian&lt;/strong&gt; and &lt;strong&gt;Arch Linux&lt;/strong&gt;. We will use &lt;strong&gt;Docker Compose&lt;/strong&gt; instead of Docker to make the process smoother and more efficient.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id="arch-linux-setup"&gt;Arch Linux Setup&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Update and Install Dependencies:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Begin by updating your system and installing the required dependencies. Open your terminal and run the following commands:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-Syu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; nvidia-container-toolkit nvidia-utils docker docker-compose
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. Verify NVIDIA Installation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ensure that your NVIDIA drivers and utilities are properly installed:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;nvidia-smi
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Install Ollama:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To install Ollama, use the following script from Ollama&#x2019;s official site:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://ollama.com/install.sh | sh
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4. Install Additional Dependencies (Optional):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might need additional dependencies, so run:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; &amp;lt;package-name&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id="debian-setup"&gt;Debian Setup&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Update and Install Dependencies:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Update your system and install the required packages using the following commands:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nvidia-container-toolkit nvidia-utils docker docker-compose
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. Verify NVIDIA Installation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check if your NVIDIA drivers are working correctly by running:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;nvidia-smi
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Install Ollama:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Download and install Ollama using the following script:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://ollama.com/install.sh | sh
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4. Install Additional Dependencies (Optional):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might need additional packages depending on your setup:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;package-name&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id="docker-compose-setup"&gt;Docker Compose Setup&lt;/h3&gt;

&lt;p&gt;Now that the dependencies are set up on both Debian and Arch Linux, we will configure Docker Compose for running Open WebUI and Ollama.&lt;/p&gt;

&lt;p&gt;Create a &lt;code class="language-plaintext highlighter-rouge"&gt;docker-compose.yml&lt;/code&gt; file with the following content:&lt;/p&gt;

&lt;div class="language-yaml highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;open-webui&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;open-webui&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ghcr.io/open-webui/open-webui:latest&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;MODEL_DOWNLOAD_DIR=/models&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;OLLAMA_API_BASE_URL=http://ollama:11434&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;OLLAMA_API_URL=http://ollama:11434&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;LOG_LEVEL=debug&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;data:/data&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;models:/models&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;open-webui:/config&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3000:8080"&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ollama&lt;/span&gt;
    &lt;span class="na"&gt;extra_hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;host.docker.internal:host-gateway"&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ollama-net&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;

  &lt;span class="na"&gt;ollama&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ollama&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ollama/ollama:latest&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;NVIDIA_VISIBLE_DEVICES=all&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;NVIDIA_DRIVER_CAPABILITIES=compute,utility&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;CUDA_VISIBLE_DEVICES=0&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;LOG_LEVEL=debug&lt;/span&gt;
    &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;reservations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;devices&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;driver&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nvidia&lt;/span&gt;
              &lt;span class="na"&gt;capabilities&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;gpu&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
              &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;all&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ollama:/root/.ollama&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;models:/models&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;11434:11434"&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ollama-net&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;

  &lt;span class="na"&gt;watchtower&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;containrrr/watchtower:latest&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;watchtower&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/var/run/docker.sock:/var/run/docker.sock&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;WATCHTOWER_CLEANUP=true&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;WATCHTOWER_POLL_INTERVAL=86400&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ollama-net&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;

&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;models&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;ollama&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;open-webui&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;ollama-net&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id="explanation-of-the-docker-composeyml"&gt;Explanation of the &lt;code class="language-plaintext highlighter-rouge"&gt;docker-compose.yml&lt;/code&gt;:&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;open-webui&lt;/strong&gt;: This is the main service running the Open WebUI.
    &lt;ul&gt;
      &lt;li&gt;It uses the &lt;code class="language-plaintext highlighter-rouge"&gt;ghcr.io/open-webui/open-webui:latest&lt;/code&gt; image.&lt;/li&gt;
      &lt;li&gt;The port &lt;code class="language-plaintext highlighter-rouge"&gt;3000&lt;/code&gt; on the host is mapped to &lt;code class="language-plaintext highlighter-rouge"&gt;8080&lt;/code&gt; inside the container, making the web UI accessible.&lt;/li&gt;
      &lt;li&gt;Volumes are mounted to persist data and configuration across container restarts.&lt;/li&gt;
      &lt;li&gt;The &lt;code class="language-plaintext highlighter-rouge"&gt;NVIDIA_VISIBLE_DEVICES&lt;/code&gt; environment variable ensures the container has access to the GPU.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;watchtower&lt;/strong&gt;: This service will monitor the Docker containers and automatically update them when a new version of the image is available.
    &lt;ul&gt;
      &lt;li&gt;The &lt;code class="language-plaintext highlighter-rouge"&gt;WATCHTOWER_CLEANUP&lt;/code&gt; variable ensures old images are cleaned up.&lt;/li&gt;
      &lt;li&gt;The &lt;code class="language-plaintext highlighter-rouge"&gt;WATCHTOWER_POLL_INTERVAL&lt;/code&gt; defines how often Watchtower checks for updates (86400 seconds = 1 day).&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Volumes&lt;/strong&gt;: Data for Ollama and Open WebUI is persisted using Docker volumes &lt;code class="language-plaintext highlighter-rouge"&gt;ollama&lt;/code&gt; and &lt;code class="language-plaintext highlighter-rouge"&gt;open-webui&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="running-the-docker-compose-setup"&gt;Running the Docker Compose Setup&lt;/h3&gt;

&lt;p&gt;Once you&#x2019;ve created the &lt;code class="language-plaintext highlighter-rouge"&gt;docker-compose.yml&lt;/code&gt; file, navigate to its directory and run:&lt;/p&gt;

&lt;div class="language-bash highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will start both the Open WebUI and Watchtower services in detached mode.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;By following these steps, you will have successfully installed Ollama with Open WebUI in a Docker Compose setup on both &lt;strong&gt;Arch Linux&lt;/strong&gt; and &lt;strong&gt;Debian&lt;/strong&gt;. This setup ensures your services are up-to-date and ready to be used for AI-based tasks with GPU support via NVIDIA.&lt;/p&gt;</description><pubDate>Thu, 23 Jan 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/installing-ollama-with-open-webui-in-linux-using-docker-compose/</guid><author>Oytunistrator</author></item><item><title>Differences Between Compiler and Interpreter: Debugging in C with Specific Examples</title><link>https://oytun.org/p/differences-between-compiler-and-interpreter-debugging-in-c-with-specific-examples/</link><description>&lt;p&gt;In programming, compilers and interpreters are two fundamental tools that determine how code is executed. Understanding the distinctions between them is essential for writing efficient code and improving the debugging process. This article explores these differences with examples from C, a compiled language, and highlights how debuggers are more effective in compiler-based environments.&lt;/p&gt;

&lt;h2 id="what-is-a-compiler"&gt;What is a Compiler?&lt;/h2&gt;

&lt;p&gt;A compiler translates the entire source code into machine code, creating an executable file before running the program. C, C++, and Rust are examples of compiled languages. In C, using compilers like gcc or clang generates a binary that can be executed directly by the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Faster runtime performance: The translation happens once, reducing execution time.&lt;/li&gt;
  &lt;li&gt;Comprehensive error checking: Syntax errors are detected during compilation, before execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Time-consuming for development:&lt;/strong&gt; Every change in the code requires recompiling.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Platform dependency:&lt;/strong&gt; Compiled code is often platform-specific unless explicitly handled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Debugging in Compiled Languages (C Example):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Debugging in compiled languages uses tools like &lt;strong&gt;gdb (GNU Debugger)&lt;/strong&gt;, which allows breakpoints, variable inspection, and step-by-step code execution. Consider this example:&lt;/p&gt;

&lt;div class="language-c highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
4
5
6
7
8
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// This line will cause a division by zero error.&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Result: %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Attempting to divide by zero will crash the program. With &lt;code class="language-plaintext highlighter-rouge"&gt;gdb&lt;/code&gt;, you can debug as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Compile the program with debugging symbols enabled:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="language-plaintext highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;gcc -g program.c -o program
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. Run gdb to start debugging&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="language-plaintext highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;gdb ./program
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Set a breakpoint at main and run the program:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="language-plaintext highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;(gdb) break main
(gdb) run
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4. Step through the code to inspect the division by zero error:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="language-plaintext highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;(gdb) next
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;By observing variables and program flow, you can locate the error precisely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Debugging Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Core Dumps:&lt;/strong&gt; Analyze memory states when a program crashes.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Backtraces:&lt;/strong&gt; Identify the sequence of function calls leading to the error.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="what-is-an-interpreter"&gt;What is an Interpreter?&lt;/h2&gt;

&lt;p&gt;An interpreter translates and executes source code line-by-line without creating a separate executable. Python, JavaScript, and Ruby use interpreters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Faster iteration: No need to compile; changes are reflected immediately.&lt;/li&gt;
  &lt;li&gt;Easier debugging of dynamic code: Suited for scripting and quick prototyping.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Slower runtime performance: Code is translated every time it runs.&lt;/li&gt;
  &lt;li&gt;Runtime error detection: Some errors are only found when the problematic line is reached.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Debugging in Interpreted Languages (Python Example):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consider this Python code with a division error:&lt;/p&gt;

&lt;div class="language-python highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
2
3
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;  &lt;span class="c1"&gt;# ZeroDivisionError will occur here.
&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using Python&#x2019;s built-in pdb module, you can inspect the error dynamically:&lt;/p&gt;

&lt;div class="language-plaintext highlighter-rouge"&gt;&lt;div class="highlight"&gt;&lt;pre class="highlight"&gt;&lt;code&gt;&lt;table class="rouge-table"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="rouge-gutter gl"&gt;&lt;pre class="lineno"&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class="rouge-code"&gt;&lt;pre&gt;python -m pdb script.py
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Set a breakpoint using &lt;code class="language-plaintext highlighter-rouge"&gt;b &amp;lt;line_number&amp;gt;&lt;/code&gt; and use commands like &lt;code class="language-plaintext highlighter-rouge"&gt;n (next)&lt;/code&gt; and &lt;code class="language-plaintext highlighter-rouge"&gt;p &amp;lt;variable&amp;gt;&lt;/code&gt; to step through and inspect variables. However, compared to gdb, debugging Python does not offer low-level memory inspection or performance insights.&lt;/p&gt;

&lt;h2 id="compiler-vs-interpreter-debugging-efficiency"&gt;Compiler vs. Interpreter: Debugging Efficiency&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Breakpoint Handling:&lt;/strong&gt;
In C, &lt;code class="language-plaintext highlighter-rouge"&gt;gdb&lt;/code&gt; breakpoints pause execution at specific points, showing variable states and stack traces. Compilers generate rich symbol data, enabling deeper introspection. In Python, breakpoints are less informative regarding memory management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Static vs. Runtime Errors:&lt;/strong&gt;
Compilers catch many syntax and type errors before execution, while interpreters only detect them when the faulty code is executed. For example, dividing by zero in C is caught when running the compiled binary, while Python will only throw an error when reaching the faulty line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Performance Optimization Tools:&lt;/strong&gt;
C compilers offer options for profiling and optimizing code &lt;code class="language-plaintext highlighter-rouge"&gt;(-O2, -O3)&lt;/code&gt;, enhancing performance analysis tools.&lt;/p&gt;

&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;While both compilers and interpreters are integral to programming, the choice between them depends on the project&#x2019;s requirements. Debuggers in compiler-based languages, such as gdb for C, offer more powerful and detailed control over program execution, memory inspection, and performance analysis. Interpreter-based debugging is more flexible for rapid prototyping but lacks the depth of static analysis provided by compilers. Understanding these differences enables developers to choose the best tools for efficient coding and debugging.&lt;/p&gt;</description><pubDate>Thu, 16 Jan 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/differences-between-compiler-and-interpreter-debugging-in-c-with-specific-examples/</guid><author>Oytunistrator</author></item><item><title>Introduction: Shaping the Future with AI</title><link>https://oytun.org/p/introduction-shaping-the-future-with-ai/</link><description>&lt;p&gt;Artificial intelligence (AI) continues to evolve at an extraordinary pace, transforming industries, redefining workflows, and unlocking new possibilities across countless domains. From natural language processing to computer vision, AI is reshaping how we interact with technology and each other. As we look ahead, understanding the key tools, techniques, and hardware advancements will be critical to navigating AI&#x2019;s future.&lt;/p&gt;

&lt;h3 id="advancing-ai-development-key-tools-and-platforms"&gt;Advancing AI Development: Key Tools and Platforms&lt;/h3&gt;

&lt;p&gt;The development of AI models has seen a surge in specialized platforms that streamline workflows for researchers and developers alike. Here are some leading tools that are shaping the landscape:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href="https://huggingface.co/oytunistrator"&gt;Hugging Face&lt;/a&gt;&lt;/strong&gt;: Renowned for its Transformers library, Hugging Face offers a robust ecosystem for natural language processing (NLP) tasks. The platform simplifies fine-tuning, training, and deploying language models, making it accessible even for non-experts.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href="https://ollama.com/"&gt;Open Language Model Architecture (OLAMA)&lt;/a&gt;&lt;/strong&gt;: OLAMA represents a modular approach to creating adaptable AI systems. By focusing on scalability and customization, OLAMA&#x2019;s architecture provides a foundation for future AI innovations.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;a href="https://lmstudio.ai/"&gt;LM Studio&lt;/a&gt;&lt;/strong&gt;: A development environment tailored for training large language models (LLMs) efficiently. LM Studio integrates with cloud-based and local hardware resources, providing flexibility in scaling computational requirements.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Other Emerging Tools&lt;/strong&gt;: Frameworks like &lt;a href="https://www.tensorflow.org/"&gt;TensorFlow&lt;/a&gt;, &lt;a href="https://pytorch.org/"&gt;PyTorch&lt;/a&gt;, and &lt;a href="https://onnx.ai/"&gt;ONNX&lt;/a&gt; continue to play a pivotal role in AI research and development, enabling everything from custom neural networks to inference optimization.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="hardware-considerations-cpu-vs-gpu-in-ai-workflows"&gt;Hardware Considerations: CPU vs. GPU in AI Workflows&lt;/h3&gt;

&lt;p&gt;Efficient AI model training and inference hinge on the choice of hardware. Understanding the differences between CPUs and GPUs is vital for selecting the right infrastructure.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Central Processing Units (CPUs)&lt;/strong&gt;: Traditionally, CPUs handle general-purpose computing tasks. Their sequential processing makes them well-suited for simpler machine learning models and tasks requiring minimal parallelization.&lt;/p&gt;

    &lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: Linear regression or logistic regression models can run efficiently on multi-core CPUs.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Graphics Processing Units (GPUs)&lt;/strong&gt;: GPUs are designed for parallel computation, making them ideal for training deep learning models. Their architecture excels at handling matrix multiplications and large-scale data processing.&lt;/p&gt;

    &lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: Training a convolutional neural network (CNN) for image classification or a transformer model for NLP tasks benefits greatly from the parallel capabilities of GPUs.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="conclusion-building-smarter-faster-ai"&gt;Conclusion: Building Smarter, Faster AI&lt;/h3&gt;

&lt;p&gt;The future of AI is being shaped by continuous advancements in both tools and hardware. By leveraging platforms like Hugging Face, OLAMA, and LM Studio, and understanding the nuances of CPU vs. GPU performance, developers can create more powerful and efficient AI solutions. Staying informed about these innovations will be key to harnessing AI&#x2019;s full potential in the years to come.&lt;/p&gt;</description><pubDate>Thu, 16 Jan 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/introduction-shaping-the-future-with-ai/</guid><author>Oytunistrator</author></item><item><title>The Importance of Time Zones in Meeting Planning and Why Coordinating Shared Times Matters</title><link>https://oytun.org/p/the-importance-of-time-zones-in-meeting-planning-and-why-coordinating-shared-times-matters/</link><description>&lt;p&gt;In an increasingly globalized world, remote teams are the norm, and seamless collaboration requires smart planning. One of the most overlooked yet critical aspects of this process is time zone management. Understanding and accommodating time zones can make the difference between an efficient meeting and one riddled with confusion or low attendance.&lt;/p&gt;

&lt;h1 id="why-time-zones-matter"&gt;Why Time Zones Matter&lt;/h1&gt;

&lt;p&gt;When scheduling meetings across regions, it&#x2019;s crucial to recognize that team members may be working from vastly different parts of the world. Without considering time zones, meetings may be planned at inconvenient hours, negatively impacting productivity and work-life balance. For example, a time that works well for a team member in London may be the middle of the night for someone in San Francisco.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ignoring time zone differences can lead to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Decreased Engagement:&lt;/strong&gt; Team members forced into meetings during personal hours are unlikely to be fully engaged.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Missed Meetings:&lt;/strong&gt; Incorrect time conversions can result in missed meetings or late attendance.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Scheduling Conflicts:&lt;/strong&gt; Overlapping with personal time commitments reduces flexibility and increases frustration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id="best-practices-for-coordinating-across-time-zones"&gt;Best Practices for Coordinating Across Time Zones&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;To avoid these pitfalls, here are some actionable steps for better meeting scheduling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Leverage Time Zone Conversion Tools:&lt;/strong&gt; Tools like the &lt;a href="https://www.timeanddate.com/worldclock/converter.html"&gt;World Clock Meeting Planner&lt;/a&gt; make it easy to identify overlapping work hours across multiple cities.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Agree on a Common Time:&lt;/strong&gt; For recurring meetings, select a time that consistently falls within reasonable working hours for all participants.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Rotate Meeting Times:&lt;/strong&gt; If no perfect overlap exists, alternate the meeting time to share the inconvenience equally.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Communicate Clearly:&lt;/strong&gt; Always specify the time zone when sharing meeting details, and ensure that calendar invites adjust automatically for all participants.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;Effective time zone management reflects respect for your colleagues&#x2019; time and ensures smoother collaboration. By using the right tools and strategies, global teams can stay productive and connected without compromising personal well-being. Next time you plan a meeting, take a moment to check the clock across the world &#x2014; it&#x2019;s worth it.&lt;/p&gt;</description><pubDate>Tue, 14 Jan 2025 00:00:00 +0000</pubDate><guid>https://oytun.org/p/the-importance-of-time-zones-in-meeting-planning-and-why-coordinating-shared-times-matters/</guid><author>Oytunistrator</author></item><item><title>Take Control of Your Network: Exploring Pi-Hole and the Power of Blocklists</title><link>https://oytun.org/p/take-control-of-your-network-exploring-pi-hole-and-the-power-of-blocklists/</link><description>&lt;p&gt;In today&#x2019;s digital age, privacy and security are becoming more critical than ever. Ads, trackers, and malicious domains are constantly trying to invade our online space. Enter &lt;a href="https://pi-hole.net/"&gt;Pi-Hole&lt;/a&gt;&#x2014;a DNS-level ad blocker and one of the most effective tools for securing your network and enhancing privacy.&lt;/p&gt;

&lt;p&gt;But what makes &lt;a href="https://pi-hole.net/"&gt;Pi-Hole&lt;/a&gt; truly powerful? The answer lies in blocklists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Pi-Hole?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pi-hole.net/"&gt;Pi-Hole&lt;/a&gt; is essentially a network-wide ad blocker. Instead of just blocking ads in your browser, it works at the DNS level, preventing unwanted requests from ever reaching your devices. This means:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;No ads across devices (smartphones, smart TVs, IoT devices).&lt;/li&gt;
  &lt;li&gt;Enhanced privacy with trackers blocked.&lt;/li&gt;
  &lt;li&gt;Protection from malicious domains.&lt;/li&gt;
  &lt;li&gt;Improved network performance by reducing unnecessary requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It&#x2019;s easy to install on devices like a Raspberry Pi or even a virtual machine. Once set up, Pi-Hole becomes the unsung hero of your network, quietly improving your digital experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Blocklists Matter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pi-Hole is only as effective as the blocklists you use. Blocklists are essentially databases of known ad-serving, tracking, or malicious domains. By choosing the right blocklists, you can fine-tune your Pi-Hole setup to suit your needs, whether that&#x2019;s blocking intrusive ads, preventing tracking, or safeguarding your home or business from harmful content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Top Blocklists for 2024&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here are some of the best blocklists to supercharge your Pi-Hole setup:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="https://github.com/sefinek/Sefinek-Blocklist-Collection"&gt;Sefinek Blocklist&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://oisd.nl/"&gt;OISD Blocklist&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://firebog.net/"&gt;Firelog&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://easylist.to/"&gt;Easy List&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://adguard.com/kb/general/ad-filtering/adguard-filters/"&gt;AdGuard DNS Filter&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://github.com/blocklistproject/Lists"&gt;Block List Project&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://github.com/notracking/hosts-blocklists"&gt;NoTracking Blocklist&lt;/a&gt; (archived)&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://github.com/EnergizedProtection/block"&gt;Energized Protection&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://github.com/oytunistrator/pihole-blacklist"&gt;My Simple Blocklist&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pro Tips for Optimizing Pi-Hole&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Customize Your Blocklists:&lt;/strong&gt; Use multiple blocklists to ensure comprehensive protection, but avoid excessive overlaps to maintain performance.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Whitelist Carefully:&lt;/strong&gt; Occasionally, legitimate domains may get blocked. Add them to your whitelist after verifying their safety.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Monitor Logs:&lt;/strong&gt; Pi-Hole&#x2019;s dashboard provides insight into what&#x2019;s being blocked, helping you refine your setup.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Combine with VPNs:&lt;/strong&gt; Pair Pi-Hole with a VPN for an even more robust privacy solution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Pi-Hole Matters Today&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With rising concerns about online privacy, &lt;a href="https://pi-hole.net/"&gt;Pi-Hole&lt;/a&gt; empowers individuals and businesses to take control of their digital space. It&#x2019;s cost-effective, easy to maintain, and incredibly powerful when paired with the right blocklists.&lt;/p&gt;

&lt;p&gt;Are you already using &lt;a href="https://pi-hole.net/"&gt;Pi-Hole&lt;/a&gt;, or are you considering implementing it? Let&#x2019;s share insights and tips in the comments&#x2014;I&#x2019;d love to hear your thoughts and experiences!&lt;/p&gt;</description><pubDate>Tue, 17 Dec 2024 00:00:00 +0000</pubDate><guid>https://oytun.org/p/take-control-of-your-network-exploring-pi-hole-and-the-power-of-blocklists/</guid><author>Oytunistrator</author></item></channel></rss>
