Tuesday, August 4, 2026

Headers Security Advanced & HSTS WP setup manually

Open the file for editing and paste the following snippet inside the  .htaccess file:

<IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS Header always set X-Frame-Options "SAMEORIGIN" Header always set X-Content-Type-Options "nosniff" Header always set Referrer-Policy "strict-origin-when-cross-origin" Header always set X-XSS-Protection "1; mode=block" Header always set Permissions-Policy "geolocation=(), microphone=(), camera=()" </IfModule>

Install Nikto on ubuntu to test Website security

sudo apt update

 sudo apt install nikto libnet-ssleay-perl


Basic Commands
  • Basic scan: nikto.pl -h http://www.example.com
  • Specify port: nikto.pl -h 192.168.1.1 -p 443
  • Save output: nikto.pl -h target.com -o output.txt

Tuesday, July 28, 2026

How to install n8n on WSL Ubuntu and test bKash Sandbox with workflow

 Step-1: Install/(Upgrade to Ubunto 22) Ubuntu on your Windows 

sudo apt update && sudo apt full-upgrade -y

sudo do-release-upgrade


Step-2: Install Nodejs 

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.6/install.sh | bash

source ~/.bashrc

nvm install node (For Specific version: nvm install 20.11.0)

node -v && npm -v

nvm use 20.11.0 (to switch specific version if you have multiple version installed )


Step-2: Install N8N

sudo npm install n8n -g

n8n start (or npx n8n)

Now visit: http://localhost:5678



Optional:

If you need you can install ssl on localhost.


Screenshot of sample workflow and API test




If need you may contact me : ksu[at]olineit.com


Monday, July 20, 2026

How to select all blank cells in a range to keep unlocked in excel.

 Select Only the Blank Cells:

  • Press Ctrl + G (or F5) to open the Go To dialog box.
  • Click the Special... button at the bottom left.
  • Select Blanks and click OK

Monday, June 29, 2026

How to composer in cPanel using terminal Terminal

 At first, be sure that your cPanel has terminal access.

Step-1

mkdir -p ~/bin cd ~ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php --install-dir=$HOME/bin --filename=composer rm composer-setup.php echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc source ~/.bashrc

Step-2

composer -V

Step-3

cd ~/public_html/myproject composer install

Saturday, June 13, 2026

How to Activate Windows 10/11 and Office Pro Plus using digial license.

1. Open PowerShell: Click your Search bar, type PowerShell, and open it. If the installation of Windows 10/11 has been completed before.

2. Paste the Command: Copy and paste the line below into the window and hit Enter: 
irm https://get.activated.win | iex

3. Select Activation: A menu will pop up. Press 1 on your keyboard to select HWID (“Digital License” or “Product Key”).

4. Enjoy: Wait a few seconds until you see the “Success” message. Your watermark is gone!

Tuesday, June 9, 2026

WHMCS 9.0 Invoice Mutation

Insert the following line in configuration.php.

 $allow_adminarea_invoice_mutation = true;

Sunday, May 31, 2026

WHMCS Manual Cron Run

 /usr/local/bin/php -q /home/username/public_html/whmcs/crons/cron.php all --force -vvv




See Custom Cron...




Wednesday, May 20, 2026

Linux command to find user who failed to login from pop/imap

 journalctl -u dovecot -g "auth failed"

grep -i "auth failed" /var/log/mail.log | grep -E "imap|pop"

journalctl -u dovecot -g "auth failed" | grep -oE "user=<.*?>" | sort | uniq -c

grep "auth failed" /var/log/maillog | awk '{print $NF}' | sort | uniq -c | sort -nr



grep "auth failed" /var/log/maillog | grep "@example.com" | head


grep "auth failed" /var/log/maillog | \
grep -oE '[A-Za-z0-9._%+-]+@example\.com' | \
sort | uniq -c | sort -nr

grep "auth failed" /var/log/maillog | \
awk '/@example\.com/ {print $NF}' | \
sort | uniq -c | sort -nr

Monday, August 18, 2025

Wednesday, July 2, 2025

SQL to delete all WooCommerce products except those with "draft" status

 -- Disable foreign key checks (important for InnoDB)

SET

    FOREIGN_KEY_CHECKS = 0;

    -- Delete product meta

DELETE

    pm

FROM

    wp_postmeta pm

JOIN wp_posts p ON

    pm.post_id = p.ID

WHERE

    p.post_type = 'product' AND p.post_status != 'draft';

    -- Delete term relationships

DELETE

    tr

FROM

    wp_term_relationships tr

JOIN wp_posts p ON

    tr.object_id = p.ID

WHERE

    p.post_type = 'product' AND p.post_status != 'draft';

    -- Delete the products

DELETE

FROM

    wp_posts

WHERE

    post_type = 'product' AND post_status != 'draft';

    -- Enable foreign key checks again

SET

    FOREIGN_KEY_CHECKS = 1;

Thursday, June 26, 2025

Restrict Access to PHPMyAdmin with DirectAdmin

cd /usr/local/directadmin/
./directadmin set one_click_pma_login 1 restart
cd custombuild
./build update
./build set phpmyadmin_public no
./build phpmyadmin

Wednesday, June 18, 2025

How not to fill filtered out cells when dragging down from another sheet

Steps:

  1. Apply your filter in Sheet1.

  2. Select the range where you want to paste the formula (e.g., A2:A100) but only visible cells will be selected.

    • Select the range.

    • Press F5 or Ctrl+G → Click Special… → Choose Visible cells only → OK.

  3. Type your formula (e.g.):

    =INDEX(Sheet2!A:A, ROW()-1)
  4. Press Ctrl+Enter (instead of just Enter).

