commit 5e95975af4aead76aa0fb63a08c7eeab6420a0aa Author: mrkmntal Date: Fri Oct 31 19:43:56 2025 -0400 Initial Commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..ac3e3fc --- /dev/null +++ b/README.md @@ -0,0 +1,173 @@ +# 🧠 Software-Blogs — A Lightweight, Transparent PHP Blog System + +**Software-Blogs** is a minimal, self-hosted PHP blog framework designed for technical writers and developers who value simplicity, transparency, and total control over their stack. + +Each post is its own self-contained directory with its own SQLite comment database, while shared logic like the comment system lives in modular PHP files that are dynamically included at runtime. + +This setup embraces the UNIX-style philosophy: + +> “Do one thing well. Then link it dynamically.” + +--- + +## 🚀 Features + +* **Per-post isolation:** each post directory has its own `index.php` and `comments.db`. +* **Modular comment system:** all comment logic is centralized in `/modules/comments.php`. +* **Zero external dependencies:** uses built-in PHP + SQLite only. +* **LAN-aware admin system:** restricts comment deletion to your local or ISP IP range. +* **Clean mentalnet.xyz-style dark theme ready for embedding.** +* **Perfect for personal dev blogs, technical essays, or transparent documentation.** + +--- + +## 🧩 Directory Structure + +``` +software-blogs/ +├── modules/ +│ ├── comments.php # Shared comment system +├── opensource-future/ +│ ├── index.php +│ └── comments.db +├── dephell/ +│ ├── index.php +│ └── comments.db +``` + +Each post is completely portable — move its folder anywhere and it will still work. + +--- + +## ⚙️ How It Works + +When you load a post, the page dynamically imports the core module: + +```php + +``` + +That module: + +1. Initializes or creates a `comments.db` SQLite database in the same directory. +2. Handles POST requests for new comments and admin deletions. +3. Exposes variables like `$comments`, `$error`, and `$is_admin` to the main page. +4. Is not usable standalone — it’s meant to be dynamically linked, not directly served. + +Think of it like dynamic linking in compiled languages: + +* `index.php` is the binary. +* `modules/comments.php` is your shared library. +* PHP’s `require_once()` is your runtime linker. + +--- + +## 💬 Comment System Overview + +Each post maintains its own `comments.db` schema: + +```sql +CREATE TABLE IF NOT EXISTS comments ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + comment TEXT NOT NULL, + ip TEXT NOT NULL, + date TEXT NOT NULL +); +``` + +Key details: + +* Max comment length: **250 characters** (configurable). +* One comment per IP or name — prevents spam flood. +* Admin access is determined by IP pattern (`192.168.86.*` by default). +* Comments are stored locally; no external services or trackers. + +--- + +## 🛠️ Setup + +1. Clone or copy this repo into your web root: + + ```bash + git clone https://github.com/youruser/software-blogs.git /var/www/html/blog + ``` + +2. Ensure PHP has SQLite enabled: + + ```bash + php -m | grep sqlite + ``` + +3. Make post directories writable for SQLite and make sure they are owned by the correct webuser running your server: + + ```bash + chmod 755 -R /var/www/html/blog + chown -R www-data:www-data /var/www/html/blog + ``` + +4. Visit your post at `http://your-ip/blog/dephell/`. + + You’ll see your article, comments section, and dynamic SQLite comments instantly. + +--- + +## 🌐 Hosting Context + +This project assumes you’re running it: + +* On your **ISP-assigned public IP** (e.g. a home server or self-hosted VPS), or +* Within a **LAN environment** accessible via IP (e.g. 192.168.x.x). + +The admin check uses simple IP prefix matching for maintainability — intentionally lightweight and transparent. +If you host publicly, **change the IPs in `modules/comments.php`** to your static or dynamic DNS IP range. + +This design trades enterprise-grade auth for simplicity and control — a deliberate choice for personal or small-scale tech blogs. + +--- + +## 🧱 Adding a New Blog Post + +1. Copy an existing post folder: + + ```bash + cp -r dephell new_article + ``` + +2. Edit `new_article/index.php` and replace the content section. + +3. Access it via `http://your-ip/blog/new_article/`. + +A new `comments.db` will be generated automatically when someone comments. + +--- + + +## 🔒 Security Note + +This system is designed for **simplicity and transparency**, not for multi-user or high-traffic production setups. + +If you expose it to the public internet: + +* Always restrict admin deletion to your IP. +* Keep directory permissions strict. +* Consider placing `/modules/` outside your web root or use `.htaccess` to block direct access. + +--- + +## 📜 License + +MIT License — open and educational. +Feel free to fork, remix, and host your own “transparent blog” setup. + +--- + +## 🧠 Philosophy + +Software-Blogs isn’t about convenience — it’s about *understanding*. +Each post is a living, self-contained artifact. +You can open it, read it, and **see how it works**. + +If you’re tired of opaque CMS systems and bloated blogging platforms, this setup gives you something more honest — a blog where you can see every moving part, line by line. + +> “Abstractions rot. Understanding scales.” diff --git a/dephell/bringitonapt.jpg b/dephell/bringitonapt.jpg new file mode 100644 index 0000000..906a04d Binary files /dev/null and b/dephell/bringitonapt.jpg differ diff --git a/dephell/comments.db b/dephell/comments.db new file mode 100644 index 0000000..f91bdff Binary files /dev/null and b/dephell/comments.db differ diff --git a/dephell/index.php b/dephell/index.php new file mode 100644 index 0000000..77be68e --- /dev/null +++ b/dephell/index.php @@ -0,0 +1,157 @@ + + + + + + + +MentalNet.xyz Blog | Dependency Hell and the Mirror Test + + + + + + +

