<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://djnotes.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://djnotes.github.io/" rel="alternate" type="text/html" /><updated>2025-07-12T15:50:27+00:00</updated><id>https://djnotes.github.io/feed.xml</id><title type="html">Code with Mehdi</title><subtitle>With codewithmehdi.com, you can learn to code. Also, you will find interesting articles about development, software, networking and other technologies.</subtitle><entry><title type="html">Hardening WordPress</title><link href="https://djnotes.github.io/development/2025/07/12/hardening-wordpress.html" rel="alternate" type="text/html" title="Hardening WordPress" /><published>2025-07-12T12:40:00+00:00</published><updated>2025-07-12T12:40:00+00:00</updated><id>https://djnotes.github.io/development/2025/07/12/hardening-wordpress</id><content type="html" xml:base="https://djnotes.github.io/development/2025/07/12/hardening-wordpress.html"><![CDATA[<h1 id="hardening-wordpress">Hardening WordPress</h1>

<p>There has been many instances of website hijacking for many WordPress site owners. The root cause is wrong permissions set on WordPress core files. Here’s a general step by step process to harden your WordPress installation and prevent it from being hijacked by asshole hackers.</p>

<h2 id="steps">Steps</h2>

<p>To prevent security vulnerabilities and hijack attacks, it’s important to give appropriate permissions to WordPress files. 
The rule of thumb is no file must be given more permission than it needs or you might end up getting screwed. 
My WP hardening involves a several-step process (For NGINX):</p>

<ul>
  <li>DS=/var/www/html/public_html</li>
  <li>Set ownership to a SSH user: sudo chown -R myuser:www-data $DS</li>
  <li>Set 755 permissions on directories: find $DS -type d -exec chmod 755 {} \;</li>
  <li>Set 744 permissions on files:  find $DS -type f -exec chmod 744 {} \;</li>
  <li>Allow read, write and execute on uploads: chmod -R 775 $DS/wp-content/{uploads,themes,plugins,upgrade,upgrade-temp-backup}</li>
</ul>

<h2 id="further-hardening">Further Hardening</h2>
<p>The permissions we set previously allow some code to be executed in special dirs i.e. uploads, themes, plugins, upgrade, etc. 
To contain this threat, we can add further control to prevent any code from execution in this dirs. In NGINX’s server block for this virtual host, add:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Deny PHP execution in wp-content/uploads
location ~* ^/wp-content/uploads/.*\.php$ {
    deny all;
}

# Deny PHP execution in wp-content/plugins
# This is typically good practice, but be aware some plugins
# *might* legitimately place PHP files here that need to run.
# Assess carefully.
location ~* ^/wp-content/plugins/.*\.php$ {
    deny all;
}

# Deny PHP execution in wp-content/themes
# Similar to plugins, themes could have PHP files needing execution.
# Use with caution and test thoroughly.
location ~* ^/wp-content/themes/.*\.php$ {
    deny all;
}

# Deny PHP execution in wp-content/upgrade (temporary files during upgrades)
location ~* ^/wp-content/upgrade/.*\.php$ {
    deny all;
}

# Add other writable directories as needed, e.g., wp-content/cache
location ~* ^/wp-content/cache/.*\.php$ {
    deny all;
}
</code></pre></div></div>

<p>In Apache, you can create a .htaccess file under the uploads dir or any other dir you are concerned about with this content:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;Files *.php&gt;
Deny from all
&lt;/Files&gt;
&lt;FilesMatch "(?i)\.(php|phtml|php3|php4|php5|php7|phps)$"&gt;
Deny from all
&lt;/FilesMatch&gt;
</code></pre></div></div>

<h2 id="additional-notes">Additional Notes</h2>
<ul>
  <li>with these permissions, it is not possible to upgrade WordPress core. It is recommended to perform core upgrade only manually 
under a user with sufficient permissions on the core files, possibly by using WP CLI or manual copy and move operations.</li>
  <li>Despite our hardening efforts, try to stick to keeping user logins secure</li>
