<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kpndevroot</title>
    <description>The latest articles on DEV Community by kpndevroot (@kpndevroot).</description>
    <link>https://dev.to/kpndevroot</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1408546%2F5629f468-c613-44d3-bed4-e4db44101c1f.png</url>
      <title>DEV Community: kpndevroot</title>
      <link>https://dev.to/kpndevroot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kpndevroot"/>
    <language>en</language>
    <item>
      <title>🐘 Simplified Guide to Setting Up PostgreSQL on macOS with Docker 🚢</title>
      <dc:creator>kpndevroot</dc:creator>
      <pubDate>Fri, 29 Nov 2024 17:59:42 +0000</pubDate>
      <link>https://dev.to/kpndevroot/simplified-guide-to-setting-up-postgresql-on-macos-with-docker-5egd</link>
      <guid>https://dev.to/kpndevroot/simplified-guide-to-setting-up-postgresql-on-macos-with-docker-5egd</guid>
      <description>&lt;h3&gt;
  
  
  Are you struggling with PostgreSQL configuration on macOS?
&lt;/h3&gt;

&lt;p&gt;If you’ve been wrestling with environment variables like these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;postgres://myuser@host.docker.internal:5432/mydb
&lt;span class="c"&gt;#OR&lt;/span&gt;
&lt;span class="nv"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;postgres://myuser:myuser@127.0.0.1:5432/mydb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’re not alone! PostgreSQL setup on macOS can feel daunting due to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Limited client tools: Unlike Linux, macOS lacks straightforward commands like &lt;code&gt;createuser --interactive -P&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;📖 Sparse documentation: Most PostgreSQL guides cater to Linux or Windows, leaving macOS users to figure it out on their own.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But don’t worry—we’ll walk through an easy and beginner-friendly way to set up PostgreSQL on macOS using Homebrew and Docker!🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  🏆 Why This Guide Stands Out
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ Clear step-by-step instructions.&lt;/li&gt;
&lt;li&gt;🖥️ Tailored for macOS users.&lt;/li&gt;
&lt;li&gt;📊 Real-world examples with expected outputs for verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Let’s dive in! 🚀&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🔧 Step 1: Install PostgreSQL Using Homebrew
&lt;/h3&gt;

&lt;p&gt;1️⃣ Install PostgreSQL with Homebrew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;postgresql@16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Start the PostgreSQL service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew services start postgresql@16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3️⃣ Verify the service status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew services info postgresql@16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see output like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;postgresql@16 &lt;span class="o"&gt;(&lt;/span&gt;homebrew.mxcl.postgresql@16&lt;span class="o"&gt;)&lt;/span&gt;
Running: ✔
Loaded: ✔
Schedulable: ✘
User: root
PID: 38646
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 &lt;strong&gt;Pro Tip&lt;/strong&gt;&lt;br&gt;
If you encounter issues, restart the service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew services restart postgresql@16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🏗️ Step 2: Create a PostgreSQL User and Database
&lt;/h3&gt;

&lt;p&gt;1️⃣ Access the PostgreSQL interactive shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;❯ psql postgres
psql &lt;span class="o"&gt;(&lt;/span&gt;14.13 &lt;span class="o"&gt;(&lt;/span&gt;Homebrew&lt;span class="o"&gt;)&lt;/span&gt;, server 16.4 &lt;span class="o"&gt;(&lt;/span&gt;Homebrew&lt;span class="o"&gt;))&lt;/span&gt;
WARNING: psql major version 14, server major version 16.
         Some psql features might not work.
Type &lt;span class="s2"&gt;"help"&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;help.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Create a User and Database&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a user
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;CREATE USER myuser WITH PASSWORD &lt;span class="s1"&gt;'user'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE ROLE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a database:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;CREATE DATABASE mydb&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Grant access:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GRANT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔗 Step 3: Connect to Your Database
&lt;/h3&gt;

&lt;p&gt;Now, let’s test the connection to ensure everything is working. Use the following command to connect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql &lt;span class="nt"&gt;-U&lt;/span&gt; myuser &lt;span class="nt"&gt;-d&lt;/span&gt; mydb &lt;span class="nt"&gt;-p&lt;/span&gt; 5432
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
❯ psql &lt;span class="nt"&gt;-U&lt;/span&gt; myuser &lt;span class="nt"&gt;-d&lt;/span&gt; mydb &lt;span class="nt"&gt;-p&lt;/span&gt; 5432

