Thursday, January 29, 2026

How to allow higher MB file uploads by increasing size in server php.ini

1) Check php version using the command:

                            php -v


2) Make sure server is using apache php or php cli by using the below command

                        sudo systemctl status


3) Check if any php-fpm is running. else

            sudo nano  /etc/php/8.4/cli/php.ini


4) Edit php.ini and change these values from 2M to 10 or 20 M

                    upload_max_filesize = 10M 

                    post_max_size = 10M


4. Restart web server:

                    sudo systemctl restart php8.4-fpm

                     sudo systemctl restart apache2

Monday, January 26, 2026

Get Gmail App Password for email notification through laravel app

 

First, you need to create an App Password from your Google Account:

    Go to your Google Account: https://myaccount.google.com/

    Click on "Security" in the left menu

    Enable "2-Step Verification" if not already enabled

    Go back to Security → 2-Step Verification

    Scroll down to "App passwords"

    Select "Mail" and "Other (Custom name)"

    Enter a name like "Laravel App"

    Click "Generate"

    Copy the 16-character password (no spaces)

     

     Update .env file with the following info:

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-16-char-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="your-email@gmail.com"
MAIL_FROM_NAME="${APP_NAME}"



     

     

     

     

Friday, January 23, 2026

How to change git origin for repo after making a copy of the repo

 1) Locally  run the following commands for the existing repo:

                        git remote -v

This will help us find the current remote origin

2) Set remote origin to the new repo:

                    git remote set-url origin git@gitlab.com:folder/repo.git

3) Locally ensure that it is in the correct branch

                    git checkout import-main

4) if activities were done in a new branch, merge it with the current branch "import main"

                                                  git merge main

5) push the code to the git


                        git push

Tuesday, December 30, 2025

Create a basic Sharepoint communication Site for your company

Step-by-step: Build MyCompany SharePoint Internal Hub

Step 0 — Decide Names (use these)

  • Hub site: MyCompany Central Hub
  • Sites: Operations, IT & Systems, Sales & Marketing, Finance, Compliance & Legal, Events & CME

1️ Create the Main Hub Site (Central Portal)

  1. Go to: Microsoft 365 → App Launcher (9 dots) → SharePoint
  2. Click: Create site
  3. Choose: Communication site
  4. Select a template: Blank (best) or Topic
  5. Site name: MyCompany Central Hub
  6. Click Finish

This becomes your main landing page.


2️ Register it as a Hub Site (Admin Step)

  1. Open: SharePoint Admin Center

1.      Go to https://admin.microsoft.com

2.      Select Admin centers → SharePoint

  1. Go to: Sites → Active sites
  2. Find and select: MyCompany Central Hub
  3. Click: Hub → Register as hub site
  4. Hub name: MyCompany Central Hub
  5. Save

Now you can manage global navigation + consistent branding.


3️ Create Department Sites (Communication Sites)

Repeat these steps for each department:

  1. In SharePoint home → Create site
  2. Choose: Communication site
  3. Name: MyCompany Operations
  4. Finish

Create these sites:

  • MyCompany Operations
  • MyCompany IT & Systems
  • MyCompany Sales & Marketing
  • MyCompany Finance
  • MyCompany Compliance & Legal
  • MyCompany Events & CME

4️ Connect Each Site to the Hub (Very important)

For each department site:

  1. Open the department site
  2. Click: Settings (⚙️) → Site information
  3. Look for: Hub site association
  4. Select: MyCompany Central Hub
  5. Save

Now all sites share the same top navigation style and theme.


5️ Build the Top Menu (Hub Navigation)

  1. Open: MyCompany Central Hub
  2. At top menu, click: Edit
  3. Add links (one by one):

·  Click Add link

4.      · 

    • Operations → link to Operations site
    • IT & Systems → link to IT site
    • Sales & Marketing → link to Sales site
    • Finance → link to Finance site
    • Compliance & Legal → link to Compliance site
    • Events & CME → link to Events site
  1. Click: Save

This gives you the “AIU-style” department navigation.


