Skip to content

Instantly share code, notes, and snippets.

View raihan-uddin's full-sized avatar
🎯
Focusing

Md. Raihan Uddin raihan-uddin

🎯
Focusing
View GitHub Profile
@raihan-uddin
raihan-uddin / Ubuntu 22.04 Meilisearch Installation.md
Created June 5, 2024 11:25
Ubuntu 22.04 Meilisearch Installation.md
@raihan-uddin
raihan-uddin / Install Multiple PHP Versions run parallel USING .htaccess or separate VIRTUAL HOST for each, Ubuntu.md
Last active May 28, 2024 08:16
Install Multiple PHP Versions run parallel USING .htaccess / separate VIRTUAL HOST for each, Ubuntu

Multiple PHP version install in Ubuntu. Apache2, Apache. Changing php version using .htaccess & keeping or settingup using separe virtual host for each php version.

Commands and points are below

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update -y
@raihan-uddin
raihan-uddin / How to Run Multiple PHP Versions .md
Last active May 28, 2024 06:14
How to Run Multiple PHP Versions with Apache on Ubuntu 24.04/ 22.04 / 20.04 / 18.04

Prerequisites You should already have Apache installed and serving web pages before following this guide.

This guide was tested on Ubuntu 24.04, Ubuntu 22.04, Ubuntu 20.04 and Ubuntu 18.04, though it should also be useful for other Debian-based systems.

If you need to install Apache on Ubuntu, please see:

  1. Add Repository The software-properties-common package is required to add Ondřej’s PHP repository, which will allow us to download co-installable versions of PHP.
@raihan-uddin
raihan-uddin / gist:8fc69bc117eb00e75d8b6ef724c4c262
Created December 26, 2023 07:41
Speed Up MySQL import for Large dump file (.sql)
I use linux ( ubuntu ) as my Primary Environment. Recently, I had to import a very large Mysql dump file (40.5GB .sql) in my local environment. Normally, it was taking couple of hours (4/5 hours). I would be happy with that ( as we dont need to import db regularly), but my dump file had couple of errors which was inturrpting import process.
So keeping the following notes for my personal usage. But that might help others also.
Below are the steps to follow, to speed up the process.
# OPEN THIS FILE
sudo gedit /etc/mysql/my.cnf

Activate Windows 8, 8.1, 10 and 11 Pro for Free

A guide how to get and activate Windows 8, 8.1, 10 and 11 Pro for free!

NOTE

If you see the Windows keyboard button in this guide; and you can't find it on your keyboard, you likely have/had Windows 10 which has the button . If you can't find that one, you likely have a PC that has been upgraded to Windows 8/8.1/10/11 from Windows 8.1/8/7/Vista/XP and other ones. If you have one of those, refer the Windows key button to as yours. A list of them is below:

Windows key buttons

- Windows 11

- Windows 10

$transaction = Yii::app()->db->beginTransaction();
try {
if (!$model->save()) {
throw new Exception('Model cannot be saved.');
}
if (!$anothermodel->save()) {
throw new Exception('Anothermodel cannot be saved.');
}
$transaction->commit();
@raihan-uddin
raihan-uddin / calender.sql
Created July 31, 2022 09:35
MySQL calendar generate
SET FOREIGN_KEY_CHECKS = 0;
/* Drop Tables */
DROP TABLE IF EXISTS calendar CASCADE;
/* Create Tables */
CREATE TABLE calendar (
id DATE NOT NULL,
year SMALLINT NOT NULL,
DELIMITER $$
CREATE EVENT employeeResign
ON SCHEDULE EVERY 2 MINUTE
DO
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE rowId INT;
DECLARE employeeId INT;
ALTER TABLE `employees` ADD `last_increment_date` DATE NULL DEFAULT NULL AFTER `signature_by`, ADD `last_increment_amount` DOUBLE NULL DEFAULT NULL AFTER `last_increment_date`;
ALTER TABLE `employees` CHANGE `contact_end` `contact_end` DATE NULL DEFAULT NULL;
ALTER TABLE `complain_sheet2` CHANGE `qc_remarks` `qc_remarks` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
https://averagelinuxuser.com/after-installing-ubuntu-20-04/
https://ubuntuhandbook.org/index.php/2021/10/top-things-ubuntu-21-10-desktop/
php multiple version on same time
https://devanswers.co/run-multiple-php-versions-on-apache/
php switch version
https://tecadmin.net/install-php-ubuntu-20-04/