<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://pockettheories.com/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://pockettheories.com/dokuwiki/feed.php">
        <title>Pocket Theories</title>
        <description></description>
        <link>http://pockettheories.com/dokuwiki/</link>
        <image rdf:resource="http://pockettheories.com/dokuwiki/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-07T14:41:16+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=aiml&amp;rev=1766299604&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=amazoncomputerhardwareandelectronics&amp;rev=1766326448&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=ansible&amp;rev=1772388878&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=aws&amp;rev=1772393698&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=bash&amp;rev=1772393176&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=bind&amp;rev=1773679848&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=diff&amp;rev=1772392968&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=docker&amp;rev=1777279804&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=dokuwiki&amp;rev=1762883852&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=eventmachine&amp;rev=1775291232&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=gcp&amp;rev=1772393254&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=git&amp;rev=1777745590&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=grafana&amp;rev=1765116922&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=httpd&amp;rev=1772388750&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=installing_dokuwiki_on_32-bit_debian&amp;rev=1762884456&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=interesting202604&amp;rev=1776804018&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=java&amp;rev=1772392844&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=javascript&amp;rev=1772392618&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=kaminari&amp;rev=1773475406&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=keepalive&amp;rev=1773688858&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=linux&amp;rev=1777738300&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=lxc&amp;rev=1777738418&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=mail&amp;rev=1773681152&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=mongodb&amp;rev=1765645072&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=nginx&amp;rev=1772389766&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=oldtech&amp;rev=1766323266&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=openssl&amp;rev=1772389704&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=powershell&amp;rev=1776506160&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=python&amp;rev=1777654092&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=railties&amp;rev=1773480176&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=ransack&amp;rev=1773477356&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=rsync&amp;rev=1772389310&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=ruby&amp;rev=1776625154&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=samba&amp;rev=1765106876&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=slackbotwithbolt&amp;rev=1777654388&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=start&amp;rev=1776503828&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=vim&amp;rev=1766219474&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=vnc&amp;rev=1765054904&amp;do=diff"/>
                <rdf:li rdf:resource="http://pockettheories.com/dokuwiki/doku.php?id=windows&amp;rev=1772397968&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://pockettheories.com/dokuwiki/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Pocket Theories</title>
        <link>http://pockettheories.com/dokuwiki/</link>
        <url>http://pockettheories.com/dokuwiki/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=aiml&amp;rev=1766299604&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-21T06:46:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>aiml</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=aiml&amp;rev=1766299604&amp;do=diff</link>
        <description>Artificial Intelligence / Machine LEarning

TODO (Piper text-to-speech, Ollama, ComfyUI, OpenWebUI, n8n)

YouTube videos:

	*  All Machine Learning algorithms explained in 17 minutes, by Infinite Codes
	*  How to predict the future with Python (forecasting tutorial), by Dave Ebbelaar</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=amazoncomputerhardwareandelectronics&amp;rev=1766326448&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-21T14:14:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>amazoncomputerhardwareandelectronics</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=amazoncomputerhardwareandelectronics&amp;rev=1766326448&amp;do=diff</link>
        <description>Amazon Computers and Electronics

Amazon India

	*  Ambrane USB type-A to type-C 1.5m braided cable for INR.149 (2025-12-21)
	*  Portronics USB type-A to type-C 1.2m braided cable for INR.119 (2025-12-21)
	*  Ambrane USB type-C to type-C 1.5m braided cable for INR.149 (2025-12-21)
	*  Ambrane 65W charger 2x USB-C, 1x USB-A for INR.1,899 (2025-12-21)
	*  Ambrane 65W Charger 2xUSB-C, 2xUSB-A, 2xAC 1m for INR.1,999

Amazon UAE

	*  NiPoGi Mini PC - 7430U CPU, 16GB RAM, 512GB SATA M2 SSD, Windows 11…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=ansible&amp;rev=1772388878&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T18:14:38+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>ansible</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=ansible&amp;rev=1772388878&amp;do=diff</link>
        <description>Ansible

Installing

RHEL has ansible-core, podman, and ansible-navigator in the OS repositories.

Ubuntu needs a PPA:


sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible -y


It can also be installed with Python