Dependency Hell and the Mirror Test

+
+ Debian Osaka Bring It On APT +
+

Published October 31 2025 on MentalNet.xyz

+ +
+

Every developer dreams of clean installs, smooth dependency trees, and stable builds — until one day, apt decides to summon the flames of dependency hell. That’s when you realize the real bug isn’t in the system — it’s in your assumptions.

+ +

This is the story of a looping dpkg install — and the realization that sometimes the only way out of dependency hell is to look in the mirror and ask, “What did I make, and how did I mess up?”

+
+ +

The Fire Starts Small

+

It began with a metapackage called live-update, meant to pull in the latest components of my system. It depended on small helper packages — things like mysql-binlog-cfg and proxyconfig — which only ran setup scripts. They didn’t install any files.

+ +

dpkg saw that and said, “Well, you installed nothing, so you don’t exist.” Then apt tried to reinstall them, forever. A perfect feedback loop of install → vanish → reinstall → vanish. It wasn’t broken — it was just doing exactly what I told it to do.

+ +

The Mirror Test

+

The moment of truth comes when you stop blaming apt and start realizing you built the dependency furnace yourself. The fix was surprisingly humble: drop a tiny marker file like /usr/share/mysql-binlog-cfg/marker.txt. Suddenly, dpkg has something real to hold onto.

+ +

But it also made me think about how easily we build fragile systems just because we don’t fully understand what’s under the hood. We stack abstractions until we forget what we’re orchestrating.

+ +

Facing the Flames

+

Modern development culture tries to avoid these lessons. Everything gets containerized, abstracted, and outsourced to layers that promise safety. But abstraction without understanding is just dependency hell waiting for a trigger.

+ +

When you face problems like this, you learn more than you ever could hiding behind a container runtime. You start designing systems that leverage their foundation instead of avoiding it. That’s what makes an ecosystem strong — not escaping the heat, but learning to harness it.

+ +

Bring It On, APT

+

So yeah — I’ll take dependency hell any day over blind abstraction. Because when you finally stare into the dpkg logs and see what’s actually happening, you gain something most engineers never do: understanding. Real control. And a bit of pride in the flames you tamed.

+ +

Bring it on, APT.

+ +
+

Comments

+ + +
+ + +
+ + + + +
+ + +
+ +
+ + +
+ + + + Delete + +

+
+ + + + + diff --git a/modules/comments.db b/modules/comments.db new file mode 100644 index 0000000..230267a Binary files /dev/null and b/modules/comments.db differ diff --git a/modules/comments.php b/modules/comments.php new file mode 100644 index 0000000..7fa16b8 --- /dev/null +++ b/modules/comments.php @@ -0,0 +1,61 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +$db->exec("CREATE TABLE IF NOT EXISTS comments ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + comment TEXT NOT NULL, + ip TEXT NOT NULL, + date TEXT NOT NULL +)"); + +$error = ''; +$ip = $_SERVER['REMOTE_ADDR']; +$is_admin = false; +foreach ($ADMIN_IP_PREFIXES as $prefix) { + if (str_starts_with($ip, $prefix)) { $is_admin = true; break; } +} + +// Handle deletions +if (isset($_GET['delete']) && $is_admin) { + $del_id = intval($_GET['delete']); + $stmt = $db->prepare("DELETE FROM comments WHERE id = ?"); + $stmt->execute([$del_id]); + header("Location: " . strtok($_SERVER["REQUEST_URI"], '?')); + exit; +} + +// Handle new comments +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $name = trim($_POST['name']); + $comment = trim($_POST['comment']); + + if (strlen($comment) > $COMMENT_MAX_LENGTH) { + $error = "Whoa there, sysadmin — keep it under $COMMENT_MAX_LENGTH characters!"; + } elseif ($name && $comment) { + $check = $db->prepare("SELECT COUNT(*) FROM comments WHERE ip = ? OR name = ?"); + $check->execute([$ip, $name]); + if ($check->fetchColumn() > 0) { + $error = "One post per person — let other engineers join the thread."; + } else { + $stmt = $db->prepare("INSERT INTO comments (name, comment, ip, date) VALUES (?, ?, ?, datetime('now','localtime'))"); + $stmt->execute([$name, $comment, $ip]); + header("Location: " . $_SERVER['REQUEST_URI']); + exit; + } + } +} + +// Fetch existing comments +$comments = $db->query("SELECT * FROM comments ORDER BY id DESC")->fetchAll(PDO::FETCH_ASSOC); +?> + diff --git a/opensource-future/comments.db b/opensource-future/comments.db new file mode 100644 index 0000000..163233c Binary files /dev/null and b/opensource-future/comments.db differ diff --git a/opensource-future/index.php b/opensource-future/index.php new file mode 100644 index 0000000..fe08865 --- /dev/null +++ b/opensource-future/index.php @@ -0,0 +1,187 @@ + + + + + + +MentalNet.xyz Blog | When Freedom Lives in the Shadows + + + + + + +