</ul>]]></content><author><name></name></author><category term="development" /><summary type="html"><![CDATA[Hardening WordPress]]></summary></entry><entry><title type="html">Create Kotlin Multiplatform Apps</title><link href="https://djnotes.github.io/development/2025/05/26/make-kotlin-multiplatform-desktop-apps.html" rel="alternate" type="text/html" title="Create Kotlin Multiplatform Apps" /><published>2025-05-26T12:40:00+00:00</published><updated>2025-05-26T12:40:00+00:00</updated><id>https://djnotes.github.io/development/2025/05/26/make-kotlin-multiplatform-desktop-apps</id><content type="html" xml:base="https://djnotes.github.io/development/2025/05/26/make-kotlin-multiplatform-desktop-apps.html"><![CDATA[<h1 id="create-kotlin-multiplatform-desktop-apps">Create Kotlin Multiplatform Desktop Apps</h1>

<h2 id="requirements">Requirements:</h2>
<ul>
  <li>IntelliJ IDE version 2025.5.1.1 and above</li>
  <li>JDK 21 and above</li>
  <li>Kotlin Multiplatform plugin on macOS and Compose Multiplatform on Windows/Linux</li>
</ul>

<p><em>Note</em>: At the time of this writing, May 26 2025, Kotlin Multiplatform is only available for macOS. So, we will create the project in IntelliJ on macOS and then we can also build it on the other platforms using Compose Multiplatform plugin. 
here are the steps that need to be taken to create and build a Kotlin Multiplatform app:</p>

<h2 id="create-a-new-project">Create a new project</h2>
<p>There are two ways to create a KMP project:</p>
<ul>
  <li>Using the New Wizard in IntelliJ and then choosing Kotlin Multiplatform (Kotlin Multiplatform plugin needs to be installed)</li>
  <li>Using JetBrains KMP web wizard: kmp.jetbrains.com to define the project and then download the project zip for local development</li>
</ul>

<h2 id="new-project-wizard-in-intellij">New Project Wizard in IntelliJ</h2>
<p>Press File-&gt;New Project and then choose Kotlin Multiplatform on the left. On the right, choose the platforms you target, e.g. Desktop. iOS, Android, etc. I only choose Desktop because we focus on Desktop apps.</p>

<h2 id="building-on-macos">Building on macOS</h2>
<p>To build the the app on macOS, use the default task defined by the project (desktopApp in the list of Run configurations).</p>

<h2 id="building-on-windows">Building on Windows</h2>
<p>Once you installed a JDK version 21 and above, specify the jdk path in the gradle configuration. You can install various JDK versions using winget in Windows Terminal. Note that Gradle prefers forward slash for paths, rather than Windows’ “"” separator. So, change the path accordingly. For example, in my case it is:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>org.gradle.java.home=C:/Program Files/Eclipse Adoptium/jdk-21.0.7.6-hotspot
</code></pre></div></div>

<h2 id="building-distributable-packages">Building distributable packages</h2>
<p>To build distributed packages like dmg (on mac), msi (Windows) and flatpak (Linux), run the following gradle command:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./gradlew packageDistributionForCurrentOS

# on Windows run: ./gradlew.bat packageDistributionForCurrentOS
</code></pre></div></div>]]></content><author><name></name></author><category term="development" /><summary type="html"><![CDATA[Create Kotlin Multiplatform Desktop Apps]]></summary></entry><entry><title type="html">Running RabbitMQ in Linux Containers</title><link href="https://djnotes.github.io/development/2025/05/12/run-rabbitmq-in-containers.html" rel="alternate" type="text/html" title="Running RabbitMQ in Linux Containers" /><published>2025-05-12T13:13:00+00:00</published><updated>2025-05-12T13:13:00+00:00</updated><id>https://djnotes.github.io/development/2025/05/12/run-rabbitmq-in-containers</id><content type="html" xml:base="https://djnotes.github.io/development/2025/05/12/run-rabbitmq-in-containers.html"><![CDATA[<h1 id="run-rabbitmq-in-linux-containers">Run RabbitMQ in Linux Containers</h1>
<p>RabbitMQ can be used for task queue management in applications that need some time to perform something. With containers, it’s quite easy to start a group of RabbitMQ containers, some as workers, some as producers. Here, I will show how to create a setup with a single worker and a single producer. The worker will wait for messages from the queue and the producer will send messages to the worker through a queue.</p>

