Wednesday, October 2, 2024

Important Website

https://pexels.com

 contabo.com/en/vps - 12 vcpu cores, 48 GB RAM, 400 GB NVMe, 3 snapshots, 32 TB Traffic

Monday, September 2, 2024

Steps to install the LAMP (Linux, Apache, MySQL/MariaDB, PHP) stack on Ubuntu 22.04 AWS t2 micro instance for LARAVEL 11

PRE-REQUISITES:

1) login to amazon.aws.com, and launch ubuntu 22.04 instance with 30 GB EBS

2) SSH to the AWS Server

To install the LAMP (Linux, Apache, MySQL/MariaDB, PHP) stack on Ubuntu 22.04, follow these steps:

Step 1: Update the System

Before you begin, ensure your package list and installed packages are up-to-date by running the following command:

sudo apt update && sudo apt upgrade -y

Step 2: Install Apache

  1. Install Apache by running the following command:

    sudo apt update

    sudo apt install apache2

    press Y and hit ENTER to continue


    TEST:
    http://your_server_ip


    Verify Apache Installation: After installation, you can check the status of Apache to ensure it's running:

    sudo systemctl status apache2

    Step 3: Install MySQL

    1) Install MySQL Server:

    sudo apt install mysql-server -y
     

    Secure MySQL Installation: Once MySQL is installed, run the security script to secure your installation:


  2. sudo apt install mysql-server

    switch its authentication method from auth_socket to mysql_native_password

            sudo mysql
            SELECT user,authentication_string,plugin,host FROM mysql.user;

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

    TEST
            SELECT user,authentication_string,plugin,host FROM mysql.user;
            exit

    2)sudo mysql_secure_installation

    --VALIDATE PASSWORD PLUGIN.-NO
    REST- YES


    Verify MySQL Installation: Check the MySQL service status:

    sudo systemctl status mysql
     

    Step 4: Install PHP 8.2

  3. To install PHP 8.2 and all the necessary modules for Laravel on Ubuntu 22.04, follow these steps:

    Step 1: Update the System

    First, ensure your package lists are up-to-date:

    Step 2: Add the PHP Repository

    The default Ubuntu repositories might not have the latest PHP versions. To get PHP 8.2, you'll need to add the ondrej/php repository:

  4. Install the software-properties-common package if it’s not already installed:

    sudo apt install software-properties-common -y
    Add the PHP repository:

    sudo add-apt-repository ppa:ondrej/php
    sudo apt update
     sudo apt install php8.2 php8.2-cli php8.2-fpm php8.2-mysql php8.2-pgsql php8.2-sqlite3 php8.2-xml php8.2-mbstring php8.2-curl php8.2-zip php8.2-bcmath php8.2-gd php8.2-intl php8.2-readline php8.2-soap php8.2-imagick -y

  5. Step 4: Install Composer (PHP Dependency Manager)

    1. Download and install Composer:

      curl -sS https://getcomposer.org/installer | php

      2. Move Composer to a directory in your PATH:
       sudo mv composer.phar /usr/local/bin/composer

      3. Verify Composer installation:

      composer --version

      Step 5: Configure Apache or Nginx (Optional)

      If you're using Apache or Nginx, you might need to configure them to use PHP 8.2.

      For Apache:

    2. Install the PHP 8.2 module for Apache:

      sudo apt install libapache2-mod-php8.2 -y
       

    3.  Disable the old PHP module and enable the new one:

      sudo a2dismod php8.1
      sudo a2enmod php8.2
       

      4.Restart Apache2

      sudo systemctl restart apache2 

      -------------------------------------------------------------------------------------------------------------------------

      git clone

      git checkout branch

      sudo composer install --ignore-platform-req=ext-mongodb

      ----------------------------------------------------------------------------------

      update DNS Record in the domain registrar add A record with elastic IP:
    4. --------------------------------------------------------------------

       

Step 1 — Create a conf file

Copy 000-default.com.conf to create a new file in /etc/apache2/sites-available:

$ cd /etc/apache2/sites-available
$ sudo cp 000-default.com.conf example.com.conf


    -include that directory to sites available using <directoryname>.conf file- sudo nano /etc/apache2/sites-available/directoryname.conf

 


<VirtualHost *:80>

ServerName example.com

ServerAlias www.example.com //for www domain

DocumentRoot /var/www/html/example.com/public

<Directory /var/www/html/example.com>

AllowOverride All

</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

 

Step 3 — Enabling a virtual host


-to enable the site
        sudo a2ensite <directoryname>
    -to test for syntax errors
        sudo apachectl configtest
-syntax ok

    -restart apache services
        sudo systemctl restart apache2

Step 4— Enabling SSL

Install certbot

sudo snap install --classic certbot

 