sudo apt install python3-pip -y
pip3 install ansible</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=aws&amp;rev=1772393698&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T19:34:58+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>aws</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=aws&amp;rev=1772393698&amp;do=diff</link>
        <description>AWS

Fetching EC2 Metadata


TOKEN=`curl -X PUT &quot;http://169.254.169.254/latest/api/token&quot; -H &quot;X-aws-ec2-metadata-token-ttl-seconds: 21600&quot;` &amp;&amp; curl -s -H &quot;X-aws-ec2-metadata-token: $TOKEN&quot; http://169.254.169.254/latest/meta-data      



The above will give you the metadata fields that are available - append to the</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=bash&amp;rev=1772393176&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T19:26:16+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>bash</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=bash&amp;rev=1772393176&amp;do=diff</link>
        <description>bash

untilfail script

Repeatedly run a command until failure (source)


#!/bin/bash
while &quot;$@&quot;; do :; done</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=bind&amp;rev=1773679848&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-16T16:50:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>bind</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=bind&amp;rev=1773679848&amp;do=diff</link>
        <description>Minimal Config

/etc/named.conf


options {
  directory &quot;/var/cache/bind&quot;;
  dnssec-validation auto;
  listen-on-v6 { any; };

#  allow-query { any; };
#  allow-recursion { any; };
#  forwarders { 1.1.1.1; };
};

zone &quot;example.local&quot; {
  type master;
  file &quot;/etc/bind/db.example_local&quot;;
};</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=diff&amp;rev=1772392968&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T19:22:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>diff</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=diff&amp;rev=1772392968&amp;do=diff</link>
        <description>diff


diff -u file1.txt file2.txt &gt; file2.patch  # &quot;-u&quot; is for a unified diff format
patch -l file2.txt file2.patch  # &quot;-l&quot; is to ignore whitespace differences


Diff can ignore whitespaces with “-w”.</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=docker&amp;rev=1777279804&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-27T08:50:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>docker</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=docker&amp;rev=1777279804&amp;do=diff</link>
        <description>Installing

Debian


apt update
apt remove docker docker-engine docker.io containerd runc
apt install -y apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo &quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable&quot; | tee /etc/apt/sources.list.d/docker.l…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=dokuwiki&amp;rev=1762883852&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-11T17:57:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>dokuwiki</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=dokuwiki&amp;rev=1762883852&amp;do=diff</link>
        <description>*  Installing DokuWiki on 32-bit Debian</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=eventmachine&amp;rev=1775291232&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-04T08:27:12+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>eventmachine</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=eventmachine&amp;rev=1775291232&amp;do=diff</link>
        <description>Basic usage of the Event Machine for TCP servers


require &#039;eventmachine&#039;

module MyServer
  def post_init
  end
  
  def receive_data(data)
    # For long-running operations, run in a separate thread
    #EM.defer do
    #  EM.next_tick {}
    #end
    
    # To end the connection
    #close_connection_after_writing()
  end
  
  def unbind
  end
end

EM.run do
  EM.start_server hostname, port, MyServer
end</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=gcp&amp;rev=1772393254&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T19:27:34+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>gcp</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=gcp&amp;rev=1772393254&amp;do=diff</link>
        <description>GCP

GKE


# Prerequisites:
# Create the GKE cluster with autopilot
# Create the Artifact Registry / Repository for storing container images

brew install google-cloud-sdk
gcloud init

# If it was previously initialized, perform the following instead
#gcloud auth login
#gcloud auth list
#gcloud config set account 
#gcloud artifacts locations list  # list of all loc, not just your repo

gcloud auth configure-docker asia-south1-docker.pkg.dev
docker tag omsdk:latest asia-south1-docker.pkg.dev/niti…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=git&amp;rev=1777745590&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-05-02T18:13:10+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>git</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=git&amp;rev=1777745590&amp;do=diff</link>
        <description>Git Remote Server

Setting up a git server is as easy as this...


# On the server
cd /usr/local/share
sudo mkdir mygitrepo
sudo useradd -d /usr/local/share/mygitrepo -c &quot;Git repo user&quot; gituser
sudo chown gituser mygitrepo
cd mygitrepo
sudo -u gituser mkdir myrepo1
sudo -u gituser git init --bare myrepo1
sudo passwd gituser