<p><em>Note</em>: I will be using Podman to create and manage containers
0- Create env.ini with the following contents:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[rabbitmq]
RABBITMQ_DEFAULT_USER=myuser
RABBITMQ_DEFAULT_PASS=mypass
RABBITMQ_DEFAULT_VHOST=rabbit1
</code></pre></div></div>

<p>1- Create Podman network:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>podman create network rb
</code></pre></div></div>

<p>2- Create Worker container:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>podman run -d --hostname rabbit1 --name rabbit1 -p 8080:15672 --env-file env.ini --network rb  docker.io/library/rabbitmq:3-management
</code></pre></div></div>

<p>3- Create producer container:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>podman run -d --hostname rabbit2 --name rabbit2 --env-file env.ini --network rb docker.io/library/rabbitq:3
</code></pre></div></div>

<p>4- Enter the worker and install pika:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>podman exec -ti rabbit1 bash
apt update &amp;&amp; apt install -y python3-pika nano
</code></pre></div></div>

<p>5- Enter worker code:
While in the container, do:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkdir code
cd code
nano server.py

#!/usr/bin/env python
import pika
import time

credentials = pika.PlainCredentials('myuser', 'mypass')
params = pika.ConnectionParameters('rabbit1', 5672, 'rabbit1', credentials)
connection = pika.BlockingConnection(
    params
)

channel = connection.channel()

channel.queue_declare(queue='task_queue', durable=True)
print(' [*] Waiting for messages. To exit press CTRL+C')


def callback(ch, method, properties, body):
    print(f" [x] Received {body.decode()}")
    time.sleep(body.count(b'.'))
    print(" [x] Done")
    ch.basic_ack(delivery_tag=method.delivery_tag)


channel.basic_qos(prefetch_count=1)
channel.basic_consume(queue='task_queue', on_message_callback=callback)

channel.start_consuming()

# Run the code
python3 server.py
</code></pre></div></div>

<p>6- Go inside producer container:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>podman exec -ti rabbit2 bash
apt update &amp;&amp; apt install -y python3-pika nano

mkdir code 
cd code
nano client.py


#!/usr/bin/env python
import pika
import sys

credentials = pika.PlainCredentials('myuser', 'mypass')
params = pika.ConnectionParameters('rabbit1', 5672, 'rabbit1', credentials)
connection = pika.BlockingConnection(
    params
)
channel = connection.channel()

channel.queue_declare(queue='task_queue', durable=True)

# Create a list of files to simulate list of operations
files = [
    'file1.mp3', 'file2.mp3', 'file3.mp3'
]

i = 0
while True:
    message = files[i%len(files)] # iterate over the list of files to simulate operations
    i = i+1
    channel.basic_publish(
        exchange='',
        routing_key='task_queue',
        body=message,
        properties=pika.BasicProperties(
            delivery_mode=pika.DeliveryMode.Transient
        ))
    print(f" [x] Sent {message}")
connection.close()

# Run the producer
python3 client.py
</code></pre></div></div>

<h2 id="see-the-management-panel">See the management panel:</h2>

<p>If you did all the above steps, then the management panel is available at the following address:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http://localhost:8080
</code></pre></div></div>