6️ Create the Hub Home Page Layout

A) Add the Banner

  1. On hub home → click Edit
  2. Click + → add Hero Web Part
  3. Choose layout: Layered
  4. Add a banner image (brand/medical theme)
  5. Title: MyCompany Central Hub
  6. Subtitle: Internal Operations & Systems Portal

B) Add Quick Action Buttons (right side feel)

  1. Click + under the banner area
  2. Add Quick Links
  3. Layout: Buttons
  4. Add buttons:
    • SOPs & Policies
    • IT Support Request
    • Finance Requests
    • Compliance Docs
    • CME & Events
  5. Publish the page

7️ Create Document Libraries (Core of SharePoint)

Go to each department site and create libraries:

Operations site:

  • SOPs & Policies
  • Templates
  • Reports

IT & Systems site:

  • System Documentation
  • Deployment Notes
  • Change Requests (List, not library)

Finance site:

  • Invoices
  • Budgets
  • Vendor Payments

Compliance site:

  • Contracts
  • Regulatory Docs
  • Audit Records

Events & CME:

  • Event Planning
  • Post-Event Reports
  • Marketing Assets

How to create a library:

  1. Go to the site → New → Document library
  2. Name it
  3. Create

8️ Create Lists for Requests (Forms replacement)

A) IT Support Request List

  1. Go to IT site
  2. Click New → List
  3. Choose Blank list
  4. Name: IT Support Requests
  5. Add columns:
    • Request Type (Choice)
    • Priority (Choice: Low/Med/High/Urgent)
    • Requested By (Person)
    • Description (Multiple lines)
    • Status (Choice: New/In Progress/Done)

B) Operations Requests (Optional)

Same concept for Operations.


9️ Setup Permissions (Internal-only)

Since suppliers cannot access, keep it simple:

  1. Go to each site → Settings (⚙️) → Site permissions
  2. Use standard groups:
    • Owners (full control)
    • Members (edit)
    • Visitors (read)

Recommendation:

  • Operations: most staff can read
  • IT: only IT team can edit
  • Finance/Compliance: restricted access

🔟 Turn on Versioning (Very important)

For each document library:

  1. Open library → Settings → Library settings
  2. Click Versioning settings
  3. Enable:
    Create major versions
    Keep versions (e.g., 50)

This prevents accidental loss.


1️1️ Publish + Test

  1. Log in as a normal user (or test account)
  2. Confirm they can:
    • Open hub
    • Navigate sites
    • View correct docs
    • Not access Finance/Compliance (if restricted)

 

Wednesday, December 24, 2025

Set Up PostgreSQL locally in Ubuntu

Install PostgreSQL


 sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql

Basic Setup




# Create database and user
sudo -u postgres psql

# In PostgreSQL shell:
CREATE DATABASE myapp;
CREATE USER myuser WITH PASSWORD 'mypassword';
GRANT ALL PRIVILEGES ON DATABASE myapp TO myuser;
\q


Connect



# Command line
psql -h localhost -U myuser -d myapp

# Connection string
postgresql://myuser:mypassword@localhost:5432/myapp

Environment Variables



DATABASE_URL="postgresql://myuser:mypassword@localhost:5432/myapp"

Wednesday, October 29, 2025

AWS Data Lifecycle Manager (DLM) setup for automated EC2 backups

Step 1: Choose “Custom policy” (as shown)

Keep:

  • Custom policy → selected

  • Policy typeEBS snapshot policy
    Then click Next step 🟧

Step 2: Target Resource Type

  • Resource type: Select Volume

  • Target resource tags:
    Add the tag you used on your EC2 volume, for example:

    • Key: Backup

    • Value: Daily

Only the volumes with this tag will be backed up automatically.

Step 3: Configure Schedule

  • Schedule name: Daily-EC2-Backup (or Weekly if preferred)

  • Frequency: Every 24 hours (for daily) or Every 7 days (for weekly)

  • Start time: Choose off-peak (e.g., 02:00 UTC)

  • Retention type: “Count”

  • Retain: 7 snapshots (automatically delete older ones)

