<?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: John M. Kuria</title>
    <description>The latest articles on DEV Community by John M. Kuria (@jontech).</description>
    <link>https://dev.to/jontech</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4091989%2F3ac96d3e-507e-4e00-a018-2c9574153c40.jpg</url>
      <title>DEV Community: John M. Kuria</title>
      <link>https://dev.to/jontech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jontech"/>
    <language>en</language>
    <item>
      <title>From Zero to Hero on psql: My Weekend Adventure Installing PostgreSQL on WSL 🐧🐘</title>
      <dc:creator>John M. Kuria</dc:creator>
      <pubDate>Thu, 03 Sep 2026 16:50:55 +0000</pubDate>
      <link>https://dev.to/jontech/-from-zero-to-psql-my-weekend-adventure-installing-postgresql-on-wsl-53ki</link>
      <guid>https://dev.to/jontech/-from-zero-to-psql-my-weekend-adventure-installing-postgresql-on-wsl-53ki</guid>
      <description>&lt;p&gt;Hey folks! 👋&lt;/p&gt;

&lt;p&gt;So here's the deal — last weekend I decided I was &lt;em&gt;done&lt;/em&gt; fighting with database installers that never quite worked right on Windows. A senior dev friend of mine said, "just use WSL and run it like you're on a real Linux box," and honestly? Best advice I got all semester. So grab your coffee (or chai, no judgment ☕), and let's walk through this together, step by step, exactly how I did it.&lt;/p&gt;

&lt;p&gt;By the end of this post you'll have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WSL running Ubuntu on your Windows machine&lt;/li&gt;
&lt;li&gt;PostgreSQL installed and running&lt;/li&gt;
&lt;li&gt;Your very own database user created&lt;/li&gt;
&lt;li&gt;A clear understanding of that mysterious &lt;code&gt;postgres&lt;/code&gt; default user everyone talks about&lt;/li&gt;
&lt;li&gt;The ability to log into &lt;code&gt;psql&lt;/code&gt; like a pro&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's get into it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: What Even &lt;em&gt;Is&lt;/em&gt; WSL? (60-Second Explainer)
&lt;/h2&gt;

&lt;p&gt;WSL stands for &lt;strong&gt;Windows Subsystem for Linux&lt;/strong&gt;. It's basically Microsoft saying, "Hey, we know developers love Linux tools, so here's a real Linux kernel running right inside Windows — no dual boot, no clunky virtual machine, no drama."&lt;/p&gt;

&lt;p&gt;For anyone learning backend development, databases, or DevOps, this is &lt;em&gt;huge&lt;/em&gt;. Most real-world servers run Linux, so practicing in a Linux environment (even from your Windows laptop) is exactly the muscle memory you want to build.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Installing WSL
&lt;/h2&gt;