<p>Once you opened the page, you will be asked for username and password. Enter <code class="language-plaintext highlighter-rouge">myuser</code> and <code class="language-plaintext highlighter-rouge">mypass</code>, the same values entered in env.ini file, respectively for this. After being authenticated, you will be able to see Overview, Connections, Channels, Exchanges, Queues and Streams and Admin sections, each of which contains valuable information.</p>]]></content><author><name></name></author><category term="development" /><summary type="html"><![CDATA[Run RabbitMQ in Linux Containers RabbitMQ can be used for task queue management in applications that need some time to perform something. With containers, it’s quite easy to start a group of RabbitMQ containers, some as workers, some as producers. Here, I will show how to create a setup with a single worker and a single producer. The worker will wait for messages from the queue and the producer will send messages to the worker through a queue.]]></summary></entry><entry><title type="html">How to Create a Partial Slides (1.5 slides) in Elementor</title><link href="https://djnotes.github.io/wordpress/2025/04/26/how-to-create-partial-slides-in-elementor.html" rel="alternate" type="text/html" title="How to Create a Partial Slides (1.5 slides) in Elementor" /><published>2025-04-26T20:30:00+00:00</published><updated>2025-04-26T20:30:00+00:00</updated><id>https://djnotes.github.io/wordpress/2025/04/26/how-to-create-partial-slides-in-elementor</id><content type="html" xml:base="https://djnotes.github.io/wordpress/2025/04/26/how-to-create-partial-slides-in-elementor.html"><![CDATA[<h1 id="partial-slides">Partial Slides</h1>
<p>Sometimes you need to create partial slides for product carousels, in such a way that only 1 product and half of the next product is visible in the viewport. This is appropriate especially in mobile view. It also encourages the user to slide the carousel to see the next item in the list.</p>

<h1 id="create-partial-views-in-elementor-pro">Create Partial Views in Elementor Pro</h1>
<p>There are probably some plugins that allows creating partial slides. You might also want to use some custom CSS. However, in recent versions of <strong>Elementor Pro</strong> you can do this in the Loop Carousel using its settings. Here are the steps:</p>
<ul>
  <li>Open the page containing carousel in Elementor Editor</li>
  <li>Click the Loop Carousel</li>
  <li>Go to Mobile View (because you want the partial slides on mobile devices)</li>
  <li>In the Layout section select 1 as the number of “Slides on display”</li>
  <li>In the Settings section, find Offset Slides and select Right or Left from the dropdown. You can also use the bottom slider to adjust the amount of offset</li>
</ul>]]></content><author><name></name></author><category term="wordpress" /><summary type="html"><![CDATA[Partial Slides Sometimes you need to create partial slides for product carousels, in such a way that only 1 product and half of the next product is visible in the viewport. This is appropriate especially in mobile view. It also encourages the user to slide the carousel to see the next item in the list.]]></summary></entry><entry><title type="html">How to Link a Post (Product) Loop Item to Its Details Page</title><link href="https://djnotes.github.io/wordpress/2025/02/04/how-to-link-loop-item-to-product-details-in-elementor.html" rel="alternate" type="text/html" title="How to Link a Post (Product) Loop Item to Its Details Page" /><published>2025-02-04T16:16:00+00:00</published><updated>2025-02-04T16:16:00+00:00</updated><id>https://djnotes.github.io/wordpress/2025/02/04/how-to-link-loop-item-to-product-details-in-elementor</id><content type="html" xml:base="https://djnotes.github.io/wordpress/2025/02/04/how-to-link-loop-item-to-product-details-in-elementor.html"><![CDATA[<p>Elementor Loop Builder is a good tool for creating custom loop items that can then be used by Elementor to create product/post/etc. carousels. 
One thing that might be a little tricky is linking the item to the post link (permalink). 
Here’s how to do it:</p>
<ul>
  <li>In the Loop item editor, select the image you want to be clickable,</li>
  <li>Under Content, press the dropdown in front of Link.</li>
  <li>There is a special field beneath the link dropdown. Press the icon for Dynamic Labels in front of it.</li>
  <li>A list of different items appears.</li>
  <li>Click “Post Link” and you are done. 
Now the item will be clickable on its cover image, i.e. users can click the image to go to the post or to product details in case of a product carousel.</li>
</ul>]]></content><author><name></name></author><category term="wordpress" /><summary type="html"><![CDATA[Elementor Loop Builder is a good tool for creating custom loop items that can then be used by Elementor to create product/post/etc. carousels. One thing that might be a little tricky is linking the item to the post link (permalink). Here’s how to do it: In the Loop item editor, select the image you want to be clickable, Under Content, press the dropdown in front of Link. There is a special field beneath the link dropdown. Press the icon for Dynamic Labels in front of it. A list of different items appears. Click “Post Link” and you are done. Now the item will be clickable on its cover image, i.e. users can click the image to go to the post or to product details in case of a product carousel.]]></summary></entry><entry><title type="html">How To Remove Fedora From Dual Boot System</title><link href="https://djnotes.github.io/2024/12/23/how-to-remove-fedora-from-dual-boot-system.html" rel="alternate" type="text/html" title="How To Remove Fedora From Dual Boot System" /><published>2024-12-23T00:00:00+00:00</published><updated>2024-12-23T00:00:00+00:00</updated><id>https://djnotes.github.io/2024/12/23/how-to-remove-fedora-from-dual-boot-system</id><content type="html" xml:base="https://djnotes.github.io/2024/12/23/how-to-remove-fedora-from-dual-boot-system.html"><![CDATA[<h1 id="how-to-remove-fedora-cleanly-from-dual-boot-system">🤩How to Remove Fedora Cleanly from Dual Boot System</h1>