Enable these options:

  • Copy tags from source

  • Exclude boot volumes (optional — keep unchecked if you want full backups including OS)

Step 4: IAM Role

If this is your first lifecycle policy:

  • Choose “Create new role for this policy”
    AWS will auto-generate permissions for DLM to create/delete snapshots.

Step 5: Review and Create

  • Review your policy summary (target tag, schedule, retention, IAM role)

  • Click Create Policy

Verification

After 24 hours (or at next schedule), go to:
👉 EC2 → Snapshots
You’ll see entries like:

“Created by EC2 Lifecycle Policy: Daily-EC2-Backup”

That confirms your automation works.


Tuesday, October 28, 2025

Push your local project to your own GitHub account


Step 1 — Check current remote

Run this in your project folder:

git remote -v

You’ll probably see something like:

origin  https://github.com/username/reponame (fetch)
origin  https://github.com/username/reponame (push)

 Step 2 — Set the correct remote for the username
git remote set-url origin https://github.com/username/reponame.git
 
 Step 3 — Verify the change

Run again:

git remote -v

You should see:

origin  https://github.com/username/reponame (fetch)
origin  https://github.com/username/reponame (push)
Step 4 — Set your identity (you already did this, but just to confirm)
git config user.name "username"
git config user.email "email@gmail.com"

Step 5 — Push to GitHub

Now push the main branch:

git push -u origin main

If prompted for credentials:

  • Username:

  • Password: your GitHub Personal Access Token (PAT) (not your GitHub password)

👉 Create one here: https://github.com/settings/tokens

When creating the token:

  • Choose “Fine-grained personal access token”

  • Grant Repository → Read and write access

  • Copy and paste it when Git asks for your password.


Set up GIT Personal Access Token Steps

 Go to GitHub.com → Settings → Developer settings → Personal access tokens → tokens (classic)

Generate new token with repo permissions

Copy the token

paste it as password during git push -u origin main

valid for 30 days

Saturday, September 6, 2025

Steps to setup phpmyAdmin after LAMPP stack setup using ubuntu

 You’re using Ubuntu with a LAMPP stack (Linux + Apache + MySQL + PHP). Let’s walk through installing and securing phpMyAdmin step by step:


🔹 1. Update system

sudo apt update && sudo apt upgrade -y

🔹 2. Install phpMyAdmin

sudo apt install phpmyadmin -y

👉 During installation, it will ask:

  • Web server to configure automatically → choose apache2

  • Configure database for phpMyAdmin → select Yes

  • Set a phpMyAdmin application password (this is for phpMyAdmin’s own database user, not MySQL root).


🔹 3. Enable Apache configuration

If it didn’t auto-enable, manually link phpMyAdmin to Apache:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo systemctl reload apache2

🔹 4. Enable required PHP extensions (LAMPP often needs this)

Make sure these are enabled:

sudo apt install php-mbstring php-zip php-gd php-json php-curl -y
sudo phpenmod mbstring
sudo systemctl restart apache2

🔹 5. Access phpMyAdmin

Now open in your browser:

http://your-server-ip/phpmyadmin

Example:

http://34.199.91.21/phpmyadmin

Login using your MySQL root (or another MySQL user you created).


🔹 6. (Optional) Enable root login if blocked

By default, MySQL root may be set to auth_socket instead of a password. Fix:

sudo mysql -u root

Inside MySQL shell:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_strong_password';
FLUSH PRIVILEGES;
EXIT;

Now login in phpMyAdmin with root / your_strong_password.


🔹 7. Secure phpMyAdmin

Since phpMyAdmin is a common attack target:

  • Change the URL alias (instead of /phpmyadmin/dbadmin123):

    sudo nano /etc/apache2/conf-available/phpmyadmin.conf
    

    Replace /phpmyadmin with /dbadmin123, then:

    sudo systemctl reload apache2
    
  • Restrict access by IP (allow only your IP).


✅ Done! You now have phpMyAdmin running on your LAMPP server.