Saturday, May 3, 2025

Resetting the DirectAdmin Password via SSH:

 Resetting the Password via SSH:

  1. Access the server as root: Use an SSH program like PuTTY to connect to your server as the root user. 
  2. Reset the password: Execute the command passwd <username> (replace <username> with your DirectAdmin username, often admin or your server username). 
  3. Follow the prompts: You'll be prompted to enter a new password twice. 
  4. Verify the change: Once successful, you'll see a message confirming the password change. 
  5. Restart DirectAdmin (optional): You may need to restart the DirectAdmin service using the command service directadmin restart. 

Sunday, April 20, 2025

Reset WordPress Admin Password via MySQL Command Line


mysql -umyUserName -paVeryStrongPassword

show databases;
 
use myWordpressDB;

SELECT ID, user_login, user_pass FROM wp_users;

UPDATE wp_users SET user_pass=MD5('YourNewStrongPassword') WHERE ID = 1;

SELECT ID, user_login, user_pass FROM wp_users;

Wednesday, March 19, 2025

Excel VBA Macro: Save Range (as PDF) and Send as Attachment in Email

Sub save_pdf_and_attach_in_email()


Dim OutApp As Object

Dim OutMail As Object

Dim ws As Worksheet

Dim pdf_range As Range

Dim pdf_path As String


Set OutApp = CreateObject("Outlook.Application")

Set OutMail = OutApp.CreateItem(0)


Set ws = ThisWorkbook.Sheets("Sheet 1")

Set pdf_range = ws.Range("A1:C11")


pdf_path = "C:\Users\greggowaffles\Documents\Youtube Videos\Test\Stats\" & _

    "Population Data.pdf"

    

'align range in pdf

ws.PageSetup.CenterHorizontally = True

    

pdf_range.ExportAsFixedFormat Type:=xlTypePDF, _

    Filename:=pdf_path, OpenAfterPublish:=False


'create email

On Error Resume Next

    With OutMail

        .to = "team@abc.com"

        .CC = ""

        .BCC = ""

        .Subject = "Country Population Data " & Format(Date, "mm-dd-yyyy")

        .Display

        .HTMLBody = "<BODY style = 'font-size:12pt; font-family:Calibri'>" & _

            "Hi Team,<p>Please see attached pdf file.<p>Thanks,<br>Greg" & .HTMLBody

        

        .Attachments.Add pdf_path

    

    End With

    On Error GoTo 0


Set OutApp = Nothing

Set OutMail = Nothing


'Kill pdf_path


End Sub

Monday, February 24, 2025

How to inatall docker on Ubuntu using apt repository

 # Add Docker's official GPG key:

sudo apt-get update

sudo apt-get install ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

sudo chmod a+r /etc/apt/keyrings/docker.asc


# Add the repository to Apt sources:

echo \

  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \

  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \

  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

Install Latest version:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin


sudo docker run hello-world

Thursday, February 20, 2025

Reset Ubuntu with factory reset & and reinstall

Try configuring unconfigured packages:

sudo dpkg --configure -a

Update the contents of the repositories

sudo apt-get update

Try to fix missing dependencies:

sudo apt-get -f install

Update all packages with new versions available:

sudo apt-get full-upgrade

Reinstall Ubuntu desktop:

sudo apt-get install --reinstall ubuntu-desktop

Remove unnecessary packages:

sudo apt-get autoremove

Delete downloaded packages already installed:

sudo apt-get clean

Reboot the system to see if the issue was resolved:

sudo reboot

 

How to create a user in ubuntu with password giving all permissions ?

 o create a new user in Ubuntu with a password and grant them all permissions (including administrative privileges), follow these steps:

1. Create a New User

Run the following command, replacing username with your desired username:


sudo adduser username
  • You will be prompted to enter a password and some optional details.

2. Add User to the Sudo Group

To grant full administrative permissions, add the user to the sudo group:


sudo usermod -aG sudo username
  • This allows the user to execute commands as root using sudo.

3. Verify the User’s Permissions

Switch to the new user:


su - username

Then check if the user can run sudo commands:


sudo whoami

If it returns root, the user has full administrative access.

4. (Optional) Grant Passwordless Sudo Access

If you want the user to execute sudo commands without entering a password:


echo "username ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/username

Now the user has full administrative privileges. 

Thursday, February 13, 2025

How to install Install and Configure Alfresco Community Edition

System requirements:

Based on these assumptions, the following options are recommended:
  1. 2 servers with the following specifications:
    • 4 CPUs
    • 32 GB RAM per server
    • Tomcat Java options:
      • Xms512M
      • Xmx 20 G
      • XX:MaxPermSize=256m
      • XX:-DisableExplicitGC
    • web.xml
      • maxThreads=2 50
    • 30 GB HDD space
    • Servers must be load-balanced the load-balancer must have:
      • Session affinity: enabled
      • Web server probe: recommended
  2. 4 servers with the following specifications
    • 4 CPUs
    • 16 GB RAM per server
    • Tomcat Java Options:
      • Xms512M
      • Xmx1 0 G
      • XX:MaxPermSize=256m
      • XX:-DisableExplicitGC
    • web.xml
      • maxThreads= 125
    • 30 GB HDD space
    • Servers must be load-balanced the load-balancer must have:
      • Session affinity: enabled
      • Web server probe : recommended
We can follow the following instructions:
Part 01 : https://medium.com/p/6ddd06416711

Part 03 : https://medium.com/p/bcde44232f59

Headers Security Advanced & HSTS WP setup manually

Open the file for editing and paste the following snippet inside the  .htaccess file: <IfModule mod_headers.c> Header always set S...