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....
Server-Management

Trigger Jenkins job from Laravel via Guzzle Request

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...

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....

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....

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 { ....

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...