<h2 id="-run-cmd-as-admin">💻 Run cmd as admin:</h2>

<h3 id="step-1️⃣">Step 1️⃣:</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         bcdedit /enum firmware
</code></pre></div></div>

<h3 id="step-2️⃣">Step 2️⃣:</h3>
<p>Select EFI firmware identifier e.g. {abcdxxxx}</p>

<h3 id="step-3️⃣">Step 3️⃣:</h3>
<p>Delete the entry from store:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         bcdedit /delete {abcdxxxx}
</code></pre></div></div>

<h3 id="step-4️⃣-remove-the-linux-partition-from-disk-management">Step 4️⃣: Remove the Linux partition from disk management</h3>

<h3 id="step-5️⃣-optional">Step 5️⃣ (Optional):</h3>
<p>Delete files for the EFI partition of the deleted entry:</p>

<p>🟢5-1:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         diskpart
</code></pre></div></div>
<p>🟢5-2:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         list disk
</code></pre></div></div>
<p>🟢5-3:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         select disk [1]
</code></pre></div></div>
<p>Replace [1] with the correct number from “list disk”</p>

<p>🟢5-4:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         list vol
</code></pre></div></div>
<p>🟢5-5:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         select Volume [0]
</code></pre></div></div>
<p>Replace [0] with number for the volume that is 100 MB (System Partition)</p>

<p>🟢5-6:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         assign letter z
</code></pre></div></div>
<p>z can be any letter</p>

<p>🟢5-7:</p>

<p>Exit diskpart</p>

<p>🟢5-8:</p>

<p>Go to z</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         z:
</code></pre></div></div>
<p>🟢5-9:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         dir
</code></pre></div></div>
<p>🟢5-10:</p>

<p>Go to EFI directory</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         cd EFI
</code></pre></div></div>
<p>🟢5-11:</p>

<p>Find the directory for the deleted Linux distro (e.g. Ubuntu)</p>

<p>🟢5-12:</p>

<p>Remove the directory:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>         rmdir /s Ubuntu
</code></pre></div></div>
<p>(Replace Ubuntu with actual distro name)</p>]]></content><author><name></name></author><summary type="html"><![CDATA[🤩How to Remove Fedora Cleanly from Dual Boot System]]></summary></entry><entry><title type="html">Set Web Proxy Settings Via Terminal On Macos</title><link href="https://djnotes.github.io/2024/06/19/set-web-proxy-settings-via-terminal-on-macos.html" rel="alternate" type="text/html" title="Set Web Proxy Settings Via Terminal On Macos" /><published>2024-06-19T00:00:00+00:00</published><updated>2024-06-19T00:00:00+00:00</updated><id>https://djnotes.github.io/2024/06/19/set-web-proxy-settings-via-terminal-on-macos</id><content type="html" xml:base="https://djnotes.github.io/2024/06/19/set-web-proxy-settings-via-terminal-on-macos.html"><![CDATA[<h1 id="set-web-proxy-settings-via-terminal-on-macos">Set Web Proxy Settings via Terminal on MacOS</h1>