$ sudo certbot --apache -d example.com -d www.example.com 
 
sudo systemctl restart apache2 



 

Create free Business email using ZOHO

 

Zoho Mail offers a free email hosting plan for custom domains with up to 5 users. Here’s how to set it up:

  1. Sign up for a free Zoho Mail account. 
  2. Login as admin https://mailadmin.zoho.com.au/hosting
  3. Add as many users, email accounts
  4. Verify your domain by adding a TXT or CNAME record to your domain’s DNS settings.
  5. Change Password, to create password for them
  6. use https://www.zoho.com/mail/login.html to login to each user email account

 

Tuesday, August 27, 2024

Step-by-step tutorial for beginners to set up a Django project on Ubuntu:

 Step 1: Install Python and Pip

 Update the package list:

sudo apt update 

Install Python 3 and pip:
sudo apt install python3 python3-pip -y

Verify the installation:
 python3 --version
pip3 --version

Step 2: Install Virtual Environment

Install venv (if not installed):

sudo apt install python3-venv -y
 

Create a virtual environment: Navigate to your project directory and create the environment:

mkdir my_django_project
cd my_django_project
python3 -m venv env
 

Activate the virtual environment:

source env/bin/activate
Your terminal prompt should now show (env).

 

Step 3: Install Django

Install Django:

pip install django
 

Verify the installation:

django-admin --version


Step 4: Start a Django Project 

Create a new project:

django-admin startproject mysite

Navigate to the project directory:

 cd mysite
To verify that everything is working, run the Django development server.

python3 manage.py runserver
Step 7: Create a View

Edit myapp/views.py:

from django.shortcuts import render

def home(request):
    return render(request, 'home.html')


Create a URL pattern: Edit mysite/urls.py to include your app’s view: 

from django.contrib import admin
from django.urls import path
from myapp import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.home),
]

Run the server again:
python3 manage.py runserver

Step 8: Create a Template

mkdir -p myapp/templates
 

Create an HTML file myapp/templates/home.html:

<!DOCTYPE html>
<html>
<head>
    <title>Django App</title>
</head>
<body>
    <h1>Welcome to Django!</h1>
</body>
</html>

Modify the view to render the template: In myapp/views.py:
from django.shortcuts import render

def home(request):
    return render(request, 'home.html')
 

Run the server and refresh the browser. You should now see the HTML content rendered.

 

Friday, August 9, 2024

Steps to install Laravel 11 project

 

Ubuntu 22.04, Apache

  • PHP >= 8.2
  • MySQL or other database server
  • Composer
  • NodeJS
  •  sudo apt-get install php8.2-mysql
     sudo apt-get install php8.2-xml
  •  sudo apt-get install php8.2-mbstring  
  • sudo apt-get install php8.2-curl

How to Install

  1. Clone the project
  2. Go to the project root directory and run composer install and npm install
  3. Create .env file and copy content from .env.example
  4. Run php artisan key:generate from terminal
  5. Change database information in .env
  6. Run migrations by executing php artisan migrate , Then Run php artisan db:seed if you want use faker database records,
  7. Start the project by running php artisan serve
  8. Run in another commandline npm run dev
 REFERENCES:
 
  1. https://github.com/YasserElgammal/blog-cms

php artisan storage:link

Thursday, August 1, 2024

Steps to install Laravel Boiler Plate

1) Git clone https://github.com/rappasoft/laravel-boilerplate.git

2) cd /var/www/html/laravel-boilerplate , set up .env file

3) php artisan key:generate

4) composer install

5) npm install

6) php artisan session:table

7) php artisan migrate

Sunday, July 28, 2024

Command to do Automated unit testing in laravel

 php artisan test

Steps to run auto backup to AWS S3 in laravel docker environment


1- Use spatie/laravel-backup package to implement project folder back-up to the  server

2- Manually run the backup , by running its cronjob

                 php artisan backup:run

3- Check your AWS account to view backups 

4- Download to your device and back-up to hard disk

Setting up budget friendly POS

Prerequisites

1)Purchase necessary Hardware Barcode Printer, Invoice Printer, Scanner

2) laptop/ System needs to have 3 USB ports

3) 3 power cables will be there, so better to have an extension cable

4) POS s/w hosted in Digital Ocean Server, so as to be available anywhere

5) Barcode label role (50 x 25 cm)

6) Invoice printer sheet roll

-------------------------------------------------------------------------------------------------------------------------

1)Preferred Invoice printer - EPSON-TM-T20III-Series

a) Download the driver, from the link below, choose the correct Windows version 

https://epson.com/Support/Point-of-Sale/Thermal-Printers/Epson-TM-T20III-Series/s/SPT_C31CH51001?review-filter=Windows+10+64-bit

b)During installation don't forget to choose USB Port