Set up a permanent system user access token for WhatsApp Cloud API

To set up a permanent system user access token for WhatsApp Cloud API in Meta Business Manager, here’s the step-by-step process:


🔹 Step 1. Go to Business Settings


🔹 Step 2. Create a System User

  1. Under Users → System Users.

  2. Click Add.

  3. Give it a name (example: XXX_API_User).

  4. Choose Role = Admin (so it has full permissions).

  5. Save.


🔹 Step 3. Assign Assets to the System User

  1. After creating the system user, select it.

  2. Click Add Assets.

  3. Assign your WhatsApp Business Account (WABA).

  4. Give it permissions:

    • whatsapp_business_messaging

    • whatsapp_business_management.


🔹 Step 4. Generate a Permanent Access Token

  1. Still inside the system user, click Generate New Token.

  2. Choose your app (the one connected to WhatsApp Cloud API).

  3. Select permissions:

    • whatsapp_business_messaging

    • whatsapp_business_management.

  4. Generate token → it will look like:

    EAAG...long-string...ZDZD
    

⚠️ Copy it immediately — Meta only shows it once.


🔹 Step 5. Use the Token in Your Code

In your .env file:

WHATSAPP_ACCESS_TOKEN=EAAG...long-string...ZDZD

Use it in your API calls:

curl -i -X POST \
  https://graph.facebook.com/v20.0/{{PHONE_NUMBER_ID}}/messages \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "messaging_product": "whatsapp",
        "to": "965XXXXXXXX",
        "text": { "body": "Hello from US!" }
      }'

🔹 Step 6. Token Lifetime & Refresh

  • System user tokens are long-lived (permanent), but they can be invalidated if:

    • You remove the system user.

    • You change business security settings.

  • Best practice: Store the token securely and rotate it periodically.


✅ After this, you’ll have a permanent token that won’t expire every 24 hours, unlike the test tokens.



 

Friday, August 1, 2025

Steps to Connect to VPN and RDP from ubuntu device to windows



Step 1) Setup Forticlient

https://www.fortinet.com/support/product-downloads#vpn

download deb forticlient vpn package for linux

 


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Step 2) From the Applications, click open "Forticlient"

"Edit VPN Connection" dialog box opens up

VPN : SSL-VPN, fill up the details Connection Name, Description, Remote Gateway, port No: and Save
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Step 3)  1. Install RDP Client on Ubuntu
Recommended tool: Remmina (GUI RDP client)
sudo apt update
sudo apt install remmina -y

2.Open terminal and run remmina

In Remmina:

    Click + to create a new connection.

    Set:

        Protocol: RDP - Remote Desktop Protocol

        Server: IP address or hostname of the remote Windows machine

        Username: Your Windows user

        Password: Your Windows password

    Click Connect.



Monday, July 21, 2025

Create .pem file from .ppk using puttygen software in windows for SSH access from cmd

 

Convert .ppk to unencrypted .pem

If .pem is encrypted and .ppk works, you can convert .ppk to a new .pem: 

  1. Open PuTTYgen 

  1. Click Load → Load your .ppk file 

  1. Go to ConversionsExport OpenSSH key 

  1. Save as something like oxfordAIU_unencrypted.pem 

  1. Try SSH again: 

  2.  

    ssh -i path\to\pem user@ip_address

     

Friday, June 20, 2025

 

1. Register an App in Azure AD

  • Go to: https://portal.azure.com

  • Navigate to: Azure Active Directory > App registrations > New registration

  • if you don't find it goto "Microsoft Entra ID"

  • Once inside, select App Registrations --> New Registration

  • Give it a name (e.g. Laravel Email App)

  • Redirect URI: Can be http://localhost or your app callback

2. Add API Permissions - from right side manage-->choose api permissions

  • Under "API permissions" > search "mail" and Add:

    • Mail.Send (delegated)

    • User.Read

3. Create a Client Secret -From the app registration overview page

  • Under "Certificates & secrets" > "New client secret"

  • Copy the secret value

  • client id and tenant id