<p>In order to set a web proxy on MacOS’ terminal, we will use <code class="language-plaintext highlighter-rouge">networksetup</code> utility:</p>
<ul>
  <li>First get list of network services
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>networksetup -listallnetworkservices
</code></pre></div>    </div>
    <p>It will show a list like this:</p>
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>An asterisk (*) denotes that a network service is disabled.
Thunderbolt Bridge
Wi-Fi
Freedom VPN
V2BOX
v4freedom
FoXray
</code></pre></div>    </div>
    <p>From the output, we know that Wi-Fi is what we’re looking for.</p>
  </li>
  <li>Next, set web proxy and secure web proxy as follows:
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>networksetup -setwebproxy Wi-Fi 127.0.0.1 19999
networksetup -setsecurewebproxy Wi-Fi 127.0.0.1 19999
</code></pre></div>    </div>
    <p>That’s it. You should be able to use the proxy now.</p>
  </li>
  <li>If you want to turn off the proxy, use the following commands:</li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>networksetup -setwebproxystate Wi-Fi Off
networksetup -setsecurewebproxystate Wi-Fi Off
</code></pre></div></div>
<p>Using <code class="language-plaintext highlighter-rouge">On</code> in the above commands will turn on the proxies.</p>

<h2 id="using-a-script-to-automate-proxy-setting">Using a Script to Automate Proxy Setting</h2>
<p>TODO</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Set Web Proxy Settings via Terminal on MacOS]]></summary></entry><entry><title type="html">Rooting Nokia 3.2</title><link href="https://djnotes.github.io/2024/05/19/rooting-nokia-3.2.html" rel="alternate" type="text/html" title="Rooting Nokia 3.2" /><published>2024-05-19T00:00:00+00:00</published><updated>2024-05-19T00:00:00+00:00</updated><id>https://djnotes.github.io/2024/05/19/rooting-nokia-3.2</id><content type="html" xml:base="https://djnotes.github.io/2024/05/19/rooting-nokia-3.2.html"><![CDATA[<h1 id="rooting-nokia-32-this-is-not-a-comprehensive-guide-do-not-follow-will-update-if-this-becomes-a-proven-and-complete-method-of-rooting-for-me">Rooting Nokia 3.2: This is not a comprehensive guide! DO NOT FOLLOW! Will update if this becomes a proven and complete method of rooting for me.</h1>

<p>Here are the steps that I took in trying to root a Nokia 3.2 device. However, because of the problems that process created, I had to reverse the process and thankfully get to a working state.</p>

<ul>
  <li>Unlocking the bootloader. This involves doing some setting changes and running some adb commands. What I didn’t read in instructions was that this ERASES the whole device! So, back up first!</li>
  <li>Installing Magisk. This requires a boot image compatible with your device. I didn’t find an image for Android 11 so used one for Android 10. That created issues: Wifi didn’t work and there was no sound.</li>
  <li>Tried flashing an image for Android 11 from SD Card and using adb sideload. both failed because verification failed</li>
  <li>Tried flashing TWRP for Nokia 3.2, (command: adb flash recovery twrp-xxx.img) but it failed. Gemini suggested it might be case that the recovery image is installed in boot partition. I tried “adb flash boot twrp-xxx.img” and like a miracle, the flash succeeded. Then the device booted up and sound and Wifi were good again.</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[Rooting Nokia 3.2: This is not a comprehensive guide! DO NOT FOLLOW! Will update if this becomes a proven and complete method of rooting for me.]]></summary></entry><entry><title type="html">Install Win10 Driver For Hp Laserjet 1200</title><link href="https://djnotes.github.io/2024/05/04/Install-Win10-Driver-for-HP-LaserJet-1200.html" rel="alternate" type="text/html" title="Install Win10 Driver For Hp Laserjet 1200" /><published>2024-05-04T00:00:00+00:00</published><updated>2024-05-04T00:00:00+00:00</updated><id>https://djnotes.github.io/2024/05/04/Install-Win10-Driver-for-HP-LaserJet-1200</id><content type="html" xml:base="https://djnotes.github.io/2024/05/04/Install-Win10-Driver-for-HP-LaserJet-1200.html"><![CDATA[<h1 id="install-windows-10-driver-for-hp-laserjet-1200-printer">Install Windows 10 driver for HP LaserJet 1200 printer</h1>

<p>Today I had to install driver for HP LaserJet 1200 on a client’s computer and I had a hard time making the printer work. The reason: The latest Universal PCL 6 printer driver offered on the HP site turned out not to be compatible with Windows 10, through there nothing written about it on the downloads page. I kept seeing an error message on the printed test pages.</p>