-------------------------------------------------------------------------------------------------------------------------

2)Preferred Barcode printer -Honeywell pc42d (300 dpi)

a) first download and Install download manager from the below link

https://hsmftp.honeywell.com:443/en/Software/Printers/Printer-Software-and-Drivers/Label-Design-Applications/Current/BarTender_UL_2022

b) Then download and install bartender lite software

https://sps-support.honeywell.com/s/article/How-to-download-BarTender-Ultralite-for-Intermec-legacy-printers

c) To print the barcode on label, 

   -- Add product to the POS software, download barcode,

   -- open the barcode designer software, 

           File--> new-->predefined stock (40336)

 select next on other items and print the barcode

-




-----------------------------------------------------------------------------------------------------------

3) Connect with zebra or honeywell scanner

------------------------------------------------------------------------------------------------------------------------

Thursday, May 30, 2024

MERGING MULTIPLE SPF RECORDS FOR YOUR GODADDY DOMAIN

 If you have multiple SPF records, delete them to avoid conflicts.Add a single SPF record with the combined directives:

Eg:
1.  v=spf1 include:_spf.elasticemail.com include:spf.protection.outlook.com -all

2. v=spf1 include:_spf.mlsend.com include:_spf.mlsend.com include:_spf.elasticemail.com include:spf.protection.outlook.com -all

Combined
  1. v=spf1 include:_spf.elasticemail.com include:spf.protection.outlook.com include:_spf.mlsend.com -all
  2. Save Changes:

    • Save the changes to your DNS records.

Verify the SPF Record

After updating the SPF record, verify that it has been correctly applied:

  • Use MXToolbox SPF Lookup https://mxtoolbox.com/SuperTool.aspx to check the SPF record for your domain.
  • Ensure that the record includes all necessary includes (_spf.elasticemail.com, spf.protection.outlook.com, _spf.mlsend.com).

Tuesday, May 28, 2024

Adding Meta Tags

 

Steps to Implement

  1. Edit your HTML file: Open your HTML document in your preferred text editor.
  2. Insert meta tags: Add the meta tags within the <head> section as shown in the example above.
  3. Save the changes: After adding the meta tags, save the file.
  4. Upload your file: If your website is hosted, upload the updated HTML file to your web server.

Validation

After adding meta tags, you can validate your HTML to ensure there are no errors. You can use the W3C Markup Validation Service https://validator.w3.org/ to check your HTML.

How to check if code is changed from LUMEN to LARAVEL

 Here are some ways to check your code after your team migrated it from Lumen to Laravel:

Here are some ways to check your code after your team migrated it from Lumen to Laravel:

General checks:

  • Project Structure:
    • Verify the Laravel directory structure. Laravel has a specific directory layout with folders like app, config, resources, etc. Ensure these folders exist and contain the expected files.
  • Configuration:
    • Check the composer.json file to see if Laravel dependencies are installed.
    • Review the config directory. Key Laravel configuration files like app.php, database.php, etc. should be present and configured correctly.
  • Autoloading:
    • Ensure the autoload section in composer.json reflects the Laravel PSR-4 autoloading structure.
  • Routing:
    • Look for the routes directory. Laravel uses routes defined in this directory for handling requests. Ensure routes are migrated properly from Lumen.
  • Controllers:
    • Verify that controllers are located in the app/Http/Controllers directory (default Laravel location) and use Laravel controller features like dependency injection and middleware.

Framework-specific checks:

  • Lumen-specific code: Identify and remove any Lumen-specific code that is no longer relevant in Laravel. This could include custom service providers, facades, or helper functions.
  • Laravel features: Look for usage of new Laravel features like middleware, Eloquent ORM, or service providers that may have replaced Lumen functionality.

Testing:

  • Unit Tests: Run any existing unit tests to ensure core functionalities still work after the migration.
  • Manual Testing: Manually test critical functionalities of your application to identify any regressions introduced during the migration.

Additional resources:

By following these steps and referencing the resources, you can gain a good understanding of the changes made during the migration and identify any potential issues. Remember, the specific checks will depend on the complexity of your application and the extent of the migration.

Thursday, May 9, 2024

Edit PDF

 Edit PDF using https://www.sejda.com/pdf-editor?

Edit PDF META DATA https://pdfcandy.com/

Wednesday, April 24, 2024

Google Gloud Text to Speech using Vertex AI

English Text To Speech

 

 https://console.cloud.google.com/vertex-ai/generative/speech/text-to-speech?project=high-form-421310

 

Arabic Text To Speech

 

https://www.texttovoice.online/?lang=ar-XA 

https://speechgen.io/en/tts-arab/

 

Thursday, April 18, 2024

Steps to get website table data to excel

 1)Libre Office Calc


CLICK From top menu Sheet ----->Link to external data