# On the client
mkdir project1
cd project1
touch dummyfile
git init
git add dummyfile
git commit -m &quot;Initial commit&quot;
git remote add origin ssh://gituser@myserver/usr/local/s…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=grafana&amp;rev=1765116922&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-07T14:15:22+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>grafana</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=grafana&amp;rev=1765116922&amp;do=diff</link>
        <description>For a demo


docker run -d -p 3000:3000 \
--name grafana \
-v grafana-storage:/var/lib/grafana \
-v grafana-config:/etc/grafana \
grafana/grafana


cat &gt; dummy.json
{&quot;cpu&quot;: 5}
Ctrl-D

python3 -m http.server


Default credentials are: admin/admin

Install the</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=httpd&amp;rev=1772388750&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T18:12:30+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>httpd</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=httpd&amp;rev=1772388750&amp;do=diff</link>
        <description>Apache web server

Sample Config


ServerRoot &quot;/opt/homebrew/opt/httpd&quot;
Listen 127.0.0.1:8080
ServerName MyMacWebServer

LoadModule mpm_prefork_module lib/httpd/modules/mod_mpm_prefork.so
LoadModule log_config_module lib/httpd/modules/mod_log_config.so
LoadModule unixd_module lib/httpd/modules/mod_unixd.so
LoadModule authz_core_module lib/httpd/modules/mod_authz_core.so

LoadModule mime_module lib/httpd/modules/mod_mime.so
AddType text/html .html

DocumentRoot &quot;/Users/nitin/Documents/www/html/&quot;
…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=installing_dokuwiki_on_32-bit_debian&amp;rev=1762884456&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-11T18:07:36+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>installing_dokuwiki_on_32-bit_debian</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=installing_dokuwiki_on_32-bit_debian&amp;rev=1762884456&amp;do=diff</link>
        <description>Installing DokuWiki on 32-bit Debian

It&#039;s 2025, most Linux distributions have dropped support for 32-bit hardware, yet my home web-server still lives on, running Debian 12. Here&#039;s how I installed DokuWiki.

	*  Configured Apache2 for PHP by installing the libapache2-mod-php, php-xml, and php-bcmath packages</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=interesting202604&amp;rev=1776804018&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-21T20:40:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>interesting202604</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=interesting202604&amp;rev=1776804018&amp;do=diff</link>
        <description>Interesting Stuff in April 2026

	*  Microsoft has an interesting Python tool, markitdown for converting documents to MarkDown.
	*  Cheap routers? See Cudy, Tenda, Mercusys.

Interesting Stuff in March 2026

	*  Looking for something to install on your NAS? Try JellyFin, Immich (Docker container only), and NextCloud.</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=java&amp;rev=1772392844&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T19:20:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>java</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=java&amp;rev=1772392844&amp;do=diff</link>
        <description>Java

Gradle

Initializing a Gradle project


$ mkdir TestGradle
$ cd $_
$ gradle init --type java-application --dsl groovy

Enter target Java version (min: 7, default: 21):

Project name (default: TestGradle):

Select application structure:
  1: Single application project
  2: Application and library project
Enter selection (default: Single application project) [1..2] 1

Select test framework:
  1: JUnit 4
  2: TestNG
  3: Spock
  4: JUnit Jupiter
Enter selection (default: JUnit Jupiter) [1..4]…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=javascript&amp;rev=1772392618&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T19:16:58+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>javascript</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=javascript&amp;rev=1772392618&amp;do=diff</link>
        <description>JavaScript

Removing nulls in Mongoose


//import { MongoClient } from &#039;mongodb&#039;;
import express from &#039;express&#039;;
import mongoose from &#039;mongoose&#039;;
const { Schema, model } = mongoose;

const app = express();