<h2 id="the-errors">The Errors</h2>
<p>Error was something like: Pcl XL error Unsupported Protocol</p>

<h2 id="solution">Solution</h2>
<p>It struck my mind that the printer, being an old machine, might need an older printer driver like PCL 5, and a search on Google showed that PCL 6 (a.k.a PCL XL) is very different from PCL 5. So, I looked for LaserJet 1200 printer PCL 5. There are not many options on the Internet. Finally, I found the driver’s files in a zip on Driver Pack’s website. You don’t need the Driver Pack app to install the driver.</p>

<h2 id="how-to-install">How to Install</h2>
<p>I assume you downloaded and unzipped the driver for HP LaserJet 1200 PCL 5 on your system. To install the printer correctly, go to printers and hit Add Printer. Then select the model from the list and then find the button Have Disk instead of selecting Windows drivers. Then, give it the path where you unzipped the driver. It will install the driver and might even launch an installer mid-way. Nevertheless, you should have no problem after the driver gets installed. Hit Print Test Page on the final page and get your first (hopefully) successful printout.</p>

<h2 id="how-to-print-multiple-copies-using-hp-printer">How to Print Multiple Copies using HP Printer</h2>
<p>In case your printer does not print multiple copies of a page despite being told so in the print page, do the following:</p>

<ul>
  <li>Right click printer and select Printer Properties</li>
  <li>Select Device Properties</li>
  <li>Scroll down to Mopier setting and disable it. Now, the driver should send multiple copies to the printer when you set print count to more then 1</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[Install Windows 10 driver for HP LaserJet 1200 printer]]></summary></entry><entry><title type="html">Caching In Wordpress Using W3totalcache</title><link href="https://djnotes.github.io/2024/04/29/caching-in-wordpress-using-w3totalcache.html" rel="alternate" type="text/html" title="Caching In Wordpress Using W3totalcache" /><published>2024-04-29T00:00:00+00:00</published><updated>2024-04-29T00:00:00+00:00</updated><id>https://djnotes.github.io/2024/04/29/caching-in-wordpress-using-w3totalcache</id><content type="html" xml:base="https://djnotes.github.io/2024/04/29/caching-in-wordpress-using-w3totalcache.html"><![CDATA[<h1 id="caching-in-wordpress-using-w3-total-cache">Caching in WordPress using W3 Total Cache</h1>

<p>Caching in web applications is important because there are many requests sent to the server all the time and without good caching mechanisms, the performance of the site and users’ browsing experience will not be optimal.</p>

<h2 id="w3-total-cache">W3 Total Cache</h2>
<p>W3 Total Cache is a plugin that allows you to configure several types of caching mechanisms for your site. Once installed, it will show you a wizard guiding you through the configuration steps. The wizard consists of several parts the follow next.</p>

<h3 id="page-cache">Page Cache</h3>
<p>This speeds up Time to First Byte. There are several options e.g. Disk,Disk: Enhanced, Redis, etc. The recommended one is Disk: Enhanced as in my case, it shows the least amount of time in ms (22.49).</p>

<h3 id="database-cache">Database Cache</h3>
<p>Database cache allows caching queries. The difference between the default database performance and cached ones is not significant, so we should leave it as None.</p>

<h3 id="object-cache">Object Cache</h3>
<p>This cache allows reusing objects cached by WordPress during page renders. I choose Memcached here because it takes only 1.77 ms</p>

<h3 id="browser-cache">Browser Cache</h3>
<p>This is an important setting that allows setting cache headers for assets, saving browsers from downloading assets like CSS and JS files on each page render. So, you should set it to Enabled.</p>

<h3 id="image-optimization">Image Optimization</h3>
<p>Check Enable WebP Converter to convert image files to lightweight web-friendly format WebP, thus improve performance.</p>

<h3 id="lazy-load">Lazy Load</h3>
<p>Check Lazy Load Images option to reduce page loads by deferring image loads until they are needed.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Caching in WordPress using W3 Total Cache]]></summary></entry></feed>