Trigger Jenkins job from Laravel via Guzzle Request

Trigger Jenkins job from Laravel via Guzzle Request

To trigger a Jenkins job from a Laravel application using Guzzle, you can use the Jenkins API endpoint to build a job. Follow these steps: Create Jenkins Token In Jenkins, click on your User Name from Top Right Navbar, inside that page go to “Configure”. There you will see section “API Token “. Click on “Add new token " and create token. Copy the generated token and save it for future use....

September 15, 2023 · 2 min · Ganesh Bhosale
How to access Laravel Passport API from Shell Script using CURL and JQ

How to access Laravel Passport API from Shell Script using CURL and JQ

TL;DR: Access Laravel Passport API’s from Shell Script using CURL and JQ. This combination can be helpful in running remote Automation Jobs and Builds. Laravel Passport is a full OAuth2 server implementation for Laravel. It provides a simple and convenient way to authenticate users and secure API endpoints. In this article, we’ll walk through the process of logging in to a Laravel Passport API using a shell script. We’ll use curl to make HTTP requests and jq to parse JSON responses....

September 9, 2023 · 3 min · Ganesh Bhosale
Enable GZIP Compression on Ubuntu + Apache

Enable GZIP Compression on Ubuntu + Apache

Enable GZIP Compression on Ubuntu + Apache GZIP compression is a technique used to reduce the size of files transmitted over the internet, which can significantly improve website performance and decrease load times. In this article, we will guide you through the steps to enable GZIP compression on an Ubuntu server with Apache. Step 1: Check if mod_deflate is installed Before proceeding, we need to check if the mod_deflate module is installed and enabled in Apache....

August 3, 2023 · 2 min · Ganesh Bhosale
Setup Jenkins on Ubuntu 20.04 / 22.04 and run Jobs are root user

Setup Jenkins on Ubuntu 20.04 / 22.04 and run Jobs are root user

Requirements Add the repository key to the system and append the Debian package repository. wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt update Install Java 17 sudo apt install openjdk-17-jre-headless Update JAVA_HOME in .bashrc : nano ~/.bashrc export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 Install Jenkins sudo apt install jenkins Allow firewall for 8080 port...

June 10, 2023 · 3 min · Ganesh Bhosale
PHP-FPM Get list of running php files

PHP-FPM Get list of running php files

We always find need to know which php files (Malware or otherwise) consuming the CPU and Server resources, so that you can fix those files. FPM status page give this exact information. For that it needs to be enabled and configured in your apache confirguration where you want it to be displayed. Find where your FPM configuration is and edit www.conf. nano /etc/php/7.4/fpm/pool.d/www.conf Update file for: pm.status_path = /fpm7.4-status Restart FPM sudo service php7....

April 9, 2023 · 2 min · Ganesh Bhosale
Manage Laravel Queues using Supervisor

Manage Laravel Queues using Supervisor

Every Laravel Queue has it’s own cached version of Laravel Models, Jobs & Notification. You will be in serious panic if you are working on Jobs & Notification as Queue will not update the version of those file dynamically. You will need to restart Queue every time, by finding it in processes and killing it. Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems....

November 7, 2021 · 2 min · Ganesh Bhosale
Secure WordPress Websites from Brute Force Attacks using Fail2ban on LAMP Server

Secure WordPress Websites from Brute Force Attacks using Fail2ban on LAMP Server

You must be here because your Self-Hosted server suddenly reports 100% CPU Utilization and making all server websites slow. There are lot of hackers who use brute-force attack on websites to gain access of it. Let’s start with list of defences: 1. Using different username apart from admin Make Hackers Job More Difficult by choosing Site Specific Usernames 2. Use difficult Passwords with Alphanumerics along with spcial charactors like % # * 3....

September 13, 2021 · 3 min · Ganesh Bhosale
Send Email Alert to Admin when Error Exceptions occurs in Laravel

Send Email Alert to Admin when Error Exceptions occurs in Laravel