&lt;p&gt;This part is refreshingly simple these days. Microsoft made it a one-liner.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;PowerShell as Administrator&lt;/strong&gt;. (Right-click the Start button → "Terminal (Admin)" or search "PowerShell," right-click, "Run as administrator.")&lt;/li&gt;
&lt;li&gt;Type this magic incantation:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--install&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Hit Enter and let it do its thing. This installs WSL2 (the good version, with a full Linux kernel) along with &lt;strong&gt;Ubuntu&lt;/strong&gt; as the default distro.&lt;/li&gt;
&lt;li&gt;Restart your computer when prompted. Yes, actually restart it — don't be that person who skips the restart and wonders why nothing works. 😅&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once your machine boots back up, Ubuntu should launch automatically. If it doesn't, just search "Ubuntu" in your Start Menu and open it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First launch checklist:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It'll take a minute to finish setting up.&lt;/li&gt;
&lt;li&gt;You'll be asked to create a &lt;strong&gt;UNIX username and password&lt;/strong&gt;. This is your Ubuntu login — totally separate from your Windows account, and separate from PostgreSQL too (keep that in mind, it trips people up later).&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Pro tip:&lt;/strong&gt; Pick a username you'll remember and a password you can type without staring at your keyboard. You'll use &lt;code&gt;sudo&lt;/code&gt; a lot, and it'll ask for this password constantly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Verify everything installed correctly by running this in PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--list&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--verbose&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see Ubuntu listed with &lt;strong&gt;VERSION 2&lt;/strong&gt;. If you see version 1, don't panic — but it's worth upgrading (&lt;code&gt;wsl --set-version Ubuntu 2&lt;/code&gt;) since WSL2 is faster and more compatible.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Updating Ubuntu (Don't Skip This!)
&lt;/h2&gt;

&lt;p&gt;Inside your Ubuntu terminal, run:&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="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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This refreshes the package lists and updates existing software. Think of it as Ubuntu clearing its throat before doing real work. It might take a few minutes — perfect time to stretch or refill that coffee.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Installing PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Now for the main event. PostgreSQL is one of the most powerful, most respected open-source relational databases out there — used by companies from startups to giants like Instagram and Spotify.&lt;/p&gt;

&lt;p&gt;Install it with:&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="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;postgresql postgresql-contrib &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;postgresql&lt;/code&gt; is the core database engine.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;postgresql-contrib&lt;/code&gt; adds handy extra modules and extensions you'll likely want later (things like additional data types and functions).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once it's done installing, 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;&lt;span class="nb"&gt;sudo &lt;/span&gt;service postgresql start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And check that it's actually running:&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="nb"&gt;sudo &lt;/span&gt;service postgresql status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see something confirming it's active. If it's not running for any reason, &lt;code&gt;sudo service postgresql start&lt;/code&gt; will get it going.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Note for WSL users:&lt;/strong&gt; Unlike a real Linux server, PostgreSQL won't auto-start when you open a new WSL session — you'll need to run that &lt;code&gt;service postgresql start&lt;/code&gt; command each time you reopen your terminal (or set up a startup script, but that's a story for another day).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 5: Meet &lt;code&gt;postgres&lt;/code&gt; — The Default User Everyone's Confused About
&lt;/h2&gt;

&lt;p&gt;Here's where a lot of students get tripped up, so let's clear the fog. 🌫️&lt;/p&gt;

&lt;p&gt;When PostgreSQL installs, it automatically creates:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A &lt;strong&gt;Linux system user&lt;/strong&gt; called &lt;code&gt;postgres&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;PostgreSQL database role&lt;/strong&gt; also called &lt;code&gt;postgres&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This &lt;code&gt;postgres&lt;/code&gt; role is the &lt;strong&gt;superuser&lt;/strong&gt; of your database — it has full administrative rights over everything: creating databases, creating other users, deleting things, all of it. Think of it like the "root" or "admin" account of your PostgreSQL world.&lt;/p&gt;

&lt;p&gt;By default, PostgreSQL is set up so that &lt;strong&gt;only the Linux &lt;code&gt;postgres&lt;/code&gt; user can log in as the &lt;code&gt;postgres&lt;/code&gt; database role&lt;/strong&gt;, using something called "peer authentication" — basically, PostgreSQL checks "hey, is your Linux username the same as the database username you're trying to log in as?" If yes, you're in, no password needed (locally, at least).&lt;/p&gt;

&lt;p&gt;This is why you'll often see people typing this to get into the database for the first time:&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="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This switches you (temporarily) into the Linux &lt;code&gt;postgres&lt;/code&gt; user, which then lets you access the database &lt;code&gt;postgres&lt;/code&gt; role seamlessly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Logging Into &lt;code&gt;psql&lt;/code&gt; for the First Time
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;psql&lt;/code&gt; is PostgreSQL's command-line interface — your direct line of communication with the database engine. Let's log in.&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="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres
psql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything worked, your terminal prompt should now look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;postgres&lt;/span&gt;&lt;span class="o"&gt;=#&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;#&lt;/code&gt; symbol means you're logged in as a superuser. Congrats — you're officially inside PostgreSQL! 🎉&lt;/p&gt;

&lt;p&gt;To exit &lt;code&gt;psql&lt;/code&gt; at any time, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 7: Creating Your Own User (Because You Shouldn't Live as &lt;code&gt;postgres&lt;/code&gt; Forever)
&lt;/h2&gt;

&lt;p&gt;Working as the superuser for everything isn't great practice — even for personal projects. Let's create a proper user for yourself.&lt;/p&gt;

&lt;p&gt;While still logged into &lt;code&gt;psql&lt;/code&gt; as &lt;code&gt;postgres&lt;/code&gt;, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;student_dev&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;PASSWORD&lt;/span&gt; &lt;span class="s1"&gt;'yourStrongPassword123'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;student_dev&lt;/code&gt; with whatever username you like, and obviously pick a real password (not literally that one 😉).&lt;/p&gt;

&lt;p&gt;Want to give this user the ability to create their own databases too? Add that privilege:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;student_dev&lt;/span&gt; &lt;span class="k"&gt;CREATEDB&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's create a database owned by this new user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;student_dev_db&lt;/span&gt; &lt;span class="k"&gt;OWNER&lt;/span&gt; &lt;span class="n"&gt;student_dev&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exit &lt;code&gt;psql&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And exit back out of the &lt;code&gt;postgres&lt;/code&gt; Linux user:&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="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 8: Logging In as Your New User
&lt;/h2&gt;

&lt;p&gt;Now the moment of truth — let's log in as &lt;em&gt;you&lt;/em&gt;, not as the almighty &lt;code&gt;postgres&lt;/code&gt;.&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; student_dev &lt;span class="nt"&gt;-d&lt;/span&gt; student_dev_db &lt;span class="nt"&gt;-h&lt;/span&gt; localhost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what those flags mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-U&lt;/code&gt; → the username you want to log in as&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-d&lt;/code&gt; → the database you want to connect to&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-h localhost&lt;/code&gt; → connect over the network (even though it's local), which forces PostgreSQL to ask for a password instead of relying on peer authentication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enter the password you set earlier, and boom — you're in as your own user, scoped to your own database. This is the setup you'll actually want for real projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Recap Cheat Sheet 📝
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Install WSL + Ubuntu&lt;/td&gt;
&lt;td&gt;&lt;code&gt;wsl --install&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Update Ubuntu&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Install PostgreSQL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo apt install postgresql postgresql-contrib -y&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Start PostgreSQL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo service postgresql start&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Switch to postgres Linux user&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo -i -u postgres&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open psql&lt;/td&gt;
&lt;td&gt;&lt;code&gt;psql&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create new DB user&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CREATE USER name WITH PASSWORD 'pass';&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create new database&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CREATE DATABASE dbname OWNER name;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Log in as your user&lt;/td&gt;
&lt;td&gt;&lt;code&gt;psql -U name -d dbname -h localhost&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exit psql&lt;/td&gt;
&lt;td&gt;&lt;code&gt;\q&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Honestly, once I stopped fighting Windows-native installers and just leaned into WSL, everything clicked. It genuinely feels like working on a real Linux server — which, as a student prepping for internships and real-world dev work, is exactly the experience worth building.&lt;/p&gt;

&lt;p&gt;Next up on my list: connecting this PostgreSQL instance to a Node.js or Django app, and maybe exploring &lt;code&gt;pgAdmin&lt;/code&gt; for a GUI view of everything we just built by hand. If that sounds interesting, let me know and I'll write that one up next!&lt;/p&gt;

&lt;p&gt;Until then — happy querying! 🐘💻&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Got stuck somewhere or found a better way to do this? Drop a comment below — half the fun of learning this stuff is comparing notes with fellow students.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>postgres</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>First Interactions with Data Governance and Security</title>
      <dc:creator>John M. Kuria</dc:creator>
      <pubDate>Thu, 03 Sep 2026 16:48:49 +0000</pubDate>
      <link>https://dev.to/jontech/first-interactions-with-data-governance-and-security-103a</link>
      <guid>https://dev.to/jontech/first-interactions-with-data-governance-and-security-103a</guid>
      <description>&lt;h1&gt;
  
  
  Week 2, Day 1 - Data Governance and Security
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Month 1: Foundations of Data Engineering&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Week 2: Core Concepts&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Monday&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Before we get into it
&lt;/h2&gt;

&lt;p&gt;I need to say this out loud: I am genuinely relieved to be sitting down and taking notes instead of staring at a terminal today.&lt;/p&gt;

&lt;p&gt;Last week was a full week of installing things and immediately breaking them. WSL refused to start twice. Postgres wouldn't accept connections until we figured out that &lt;code&gt;pg_hba.conf&lt;/code&gt; was still set to &lt;code&gt;localhost&lt;/code&gt; only. Then there was the fun afternoon of changing permissions on database users because a query kept failing with a permission denied error that made no sense until someone pointed out the user had never been granted rights on the schema, only the database. By Friday my hands knew &lt;code&gt;sudo systemctl restart postgresql&lt;/code&gt; better than they knew my own phone number.&lt;/p&gt;

&lt;p&gt;So walking in today and being told "grab your notebook, no terminal needed" felt like a genuine reward. This is the first theoretical day of the program, and the topic is data governance and security. After a week of learning how databases actually get built and secured on a machine, it makes sense that today is about the rules and thinking behind why we secure them that way in the first place.&lt;/p&gt;




&lt;h2&gt;
  
  
  What we're covering today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What data governance actually is, and why it is not just a compliance buzzword&lt;/li&gt;
&lt;li&gt;The core pillars of governance: quality, cataloguing, lineage, stewardship&lt;/li&gt;
&lt;li&gt;Data security principles: the CIA triad, defense in depth, zero trust, privacy by design&lt;/li&gt;
&lt;li&gt;How data gets classified and managed across its lifecycle&lt;/li&gt;
&lt;li&gt;The big compliance frameworks: GDPR, HIPAA, PCI-DSS, and Kenya's PDPA&lt;/li&gt;
&lt;li&gt;Access control models and the principle of least privilege&lt;/li&gt;
&lt;li&gt;How governance, security, and compliance actually connect to each other&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. What is data governance, really?
&lt;/h2&gt;

&lt;p&gt;Data governance is the set of rules, policies, and processes that decide how data is collected, stored, used, and protected across an organization.&lt;/p&gt;

&lt;p&gt;Put simply, it answers questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who owns this data?&lt;/li&gt;
&lt;li&gt;Who is allowed to see it?&lt;/li&gt;
&lt;li&gt;How long do we keep it?&lt;/li&gt;
&lt;li&gt;How do we know it is accurate?&lt;/li&gt;
&lt;li&gt;Where did it come from?&lt;/li&gt;
&lt;li&gt;What happens if it gets misused or lost?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why this matters to me as a future data engineer
&lt;/h3&gt;

&lt;p&gt;Last week I was the one creating database users and deciding what privileges they got. That is access control in miniature. Multiply that by an entire company, with hundreds of tables, dozens of pipelines, and multiple teams, and you start to see why governance is not optional. If data goes missing or the wrong person sees something sensitive, there is a good chance a pipeline someone built is where it happened. That someone is eventually going to be me.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The four pillars of data governance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pillar&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Data quality&lt;/td&gt;
&lt;td&gt;Making sure data is accurate, complete, consistent, and current&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data cataloguing&lt;/td&gt;
&lt;td&gt;Keeping a record of what data exists, where it lives, and what it means&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data lineage&lt;/td&gt;
&lt;td&gt;Tracking where data came from and how it changed as it moved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data stewardship&lt;/td&gt;
&lt;td&gt;Assigning real people who are responsible for maintaining data standards&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A quick way I'm remembering this: quality is "is the data good," cataloguing is "do we know it exists," lineage is "do we know its history," and stewardship is "does someone actually own it." Without all four, a company ends up with three versions of the same customer and no idea which one is correct.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Data security: the technical backbone of governance
&lt;/h2&gt;

&lt;p&gt;If governance is the rulebook, security is what actually enforces it. Today we broke security down into a few core principles.&lt;/p&gt;

&lt;h3&gt;
  
  
  The CIA triad
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Confidentiality&lt;/strong&gt;: only the right people and systems can see the data. This is enforced through access controls, authentication, and encryption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrity&lt;/strong&gt;: data stays accurate and unaltered unless someone with permission changes it. Checksums, audit trails, and digital signatures help here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability&lt;/strong&gt;: data is there when it is needed. This is where backups, disaster recovery, and uptime planning come in.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Defense in depth
&lt;/h3&gt;

&lt;p&gt;This is the idea that you never rely on a single layer of protection. Instead you stack them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Physical security (secure data centers, restricted facility access)&lt;/li&gt;
&lt;li&gt;Network security (firewalls, VPNs, network segmentation)&lt;/li&gt;
&lt;li&gt;Application security (secure coding, input validation, authentication)&lt;/li&gt;
&lt;li&gt;Data security (encryption, classification, access permissions)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If one layer fails, the next one is still standing. It reminded me a lot of last week's &lt;code&gt;pg_hba.conf&lt;/code&gt; and &lt;code&gt;postgresql.conf&lt;/code&gt; split: one file controls how the server behaves, the other controls who is allowed through the door. Neither one alone is enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zero trust
&lt;/h3&gt;

&lt;p&gt;The mindset here is "never trust, always verify." No user or system gets automatic trust just because it is inside the network. Every request gets checked, every time. This usually shows up as multi-factor authentication, conditional access policies, and continuous monitoring rather than a single login at the start of the day.&lt;/p&gt;

&lt;h3&gt;
  
  
  Privacy by design
&lt;/h3&gt;

&lt;p&gt;Instead of bolting privacy on at the end, it gets built in from the start. The idea is that privacy should be the default setting, not something a user has to dig through menus to switch on.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Encryption: protecting data at rest and in transit
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;At rest&lt;/td&gt;
&lt;td&gt;Data sitting in storage&lt;/td&gt;
&lt;td&gt;Rows in a Postgres table, files in a bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In transit&lt;/td&gt;
&lt;td&gt;Data moving between systems&lt;/td&gt;
&lt;td&gt;An API response flowing into a pipeline&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All the major cloud platforms encrypt by default, but it is still on the data engineer to verify it and manage the keys correctly. That's where a Key Management Service (KMS) comes in: it is the system that creates, stores, and controls the encryption keys, basically the safe that holds the vault combination.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Access control and the principle of least privilege
&lt;/h2&gt;

&lt;p&gt;Access control decides who can do what with which data. The golden rule is the &lt;strong&gt;principle of least privilege&lt;/strong&gt;: give every person and system only the minimum access they need to do their job, nothing more.&lt;/p&gt;

&lt;p&gt;This one actually landed for me because of last week. When we created database users and had to explicitly &lt;code&gt;GRANT&lt;/code&gt; privileges on a schema before anything worked, that was least privilege in action. Nobody gets access by default. You earn it, deliberately, one grant at a time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common access control models
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;How it works&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;RBAC (Role-Based)&lt;/td&gt;
&lt;td&gt;Access is tied to a role&lt;/td&gt;
&lt;td&gt;All analysts get read-only access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ABAC (Attribute-Based)&lt;/td&gt;
&lt;td&gt;Access depends on attributes like department or location&lt;/td&gt;
&lt;td&gt;Only the Nairobi team can see Nairobi sales data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DAC (Discretionary)&lt;/td&gt;
&lt;td&gt;The data owner decides who gets access&lt;/td&gt;
&lt;td&gt;A team lead grants access to their own folder&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  6. Data classification and the data lifecycle
&lt;/h2&gt;

&lt;p&gt;Not all data carries the same risk, so it gets classified based on sensitivity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public&lt;/strong&gt;: no harm if disclosed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internal&lt;/strong&gt;: minor harm if disclosed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidential&lt;/strong&gt;: significant harm if disclosed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restricted&lt;/strong&gt;: severe harm if disclosed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is also classification by regulation, like Personally Identifiable Information (PII), Protected Health Information (PHI), and payment card data.&lt;/p&gt;

&lt;p&gt;Data also moves through a lifecycle, and governance applies differently at each stage:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Creation and collection&lt;/strong&gt;: define why the data is being collected and apply classification early&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Processing and use&lt;/strong&gt;: enforce access controls based on that classification&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage and retention&lt;/strong&gt;: keep it only as long as necessary, with appropriate security&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sharing and disposal&lt;/strong&gt;: assess risk before sharing, and dispose of it securely once it is no longer needed&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  7. Compliance frameworks
&lt;/h2&gt;

&lt;p&gt;Compliance is what makes governance and security legally enforceable. A few frameworks came up repeatedly today.&lt;/p&gt;

&lt;h3&gt;
  
  
  GDPR (General Data Protection Regulation)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Applies to anyone processing the personal data of EU citizens, regardless of where the company is based&lt;/li&gt;
&lt;li&gt;Effective since May 2018&lt;/li&gt;
&lt;li&gt;Grants rights like access, correction, erasure ("right to be forgotten"), and data portability&lt;/li&gt;
&lt;li&gt;Breaches must be reported within 72 hours&lt;/li&gt;
&lt;li&gt;Fines can reach 20 million euros or 4 percent of global annual revenue, whichever is higher&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  HIPAA (Health Insurance Portability and Accountability Act)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;US-only, and only applies to Protected Health Information (PHI)&lt;/li&gt;
&lt;li&gt;Built around three rules: Privacy, Security, and Breach Notification&lt;/li&gt;
&lt;li&gt;Requires administrative, physical, and technical safeguards&lt;/li&gt;
&lt;li&gt;Penalties can reach into the millions per year depending on severity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  PCI-DSS
&lt;/h3&gt;

&lt;p&gt;Global standard for anyone handling credit card data. It sets requirements around encryption, access control, and regular security testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  PDPA (Kenya's Data Protection Act, 2019)
&lt;/h3&gt;

&lt;p&gt;Since we are training in Kenya, this one is directly relevant. It mirrors a lot of GDPR's principles and is enforced by the Office of the Data Protection Commissioner (ODPC). Any system handling Kenyan citizens' personal data has to comply with it, which means it will realistically apply to a lot of what we build in this program.&lt;/p&gt;

&lt;h3&gt;
  
  
  A quick way to keep GDPR and HIPAA straight
&lt;/h3&gt;

&lt;p&gt;GDPR is the speed limit that applies everywhere you drive with an EU citizen in the car. HIPAA is the special rule that only applies inside the hospital parking lot. GDPR is broad and industry-agnostic. HIPAA is narrow and healthcare-specific.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. How governance, security, and compliance connect
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Data Governance
    -&amp;gt; defines the rules and policies for the data

Data Security
    -&amp;gt; implements the technical controls that enforce those rules

Compliance
    -&amp;gt; confirms those rules and controls meet legal requirements
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Governance is the rulebook. Security is the locks and guards. Compliance is the inspector checking the locks actually meet the law.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Key terms from today
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Data governance&lt;/td&gt;
&lt;td&gt;Rules and processes controlling how data is managed and used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data lineage&lt;/td&gt;
&lt;td&gt;A record of where data came from and how it changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data catalogue&lt;/td&gt;
&lt;td&gt;A directory of what data exists and what it means&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CIA triad&lt;/td&gt;
&lt;td&gt;Confidentiality, Integrity, Availability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense in depth&lt;/td&gt;
&lt;td&gt;Layered security controls across physical, network, application, and data layers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zero trust&lt;/td&gt;
&lt;td&gt;Never trust automatically, always verify every request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KMS&lt;/td&gt;
&lt;td&gt;Key Management Service, used to manage encryption keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Principle of least privilege&lt;/td&gt;
&lt;td&gt;Give the minimum access needed, nothing more&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RBAC&lt;/td&gt;
&lt;td&gt;Role-Based Access Control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GDPR&lt;/td&gt;
&lt;td&gt;EU regulation protecting personal data of EU citizens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HIPAA&lt;/td&gt;
&lt;td&gt;US regulation protecting patient health data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PDPA&lt;/td&gt;
&lt;td&gt;Kenya's Data Protection Act, 2019&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PCI-DSS&lt;/td&gt;
&lt;td&gt;Security standard for payment card data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Audit log&lt;/td&gt;
&lt;td&gt;A tamper-proof record of who accessed or changed data, and when&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  10. What I'm taking away from today
&lt;/h2&gt;

&lt;p&gt;Last week gave me the hands, this week is starting to give me the reasons. Every &lt;code&gt;GRANT&lt;/code&gt;, every edit to &lt;code&gt;pg_hba.conf&lt;/code&gt;, every password I set for a database user last week was actually a small act of governance and security without me fully realizing it at the time. Today just put labels on things I was already doing instinctively.&lt;/p&gt;

&lt;p&gt;Homework to myself tonight: go back through last week's terminal history and map each command to a concept from today. &lt;code&gt;CREATE USER&lt;/code&gt; and &lt;code&gt;GRANT&lt;/code&gt; are access control. Editing &lt;code&gt;postgresql.conf&lt;/code&gt; and &lt;code&gt;pg_hba.conf&lt;/code&gt; is defense in depth. Setting a password is confidentiality. It is all the same picture, just seen from two different angles this time.&lt;/p&gt;

&lt;p&gt;See you in the next class.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Notes by [Your Name] | Month 1, Foundations of Data Engineering | Week 2, Day 1&lt;/em&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>learning</category>
      <category>postgres</category>
      <category>security</category>
    </item>
    <item>
      <title>Data Engineering, Day 2: The Day the Terminal Stopped Feeling Like a Foreign Country</title>
      <dc:creator>John M. Kuria</dc:creator>
      <pubDate>Wed, 26 Aug 2026 07:57:04 +0000</pubDate>
      <link>https://dev.to/jontech/data-engineering-day-2-the-day-the-terminal-stopped-feeling-like-a-foreign-country-28df</link>
      <guid>https://dev.to/jontech/data-engineering-day-2-the-day-the-terminal-stopped-feeling-like-a-foreign-country-28df</guid>
      <description>&lt;p&gt;Day one was about learning to walk around the house. Day two was about actually turning the lights on and living in it.&lt;/p&gt;

&lt;p&gt;I won't lie — I came into class still tired from yesterday, still slightly proud of myself for typing &lt;code&gt;sudo&lt;/code&gt; correctly on the first try. And then day two happened, and it was a lot. Vim modes. A whole database engine. Remote connections. By the end of it my brain felt like a browser with forty tabs open. But it's the good kind of tired — the kind where you can actually feel yourself becoming someone who can do this job, one command at a time.&lt;/p&gt;

&lt;p&gt;Here's everything we covered, with the actual commands, because future-me is going to need to come back and re-read this more than once.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Logging Into the Server Remotely, Again — But It's Starting to Click
&lt;/h2&gt;

&lt;p&gt;We picked up right where day one left off: SSH-ing into our Ubuntu server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh username@server_ip_address
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yesterday this felt like magic I didn't fully trust. Today it just felt like... opening a door. That's the moment you know something is starting to sink in — when the "wow" wears off and it just becomes muscle memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Creating Our Own Linux User, Setting a Password, Switching Between Users
&lt;/h2&gt;

&lt;p&gt;Everyone in class created their own personal Linux user account on the server — no more sharing one login.&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="nb"&gt;sudo &lt;/span&gt;adduser myusername
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setting or resetting a password for that user:&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="nb"&gt;sudo &lt;/span&gt;passwd myusername
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then the part that actually made the concept of "users" feel real — switching between accounts on the same machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;su - myusername
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typing &lt;code&gt;su - anotheruser&lt;/code&gt; and suddenly being &lt;em&gt;that&lt;/em&gt; person, with their own home directory and their own permissions, made something click. A server isn't one identity. It's a shared space with clearly separated rooms, and Linux is very serious about who's allowed in which room.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Meeting Vim (And Immediately Getting Humbled By It)
&lt;/h2&gt;

&lt;p&gt;If you've never used Vim before, the first thing that happens is panic. You open a file, try to type, nothing happens, and you briefly wonder if you've broken the server. You haven't. You just don't know the modes yet.&lt;/p&gt;

&lt;p&gt;Opening a file in Vim:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim myfile.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Four Modes We Learned
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Normal mode&lt;/strong&gt; — this is where you land the moment Vim opens. You're not typing text here; you're &lt;em&gt;navigating and issuing commands&lt;/em&gt;. Pressing letters like &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt; moves the cursor. This is the default, home-base mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insert mode&lt;/strong&gt; — this is where actual typing happens. You get here by pressing:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;from Normal mode. Once you're in Insert mode, you type like you would in any normal text editor. You get back to Normal mode by pressing &lt;code&gt;Esc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visual mode&lt;/strong&gt; — for selecting text, the way you'd click-and-drag with a mouse anywhere else. Entered with:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;From there, moving the cursor highlights text, which you can then delete, copy, or edit as a block.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command-line mode&lt;/strong&gt; — this is where the real power lives: saving, quitting, searching, and replacing. Entered by pressing &lt;code&gt;:&lt;/code&gt; from Normal mode, which drops a colon prompt at the bottom of the screen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Saving and Exiting (The Command Everyone Googles at Least Once)
&lt;/h3&gt;

&lt;p&gt;From Normal mode, pressing &lt;code&gt;:&lt;/code&gt; and then typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;w&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;saves the file. Typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;q&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;quits Vim. And the one everyone actually needs on day one — save &lt;em&gt;and&lt;/em&gt; quit in one motion:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;wq&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've made a mess and just want out without saving anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;q&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last one saved me today. No shame in it.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Basic Linux Navigation Commands, Practiced Until They Felt Boring (In a Good Way)
&lt;/h2&gt;

&lt;p&gt;We drilled the fundamentals again, and repetition is genuinely making them automatic now:&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="nb"&gt;ls&lt;/span&gt;          &lt;span class="c"&gt;# list what's in the current folder&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;projects &lt;span class="c"&gt;# move into the "projects" folder&lt;/span&gt;
&lt;span class="nb"&gt;pwd&lt;/span&gt;         &lt;span class="c"&gt;# print exactly where you are right now&lt;/span&gt;
&lt;span class="nb"&gt;mkdir &lt;/span&gt;data  &lt;span class="c"&gt;# create a new folder called "data"&lt;/span&gt;
&lt;span class="nb"&gt;touch &lt;/span&gt;notes.txt   &lt;span class="c"&gt;# create a new, empty file&lt;/span&gt;
&lt;span class="nb"&gt;cat &lt;/span&gt;notes.txt     &lt;span class="c"&gt;# print the contents of a file to the screen&lt;/span&gt;
&lt;span class="nb"&gt;whoami&lt;/span&gt;      &lt;span class="c"&gt;# confirm which user you're currently logged in as&lt;/span&gt;
clear       &lt;span class="c"&gt;# wipe the terminal screen&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update    &lt;span class="c"&gt;# run a command with administrator privileges&lt;/span&gt;
su - anotheruser   &lt;span class="c"&gt;# switch to a different user account&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small, unglamorous commands. But every single one of them showed up again later in the day, embedded inside bigger tasks — which is exactly when you realize why the fundamentals matter so much.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Installing PostgreSQL and Checking That It's Actually Running
&lt;/h2&gt;

&lt;p&gt;This is where the day shifted from "operating system basics" into genuinely feeling like data engineering.&lt;/p&gt;

&lt;p&gt;Installing PostgreSQL on the Ubuntu server:&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="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;postgresql postgresql-contrib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checking whether the service is actually running:&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="nb"&gt;sudo &lt;/span&gt;systemctl status postgresql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Watching that status come back "active (running)" for the first time felt disproportionately exciting for something so small. But it was the first real database engine I've ever installed with my own hands, not a hosted service someone else set up for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Controlling the PostgreSQL Service with systemctl
&lt;/h2&gt;

&lt;p&gt;We learned the full lifecycle of managing the service, not just turning it on and hoping for the best:&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="nb"&gt;sudo &lt;/span&gt;systemctl start postgresql     &lt;span class="c"&gt;# start the service&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl stop postgresql      &lt;span class="c"&gt;# stop the service&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart postgresql   &lt;span class="c"&gt;# restart the service (needed after config changes)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status postgresql    &lt;span class="c"&gt;# check current status&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;restart&lt;/code&gt; became the command I'd use most, since almost every configuration change later in the day required PostgreSQL to reload before it would take effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Creating a Database, a Database User, and a Password
&lt;/h2&gt;

&lt;p&gt;First, we switched into the built-in &lt;code&gt;postgres&lt;/code&gt; system account, which has admin rights inside PostgreSQL itself:&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="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres
psql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From inside the &lt;code&gt;psql&lt;/code&gt; prompt, we created a new database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;mydatabase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then a new database user, with a password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;myuser&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="k"&gt;ENCRYPTED&lt;/span&gt; &lt;span class="n"&gt;PASSWORD&lt;/span&gt; &lt;span class="s1"&gt;'mypassword'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And gave that user full rights over the database we just created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;mydatabase&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;myuser&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's a genuine sense of ownership that comes from typing &lt;code&gt;CREATE DATABASE&lt;/code&gt; and having it just... exist. Something I've queried a hundred times from the outside, and today I built one from the inside.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Getting to Know the Configuration Files: postgresql.conf and pg_hba.conf
&lt;/h2&gt;

&lt;p&gt;This is the part that felt the most "real" — the two files that quietly control everything about how PostgreSQL behaves and who's allowed to talk to it.&lt;/p&gt;

&lt;p&gt;Opening the main configuration file with Vim:&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="nb"&gt;sudo &lt;/span&gt;vim /etc/postgresql/&lt;span class="k"&gt;*&lt;/span&gt;/main/postgresql.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside, the key setting we needed was &lt;code&gt;listen_addresses&lt;/code&gt;, which controls which network interfaces PostgreSQL accepts connections on. By default it's often locked to &lt;code&gt;localhost&lt;/code&gt;, meaning nothing outside the server itself can reach it. We changed it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="py"&gt;listen_addresses&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the client authentication file, which controls &lt;em&gt;who&lt;/em&gt; is allowed to connect and &lt;em&gt;how&lt;/em&gt;:&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="nb"&gt;sudo &lt;/span&gt;vim /etc/postgresql/&lt;span class="k"&gt;*&lt;/span&gt;/main/pg_hba.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we added a line allowing remote connections from outside the server, authenticated with a password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;host&lt;/span&gt;    &lt;span class="n"&gt;all&lt;/span&gt;             &lt;span class="n"&gt;all&lt;/span&gt;             &lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;/&lt;span class="m"&gt;0&lt;/span&gt;               &lt;span class="n"&gt;md5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Editing these two files back to back really underlined the point our instructor kept making: &lt;code&gt;postgresql.conf&lt;/code&gt; controls &lt;em&gt;how the server behaves&lt;/em&gt;, and &lt;code&gt;pg_hba.conf&lt;/code&gt; controls &lt;em&gt;who's allowed through the door&lt;/em&gt;. Two very different jobs, two very different files.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Restarting PostgreSQL So the Changes Actually Took Effect
&lt;/h2&gt;

&lt;p&gt;None of those edits do anything until the service reloads:&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="nb"&gt;sudo &lt;/span&gt;systemctl restart postgresql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the step it's easy to forget in the moment — you edit a config file, feel accomplished, and then wonder why nothing changed. Nothing changes until you restart the service.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Connecting Remotely with DBeaver and Power BI
&lt;/h2&gt;

&lt;p&gt;This was the payoff for the entire day. After all the SSH, Vim, and config file editing, we opened DBeaver on our own laptops and connected straight into the PostgreSQL database sitting on the remote Ubuntu server — using the database name, username, and password we'd created ourselves earlier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;server_ip_address&lt;/span&gt;
&lt;span class="na"&gt;Port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5432&lt;/span&gt;
&lt;span class="na"&gt;Database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mydatabase&lt;/span&gt;
&lt;span class="na"&gt;Username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myuser&lt;/span&gt;
&lt;span class="na"&gt;Password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mypassword&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we plugged the exact same connection details into Power BI, pulling that same PostgreSQL database in as a live data source.&lt;/p&gt;

&lt;p&gt;Seeing our own database — one we built from an empty terminal, line by line — show up as a connectable data source in a tool like Power BI was the moment the whole day clicked into place. It wasn't abstract anymore. It was infrastructure we'd actually built, being used the way real infrastructure gets used.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'm Taking Away From Today
&lt;/h2&gt;

&lt;p&gt;Yesterday was about learning to move around a Linux system. Today was about realizing that Linux is just the floor you stand on to build the things that actually matter — like a working database that other tools can plug into.&lt;/p&gt;

&lt;p&gt;The instructor's closing note stuck with me: these fundamentals aren't a box to check once and move on from. Vim, navigation commands, PostgreSQL users and databases, &lt;code&gt;pg_hba.conf&lt;/code&gt;, &lt;code&gt;postgresql.conf&lt;/code&gt; — we're going to be living inside these for the rest of the program.&lt;/p&gt;

&lt;p&gt;So tonight's homework to myself is simple: open Vim again, on purpose, just to practice switching modes until &lt;code&gt;:wq&lt;/code&gt; stops feeling like a spell I'm reciting from memory and starts feeling like my own handwriting.&lt;/p&gt;

&lt;p&gt;See you in the next class.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cli</category>
      <category>dataengineering</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