When Freedom Lives in the Shadows

+
+ Debian Osaka Comic +
+

Published October 30 2025 on MentalNet.xyz

+ +
+

Every few months, someone declares that open source is dying. They point to burnout, unpaid maintainers, or corporate interference. But listen closer — what they really mean is, “I wish open source would stop making me feel responsible.” Because true openness forces participation, and participation means accountability.

+ +

Most of these critics don’t hate open source — they just want it to behave like a product. They want Linux to be a frictionless, pretty front end for their gaming rigs. They want a distro that never asks them a question. They want freedom without understanding.

+ +

But open source was never about comfort. It’s about curiosity, discovery, and sometimes chaos. That’s where the real magic happens — not in polished GUIs, but in that moment when you break something, stare at the logs, and realize you actually get it now.

+
+ +

Flatpaks, Abstractions, and the Death of Craft

+

The Flatpak era symbolizes something deeper — a shift from curiosity to avoidance. Developers say “it’s not our job to package for Debian,” and users applaud because they think it means less work. But every layer of abstraction is also a layer of lost understanding. You don’t solve problems anymore — you containerize them.

+ +

Reading logs, tracing dependencies, debugging services — those used to be rites of passage. Now they’re treated as eccentric hobbies. The person who still reads man pages is the odd one out, even though they’re the one keeping the system alive.

+ +

Projects that make those tasks easier — like tools that help you build .deb packages or visualize dependencies — get labeled as “overkill.” But they’re not. They’re bridges between developers and maintainers. They make creation more transparent. And transparency, in computing, is freedom.

+ +
+A small act of curiosity can ripple across projects. +When I was experimenting with OpenBSD in a VM, I noticed that oh-my-bash’s alias for mkdir -pv didn’t work, because BSD’s mkdir doesn’t support -v. +I reported it in Issue #351, and maintainer @akinomyoga implemented a smarter, cross-platform detection function that checks for -v before applying the alias. +That single change turned a failing command into a robust, portable one — and now the project cites that issue as part of its ongoing work to keep BSD compatibility intact. +Moments like that show what open source is really about: not grand rewrites or flashy announcements, but dozens of quiet, thoughtful fixes that make the ecosystem stronger. +
+ +

Two Kinds of Hackers

+

This split starts long before anyone touches production code. It starts in high school.

+ +

One kid decides to major in computer science because it’s a “stable, well-paying job.” They hear about frameworks, APIs, and tech stacks. It all sounds safe, predictable, structured.

+ +

The other kid finds an old laptop with a broken hard drive. They have no money. So they grab a USB stick, download a Linux ISO, and boot into a live system. That’s how they learn. When the bootloader fails, they learn what GRUB is. When the installer can’t see the drive, they learn about partitions. They don’t study computing — they live it.

+ +

And that difference never fades. The first person learns to depend on platforms. The second learns to depend on themselves. One panics when something breaks; the other leans in and says, “Okay, let’s see what happened.” That’s the essence of the open-source spirit — curiosity in the face of chaos.

+ +

The Creative Trance

+

There’s something spiritual about coding in that “trance” — when you’re just you and the machine, iterating, testing, feeling your way forward. It’s like a conversation between two minds, one silicon and one human. Mistakes don’t feel like failures; they’re just feedback. You stop fearing them and start learning from them.

+ +

People who only work within pre-defined frameworks will never understand that flow. They see it as messy, unstructured, inefficient. But that’s how discovery works. Real breakthroughs rarely come from polished corporate environments — they come from experimentation, from intuition, from those long nights where something finally clicks because you stopped overthinking and started building.

+ +

Freedom Doesn’t Die in Darkness — It Survives There

+

People love to say “freedom dies in darkness,” but in the open-source world, that’s exactly where it lives. It’s in the basements, the IRC servers still humming at 2 a.m., the Git repos maintained by one dedicated person who just loves making things work. It’s in the communities that don’t care about hype — only about code that runs clean and honest.

+ +

Freedom doesn’t need a marketing department. It doesn’t need polish. It just needs people willing to keep learning when everyone else decides it’s not worth the effort.

+ +

So when someone says open source is dying, they’re really just admitting they’ve stopped looking for it. It’s not dead — it’s underground, alive, and whispering to those who still care enough to listen.

+ +

That’s where the real hackers live — not in boardrooms, not in app stores, but in that quiet, flickering glow of a terminal screen. And that’s where freedom still burns.

+ +
+

Comments

+ + +
+ + +
+ + + + +
+ + +
+ +
+ + +
+ + + + Delete + +

+
+ + + + +