2)Enter the website URL and click enter

3)Use copy and paste special--->transpose, to change rows to columns and columns to rows

4)Use tools--->macros to write VB script to get things like finding emails and logos


Wednesday, April 17, 2024

web scrapping tutorial

 https://data36.com/web-scraping-tutorial-episode-1-scraping-a-webpage-with-bash/

 

sudo apt-get install html2text

curl https://www.ted.com/talks/sir_ken_robinson_do_schools_kill_creativity/transcript |
html2text |
sed -n '/Details About the talk/,$p' |
sed -n '/Programs &amp. initiatives/q;p' |
head -n-1 |
tail -n+2  > proto_text.csv

 

 

 

Tuesday, April 2, 2024

Build your skills using AWS

 https://explore.skillbuilder.aws/learn

 

To enroll in AWS Training and Certification courses, follow these steps:

  1. Create an AWS Builder Account:

    • If you don't already have an AWS Builder account, go to the AWS website (https://aws.amazon.com/) and click on the "Create an AWS Builder Account" button. Follow the prompts to set up your account.
  2. Access the AWS Training and Certification Portal:

    • Once you have an AWS account, go to the AWS Training and Certification portal at https://www.aws.training/. or https://explore.skillbuilder.aws/learn
    • If you're not already signed in, sign in using your AWS builder account credentials.
  3. Explore Training Options:

    • Browse through the available training courses, learning paths, and certifications offered by AWS.
    • You can filter courses by role (e.g., Solutions Architect, Developer, SysOps Administrator), level (beginner, intermediate, advanced), and format (digital training, classroom training, certification exam preparation).
  4. Select a Course or Certification:

    • Choose the course or certification that aligns with your learning goals and career objectives.
    • Click on the course or certification to view more details, including the course outline, duration, prerequisites, and available formats.
  5. Enroll in the Course:

    • Once you've selected a course or certification, click on the "Enroll" or "Register" button.
    • Follow the prompts to complete the enrollment process. You may need to provide additional information such as your contact details and payment information (if applicable).
  6. Access Training Materials:

    • After enrolling in a course, you'll gain access to the training materials, which may include video lectures, hands-on labs, quizzes, and other resources.
    • Some courses may also provide access to instructor-led training sessions or virtual classrooms.
  7. Track Your Progress:

    • Monitor your progress through the course materials and complete any required assessments or exercises.
    • Track your progress using the learning dashboard or progress tracker provided by AWS Training and Certification.
  8. Prepare for Certification Exams:

    • If you're preparing for an AWS certification exam, make sure to review the exam guide, study the recommended materials, and take practice exams to assess your readiness.
    • Schedule your certification exam through the AWS Certification portal when you feel prepared to take the exam.

By following these steps, you can enroll in AWS Training and Certification courses and start building your skills and expertise in cloud computing and AWS services.

 

Tuesday, March 12, 2024

Wednesday, January 17, 2024

Freee Website to generate barcode or QRcode

 https://qrcode.tec-it.com/en

step-by-step guide on how to create a Linktree for your company:

 Here's a step-by-step guide on how to create a Linktree for your company:

  1. Visit Linktree's Website: Go to the Linktree website: https://linktr.ee/.

  2. Sign Up or Log In: If you don't have an account, sign up using your email or social media accounts. If you already have an account, log in.

  3. Create Your Linktree:

    • Once logged in, you'll be prompted to create your Linktree.
    • Click on the "+ Add New Button" to add your first link.
    • Enter the title for the link (e.g., YouTube) and the URL.
    • Continue adding buttons for other links you want to include (e.g., WhatsApp, social media profiles, website).
  4. Customize Your Linktree:

    • Customize the appearance of your Linktree by choosing a theme and updating colors to match your company's branding.
    • Add a profile picture or company logo for a more personalized touch.
  5. Arrange Your Links:

    • Drag and drop the links to arrange them in the desired order.
    • You can also add or remove links as needed.
  6. Settings:

    • Explore the settings to customize your Linktree further. You can change the Linktree URL, add analytics, and set up other preferences.
  7. Save and Share:

    • Once you are satisfied with your Linktree setup, save your changes.
    • Copy the Linktree URL provided (e.g., linktr.ee/YourCompanyName) and share it on your YouTube channel, WhatsApp, social media, or any other platform where you want users to access multiple links easily.
  8. Promote Your Linktree:

    • Consider promoting your Linktree in your YouTube video descriptions, WhatsApp status, social media profiles, and any other relevant channels.

That's it! Your Linktree is ready to help your audience access various links associated with your company from a single, convenient location.

Sunday, January 7, 2024

web scraping reference

 https://juangsalazprabowo.medium.com/how-to-scraping-a-website-using-php-curl-in-laravel-framework-446ea0e97219