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

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

Laravel Valet setup including PHPMyAdmin
Laravel Valet is one of the most used tool on Mac by Laravel developers. Deploying test domains is lot way convenient than working on localhost or 127.0.0.1. Make sure that all your libraries you are installing via ** brew** only. 1. Brew, Composer & PHP Installation If you don’t have Brew or Composer Installed, Install it with following commands first. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" Install php using brew install php@7....
![Laravel Valet : 502 Bad Gateway [SOLVED]](https://dwij.net/images/laravel-valet-502-bad-gateway-solved.jpg)
Laravel Valet : 502 Bad Gateway [SOLVED]
When you upgrade or downgrade PHP Version of Laravel Valet it creates this issue of getting 502 Bad Gateway Error while accessing any parked .test domain. Simple way to solve this by updating composer first. composer global update Once done reinstall Valet again. It takes very less time. valet install Run this command to make sure that you use correct version of php valet use php@7.4

Integrate Zoho Cliq OAuth API in PHP Laravel using Guzzle
Zoho has created amazing Product ecosystem but is very poor while implementing the Clean API’s for it’s users. Reference API Docs: https://www.zoho.com/cliq/help/restapi/v2/ In this article we will be demonstrating How to send a simple Message to Cliq Channel and ** Bot Subscribers**. 1. Setup a Server-based Application Zoho Admin Panel Link: https://api-console.zoho.com Add http://app.test/cliq-redirect url as ‘Authorized Redirect URIs ‘. Create a Organization Channel in Cliq named mychannel. Create a Bot with ** Listen** and ** Send** Permission and name it mybot....

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

Recursive Components in Vue 3 using Slots
You might find various use cases of Recursive Vue Components where the Source is based on some Nested Array. What we are going to demonstrate here is Recursive Element Implementation from Tags. Let’s say we want to create a Sidebar for Admin Panel and want to make it look minimal in coding. <sidebar-item name="Dashboard" link="#"> <sidebar-item name="Dashboard Default" link="/dashboard"></sidebar-item> <sidebar-item name="Dashboard eCommerce" link="/dashboard-ecommerce"></sidebar-item> </sidebar-item> <sidebar-item name="Components" link="/components"></sidebar-item> Actual implementation of each sidebar item would be more like this:...

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

Flutter: Putting ListView.builder inside another ListView
No doubt ListView is one of the most used Container Widget in any Mobile Application as it gives us a seamless scrolling effect and a lot of space to put our content neatly. You are here because you might have received the following error: Vertical viewport was given unbounded height. The relevant error-causing widget was ListView Your code might look like this: ListView( children: [ Container( child: ListView.builder( itemCount: snapshot.data.length, itemBuilder: (context, index) {} ), ), ] ) Now add shrinkWrap: true, physics: ScrollPhysics(), to ListView....

Integrate Google Maps in Flutter Application
if you are facing any of the following errors while integrating Google Maps in Flutter, follow this article. ‘GoogleMaps/GoogleMaps.h’ file not found The ‘Pods-Runner’ target has frameworks with conflicting names: googlemaps.framework. warning: ‘sqlite3_wal_checkpoint_v2’ is only available on iOS 5.0 or newer ld: targeted OS version does not support use of thread local variables in XYZ for architecture x86_64 Steps to Integrate Google Maps in Flutter References: https://developers.google.com/maps/documentation/ios-sdk/start https://developers.google.com/maps/documentation/android-sdk/intro https://codelabs.developers.google.com/codelabs/google-maps-in-flutter Step 1: Import Flutter Library Add google_maps_flutter library to pubspec....

Scrape HTML Page Metadata Using Python
If you need to extract metadata such as title, description, keywords, Open Graph tags, canonical URL, and Twitter Card information from an HTML page, Python makes this easy using requests and BeautifulSoup. Install Required Packages Install the required Python packages: pip install requests beautifulsoup4 Basic HTML Metadata Scraper Create a Python file named metadata.py: import requests from bs4 import BeautifulSoup url = "https://example.com" response = requests.get( url, headers={ "User-Agent": "Mozilla/5.0" }, timeout=10 ) response....

Best Freebie Flutter UI Templates
Flutter is now a popular tool for creating UI Designs in no time. Still sometimes you will need an initial push to get going. So presenting here some of the best Freebie UI Templates in Flutter: 1. Best-Flutter-UI-Templates by Mitesh Chodvadiya Mitesh has done a wonderful job in Designing and Developing this Template. This template gives 3 different UI options and very well coded considering in mind user expectations. Download | Author...

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

Getting started with Google Flutter on VSCode
Flutter is Google’s UI toolkit for crafting beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Flutter not only enables us to create lavish Mobile apps but it gives whole meaningful Software Architecture to create Platform Independent Mobile Apps. Flutter codes are highly reusable as compared to Android or iOS Codes. All you need is to put the library you want to import and Use the codes directly....

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:...
![Warning: CocoaPods not installed [Mac + Flutter + VSCode + XCode + iOS Simulator]](https://dwij.net/images/warning-cocoapods-not-installed-mac-flutter-vscode-xcode-ios-simulator.jpg)
Warning: CocoaPods not installed [Mac + Flutter + VSCode + XCode + iOS Simulator]
When you install New Copy of XCode and try to run your application on iOS Simulator from VSCode. You may see this error: Warning: CocoaPods not installed. Skipping pod install. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install: sudo gem install cocoapods CocoaPods not installed or not in valid state....

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

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

Compress + Resize Bulk Images in python
from PIL import Image import shutil import os, sys basewidth = 1600 def compress(filename, destfilename, quality_num, cropsize = (), whitebg = False): # Make PNG Background White if whitebg: fill_color = (255,255,255) im = Image.open(filename) im = im.convert('RGBA') background = Image.new(im.mode[:-1], im.size, fill_color) background.paste(im, im.split()[-1]) # omit transparency original = background else: original = Image.open(filename) # Check PNG Images with no Trasperant Data if filename.endswith(".png"): original = original.convert('RGBA') datas = original....

Laravel Task Scheduling in Ubuntu using Cron Tabs vs Supervisor
Laravel provides a convenient way to define scheduled tasks using its task scheduler. Instead of creating a separate Linux cron entry for every Laravel command, you can define your scheduled tasks inside the Laravel application and let Laravel handle when each task should run. On Ubuntu, the most common approach is to use CronTab to execute Laravel’s schedule:run command every minute. This article focuses on two practical ways to run Laravel’s scheduler:...

Add Floating WhatsApp Button in your WordPress Website
Open functions.php from your WordPress Child Theme and add the code below: add_action('wp_footer', 'add_whatsapp_icon'); function add_whatsapp_icon() { echo'<a style="display:block;position:fixed;left:15px;bottom:10px;z-index:1000;" href="https://wa.me/918888888888?text=Hi"><img src="https://dwij.net/resources/whatsapp.svg" style="width:50px;height:50px;"></a>'; } Make sure to update Phone Number. You may also need to update whatsapp.svg url to support Cross-origin Resource Sharing (CORS). Download SVG file from https://dwij.net/resources/whatsapp.svg.