psql &lt;span class="o"&gt;(&lt;/span&gt;14.13 &lt;span class="o"&gt;(&lt;/span&gt;Homebrew&lt;span class="o"&gt;)&lt;/span&gt;, server 16.4 &lt;span class="o"&gt;(&lt;/span&gt;Homebrew&lt;span class="o"&gt;))&lt;/span&gt;
WARNING: psql major version 14, server major version 16.
         Some psql features might not work.
Type &lt;span class="s2"&gt;"help"&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;help.

&lt;span class="nv"&gt;mydb&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🛠️ Common Issues and Solutions
&lt;/h3&gt;

&lt;p&gt;1️⃣ Connection Refused&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cause: Firewall or incorrect &lt;code&gt;host.docker.internal&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Solution: Test with &lt;code&gt;127.0.0.1&lt;/code&gt; or check your Docker network 
settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2️⃣ Version Mismatch Warnings&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cause: Using an older &lt;code&gt;psql&lt;/code&gt; client.&lt;/li&gt;
&lt;li&gt;Solution: Update your client to match the server version.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎯 What’s Next?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔍 Explore your database.&lt;/li&gt;
&lt;li&gt;🛠️ Start building applications.&lt;/li&gt;
&lt;li&gt;⚙️ Configure your &lt;code&gt;DATABASE_URL&lt;/code&gt; with &lt;code&gt;host.docker.internal&lt;/code&gt; for Docker-based projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you’re ready to handle PostgreSQL on macOS like a pro! 🚀&lt;/p&gt;

&lt;p&gt;If you enjoyed this guide, don’t forget to share it with your fellow developers! 🧑‍💻👩‍💻&lt;/p&gt;

&lt;p&gt;Drop a comment below if you have questions or tips to add. Let’s make PostgreSQL configuration seamless for everyone! 🌟&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>postgres</category>
      <category>docker</category>
      <category>devops</category>
    </item>
    <item>
      <title>🏁Unleash the Full Power of Your Laptop on Linux 🚀</title>
      <dc:creator>kpndevroot</dc:creator>
      <pubDate>Thu, 22 Aug 2024 03:35:53 +0000</pubDate>
      <link>https://dev.to/kpndevroot/unleash-the-full-power-of-your-laptop-on-linux-5dpl</link>
      <guid>https://dev.to/kpndevroot/unleash-the-full-power-of-your-laptop-on-linux-5dpl</guid>
      <description>&lt;p&gt;Are you &lt;strong&gt;someone who prefers raw power over&lt;/strong&gt; battery life on your laptop? If you're tired of your system holding back to conserve energy, then this guide is for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Your Laptop Isn't Running at Full Speed
&lt;/h3&gt;

&lt;p&gt;Most Linux distributions default to the powersave CPU governor. This setting helps extend battery life and keep your laptop cool, but it also limits performance. If you're a power user who demands the maximum performance from your machine, you might find this setting a bit too conservative.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Switch to Performance Mode
&lt;/h2&gt;

&lt;p&gt;Ready to make your laptop roar? Here's how you can switch your CPU governor from powersave to performance mode.&lt;/p&gt;

&lt;p&gt;Step 1: Check Your Current CPU Governor&lt;/p&gt;

&lt;p&gt;First, let's see what mode your system is currently using. Open your terminal and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your output looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;powersave
powersave
powersave
powersave
.
.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You're in powersave mode.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Switch to Performance Mode
&lt;/h3&gt;

&lt;p&gt;To unlock the full potential of your CPU, switch to performance mode by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Verify the Change
&lt;/h3&gt;

&lt;p&gt;After switching, it's a good idea to confirm that the change took effect. Run the first command again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything went smoothly, you should now see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;performance
performance
performance
performance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Enjoy the Power
&lt;/h3&gt;

&lt;p&gt;Congratulations, you've successfully switched to performance mode! Your laptop is now running at full throttle. Enjoy the extra speed and power—just be mindful of the increased energy consumption and heat.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus Tip: Turbocharge Your Debian-Based Distro
&lt;/h3&gt;

&lt;p&gt;If you're using a Debian-based distro and want to take your system's performance to the next level, be sure to check out this awesome repo: &lt;a href="https://github.com/kpndevroot/linuxbooster" rel="noopener noreferrer"&gt;linuxbooster&lt;/a&gt;. It's packed with tools and tweaks to supercharge your Linux experience.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>developers</category>
      <category>codenewbie</category>
      <category>basic</category>
    </item>
  </channel>
</rss>