// BEGIN - DB Init
const mdbstr = &#039;mongodb+srv://myna:meisnitin@cluster0.fdu3e.mongodb.net/?retryWrites=true&amp;w=majority&amp;appName=Cluster0&#039;;
/*
const client = new MongoClient(mdbstr);
await client.connect();
*/
await mongoose.connect(mdbstr);
const carSchema = new Schema({
  name: String,
  mod…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=kaminari&amp;rev=1773475406&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-14T08:03:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>kaminari</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=kaminari&amp;rev=1773475406&amp;do=diff</link>
        <description>Kaminari

Add it to the Rails project with:


bundle add kaminari
rails g kaminari:config  # Creates config/initializers/kaminari_config.rb

# In the controller, replace MyModel.all with:
MyModel.page params[:page]

# In the view, add:
&lt;%= paginate @data %&gt;</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=keepalive&amp;rev=1773688858&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-16T19:20:58+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>keepalive</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=keepalive&amp;rev=1773688858&amp;do=diff</link>
        <description>keepalive

Configure this service on 2 VMs. The backup will take over the floating IP if it does not receive the VRRP traffic.


global_defs {
   router_id LVS_DEVEL
   vrrp_skip_check_adv_addr
   vrrp_garp_interval 0
   vrrp_gna_interval 0
}

vrrp_instance VI_1 {
    state MASTER  # use &quot;BACKUP&quot; on the VM2
    interface eth0
    virtual_router_id 51
    priority 100  # Use a lower number on the backup
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    …</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=linux&amp;rev=1777738300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-05-02T16:11:40+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>linux</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=linux&amp;rev=1777738300&amp;do=diff</link>
        <description>Linux

Popular Topics

	*  bash
	*  bind
	*  chrony
	*  Docker
	*  diff
	*  FirewallD
	*  Git
	*  keepalive
	*  lxc
	*  mail
	*  rsync
	*  Samba
	*  SELinux
	*  SystemD Unit Files
	*  tuned
	*  ufw
	*  Vim
	*  VNC

Miscellaneous

Suppressing the Service Restart prompt for &quot;apt install&quot;


/etc/needrestart/needrestart.conf
$nrconf{verbosity} = 0;
$nrconf{restart} = &#039;a&#039;;

export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
export NEEDRESTART_MODE=a  # default is &quot;i&quot;nteractive…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=lxc&amp;rev=1777738418&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-05-02T16:13:38+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>lxc</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=lxc&amp;rev=1777738418&amp;do=diff</link>
        <description>LXC Containers

Snippet for Debian/Ubuntu


sudo su -
apt install -y lxc lxc-templates
lxc-create -n mysrv1 -t download -- --dist ubuntu --release jammy --arch amd64
lxc-start -n mysrv1
lxc-attach -n mysrv1</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=mail&amp;rev=1773681152&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-16T17:12:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>mail</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=mail&amp;rev=1773681152&amp;do=diff</link>
        <description>mail

Quick Start

To set up an email server, we typically use Postfix for SMTP, Dovecot for POP3/IMAP, and mail utilities (“s-nail” package on RedHat Linux).


dnf install -y postfix dovecot s-nail


Edit the /etc/postfix/main.cp file:


inet_interfaces = all
home_mailbox = Maildir/  # To match the path for dovecot</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=mongodb&amp;rev=1765645072&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-13T16:57:52+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>mongodb</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=mongodb&amp;rev=1765645072&amp;do=diff</link>
        <description>Quick Setup

For a quick setup with m and mtools on Debian/Ubuntu, download a script here.


npm install -g m  # Aaron Heckmann&#039;s verion manager
# m 8.0.15
# m mongosh 2.5.9
# m tools 100.13.0
# PATH=$PATH::~/.local/m/tools/versions/100.13.0/bin:~/.local/m/shell/versions/2.5.9/bin:~/.local/m/versions/8.0.15/bin

python3 -m pip install mtools psutil pymongo  # Thomas Rucksteiss&#039; mtools
# mlaunch --init --replicaset --nodes 1 --sharded 2 --port 28000
# mongosh --port 28000</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=nginx&amp;rev=1772389766&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T18:29:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nginx</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=nginx&amp;rev=1772389766&amp;do=diff</link>
        <description>nginx

Sample Config


events {
  worker_connections 4096;
}

http {
  ssl_certificate /usr/share/server.cer;
  ssl_certificate_key /usr/share/server.key;

  server {
    listen 8080;

    location / {
      root /usr/share/nginx/html;
      allow 192.168.0.0/24;
      deny all;
      auth_basic &quot;Root website&quot;;
      auth_basic_user_file /usr/share/my_users;
    }
    
    location /app {
      rewrite /app(.*) /$1 break;
      proxy_pass http://MyAppServer:8080;
    }
  }
}</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=oldtech&amp;rev=1766323266&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-21T13:21:06+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>oldtech</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=oldtech&amp;rev=1766323266&amp;do=diff</link>
        <description>Old Computer Hardware and Electronics

	*  YouTube video: How To Make Your Laptop Last FOREVER (My ThinkPad Mods &amp; Upgrades), by Trip of a Lifestyle
	*  YouTube video: 
I Rammed Modern Tech Inside a Vintage Laptop, by TME Retro (a.k.a. the Frankenstrad ALT not-286)</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=openssl&amp;rev=1772389704&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T18:28:24+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>openssl</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=openssl&amp;rev=1772389704&amp;do=diff</link>
        <description>OpenSSL

Generating a Self-Signed Certificate


# One-liner
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes \
-subj &quot;/C=IN/ST=Maharashtra/L=Mumbai/O=Pocket Theories/OU=IT/CN=myserver&quot;

# ...or, in separate steps

# Create a key (genrsa - deprecated in favor of genkpkay in OpenSSL 3)
openssl genrsa -aes128 -out my_server.key 4096  # -aes128 instead of -des3 is recommended

# Create a key (genpkey)
openssl genpkey -aes-128-cbc -algorithm RSA -pkeyopt rsa_…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=powershell&amp;rev=1776506160&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-18T09:56:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>powershell</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=powershell&amp;rev=1776506160&amp;do=diff</link>
        <description>Powershell


# Create a folder
New-Item -Path &#039;C:\Games&#039; -ItemType Directory

# Download a file with HTTP
Invoke-WebRequest &#039;http://a.a/a.txt&#039; -OutFile C:\a.txt
# Can also use Invoke-RestMethod or
# (New-Object System.Net.WebClient).DownloadFile(&#039;http://a.a/a.txt&#039;, &#039;C:\a.txt&#039;)

# Async BITS transfer
Import-Module BitsTransfer
Start-BitsTransfer -Source &#039;http://a.a/a.txt&#039; -Destination &#039;C:\a.txt&#039;   # -Asynchronous

# Unset a variable
Remove-Variable -Name MyVar1
# or
Remove-Item -Path Variable:MyV…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=python&amp;rev=1777654092&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-05-01T16:48:12+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=python&amp;rev=1777654092&amp;do=diff</link>
        <description>Python

SlackBotWithBolt

JSON Serialization for Custom Classes

Attempting to run json.dumps() on a custom class results in the error: “Object of type  is not JSON serializable.” By returning the dict as the serializer in a lambda passed to the default parameter of json.dumps(), we can get the class to serialize to JSON.</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=railties&amp;rev=1773480176&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-14T09:22:56+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>railties</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=railties&amp;rev=1773480176&amp;do=diff</link>
        <description>Railties

To edit the scaffold templates, look up the location of the railties gem with “gem info railties”

Within the location above, edit the templates in the subdirectories:

	*  gems/railties-(version-here)/lib/rails/generators/erb/scaffold</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=ransack&amp;rev=1773477356&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-14T08:35:56+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>ransack</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=ransack&amp;rev=1773477356&amp;do=diff</link>
        <description>Ransack


bundle add ransack

# In the model, whitelist the fields to search
  def self.ransackable_attributes(auth_object = nil)
    [&quot;field1&quot;, &quot;field2&quot;]
  end

# In the controller
def index
  @q = MyModel.ransack(params[:q])
  @data = @q.result(distinct: true).page(params[:page])
end

# In the view
&lt;%= search_form_for @q do |f| %&gt;
  &lt;%= f.label :name_cont %&gt;
  &lt;%= f.search_field :name_cont %&gt;
  &lt;%= f.submit &quot;Search&quot; %&gt;
&lt;% end %&gt;
&lt;%# 
  Do a render &#039;mymodel/search_form.html.erb&#039;
  and put the a…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=rsync&amp;rev=1772389310&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T18:21:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>rsync</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=rsync&amp;rev=1772389310&amp;do=diff</link>
        <description>rsync


rsync -arzP /dir1/ username@remotehost:/dir2
	  
-a = preserve dates and other archive stuff
-r = recursive
-z = compress
-P = partial and progress</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=ruby&amp;rev=1776625154&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-19T18:59:14+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>ruby</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=ruby&amp;rev=1776625154&amp;do=diff</link>
        <description>Ruby

Rails

Popular Gems

	*  EventMachine
	*  Kaminari
	*  Ransack
	*  Railties

Seed Data


bundle add faker  # Add it to only the development and test groups, if you are a stickler for convention

# In db/seeds.rb
50.times do
  MyModel.create! name: Faker::Name.name
end

rails db:migrate &amp;&amp; rails db:seed</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=samba&amp;rev=1765106876&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-07T11:27:56+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>samba</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=samba&amp;rev=1765106876&amp;do=diff</link>
        <description>apt update
apt install -y samba smbclient
mkdir /usr/local/share/shared_dir
chmod -R 0777 /usr/local/share/shared_dir

# in /etc/samba/smb.conf
[public]
path = /usr/local/share/shared_dir
public = yes
guest only = yes
writable = yes
force create mode = 0666
force directory mode = 0777
browsable = yes

systemctl restart smbd nmbd
smbclient -L \\localhost</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=slackbotwithbolt&amp;rev=1777654388&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-05-01T16:53:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>slackbotwithbolt</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=slackbotwithbolt&amp;rev=1777654388&amp;do=diff</link>
        <description>Slack Bot With Bolt

Within the Slack website

Go to api.slack.com , go to “Your Apps”, and “Create App”.

Enable Socket Mode, and in token add “connections::write”.

In the OAuth and Permissions tab, add the Bot Token Scopes. If you change these later, you will need to re-install the app to the workspace.</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=start&amp;rev=1776503828&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-18T09:17:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>start</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=start&amp;rev=1776503828&amp;do=diff</link>
        <description>Pocket Theories

This page serves as a top-level page for this wiki.

* Interesting Stuff

Computer Hardware and Electronics

	*  Amazon Computer and Electronics Finds
	*  Restoring and Modding Old Computer Hardware

Software Administration

	*  Ansible
	*  Docker
	*  DokuWiki
	*  Grafana
	*  httpd (Apache)
	*  Linux
	*  MongoDB
	*  nginx
	*  OpenSSL
	*  Powershell
	*  Windows

Software Development

	*  Artificial Intelligence / Machine Learning
	*  git
	*  Java
	*</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=vim&amp;rev=1766219474&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-20T08:31:14+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>vim</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=vim&amp;rev=1766219474&amp;do=diff</link>
        <description>Vim

This page is for vi / vim / NeoVim.

YouTube videos:

	*  30 Vim commands you need to know (in 10 minutes) by typecraft</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=vnc&amp;rev=1765054904&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-06T21:01:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>vnc</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=vnc&amp;rev=1765054904&amp;do=diff</link>
        <description>sudo apt update

sudo apt install -y \
ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal \
xfonts-base xfonts-75dpi xfonts-100dpi \
xfce4 xfce4-goodies \
tightvncserver

touch ~/.Xresources

vi ~/.vnc/xstartup



#!/bin/sh

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

[ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources
xsetroot -solid grey

vncconfig -iconic &amp;
gnome-panel &amp;
gno…</description>
    </item>
    <item rdf:about="http://pockettheories.com/dokuwiki/doku.php?id=windows&amp;rev=1772397968&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-01T20:46:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>windows</title>
        <link>http://pockettheories.com/dokuwiki/doku.php?id=windows&amp;rev=1772397968&amp;do=diff</link>
        <description>Windows

winpty

git-bash is unable to run some Windows applications (Eg. Python), and winpty provides a compatibility layer.

Also see: https://stackoverflow.com/a/48200434/13066762

netsh

# Allow file sharing in the firewall
netsh advfirewall firewall set rule group=“File and Printer Sharing</description>
    </item>
</rdf:RDF>