It’s very tedious for a developer to check error logs every day and make sure that everything is running fine. But you can reduce this daily overhead by creating simple developer notifications to Admin Mail or Slack for example. 1. Handle Exceptions in Laravel Handler There is default Handler for all these exceptions at app\Exceptions\Handler.php in Laravel 8. We handled the situation in reportable callback. <?php namespace App\Exceptions; use App\Jobs\JobDevNotification; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; class Handler extends ExceptionHandler { ....

July 28, 2021 · 3 min · Ganesh Bhosale
Ubuntu: Keep Process running in background using Tmux

Ubuntu: Keep Process running in background using Tmux

There are sometimes requirement on server side to keep background process from terminating. Follow following article to achieve it using tmux. ssh into the remote machine Start tmux by typing tmux into the shell Start the process you want inside tmux session. In this I will be running Cloud Commander cloudcmd. cloudcmd Leave / Detach the tmux session by typing Ctrl+b and then d. List all tmux sessions by tmux list-sessions Attach / Resume to a running session with...

May 14, 2021 · 1 min · Ganesh Bhosale
Complete guide - LetsEncrypt Certbot SSL for Ubuntu

Complete guide - LetsEncrypt Certbot SSL for Ubuntu

Let’s Encrypt provides free, automated SSL/TLS certificates that can be used to enable HTTPS on an Ubuntu server. Certbot is one of the most popular tools for obtaining and automatically renewing Let’s Encrypt certificates. This guide covers installing Certbot, configuring SSL for Apache and Nginx, testing HTTPS, automatic renewal, and common troubleshooting commands. Prerequisites Before installing Certbot, make sure: You have an Ubuntu server. You have sudo or root access. Your domain points to the server’s public IP address....

June 11, 2020 · 8 min · Ganesh Bhosale
How to setup Laravel Application on Heroku

How to setup Laravel Application on Heroku

Heroku provides a simple way to deploy PHP and Laravel applications without managing the underlying web server. In this guide, we will deploy a Laravel application to Heroku using Git, configure the application environment, and connect it to a MySQL database. Heroku’s PHP runtime automatically handles PHP, Composer, Apache/Nginx, and PHP-FPM. ([Heroku Dev Center][2]) 1. Prerequisites Before deploying the Laravel application, make sure the following are installed and working on your local machine:...

February 24, 2020 · 7 min · Ganesh Bhosale
How to setup Nginx Server on Ubuntu

How to setup Nginx Server on Ubuntu

How to Set Up an Nginx Server on Ubuntu Nginx is one of the most popular web servers for hosting websites and web applications. It is lightweight, fast, and commonly used as a reverse proxy, load balancer, and web server. In this guide, we will set up Nginx on an Ubuntu server and configure it to serve a website. Prerequisites You should have: An Ubuntu server SSH access to the server A user with sudo privileges A domain name pointing to the server’s IP address For this example, we will use:...

November 21, 2019 · 6 min · Ganesh Bhosale
How to switch PHP Versions on LAMP Server

How to switch PHP Versions on LAMP Server

Use multiple PHP versions on same server and manage currently running (default) php version for terminal. Install multiple PHP Versions: sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php8.1 sudo apt-get install php8.4 sudo a2enmod php8.1 sudo a2enmod php8.4 Switch: sudo update-alternatives --config php

January 13, 2019 · 1 min · Ganesh Bhosale
Getting started with Cloud Commander – Best File Manager for your VPS

Getting started with Cloud Commander – Best File Manager for your VPS

sudo apt-get install npm npm i cloudcmd -g Create Configuration: sudo nano ~/.cloudcmd.json Put Content { "name": "", "auth": true, "username": "root", "password": "", "algo": "SHA1", "editor": "edward", "packer": "zip", "diff": true, "zip": true, "buffer": true, "dirStorage": true, "online": true, "open": false, "oneFilePanel": false, "keysPanel": true, "port": 8000, "ip": null, "root": "/var/www", "prefix": "", "progress": true, "confirmCopy": true, "confirmMove": true, "showConfig": false, "showFileName": true, "contact": true, "configDialog": true, "console": true, "syncConsolePath": false, "terminal": false, "terminalPath": "", "terminalCommand": "", "terminalAutoRestart": true, "vim": false, "columns": "name-size-date-owner-mode", "export": false, "exportToken": "root", "import": false, "import-url": "http://localhost:8000", "importToken": "root", "importListen": false, "log": true } Put Password:...