Skip to content

Instantly share code, notes, and snippets.

View akramhossainrabbi's full-sized avatar

Akram Hossain akramhossainrabbi

View GitHub Profile
@akramhossainrabbi
akramhossainrabbi / .htaccess.md
Last active December 1, 2024 07:52
.htaccess for specific php version apache2

Configure your website with a specific version of PHP:

<FilesMatch \.php$>
      SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
</FilesMatch>
@akramhossainrabbi
akramhossainrabbi / remove_write_protected_directory.md
Last active December 1, 2024 07:49
Remove write-protected directory command linux.

Remove write-protected directory contains other files and directories:

rm -rf <directory name>
@akramhossainrabbi
akramhossainrabbi / chmod_777.md
Last active December 1, 2024 07:50
Can't delete a folder or file on ubuntu? Folders showing lock icon? Here's the solution.

Can't delete a folder or file on ubuntu? Showing lock icon? Here's the solution:

sudo chmod -R 777 /path
@akramhossainrabbi
akramhossainrabbi / web_config.md
Last active July 20, 2025 07:48
Configure your website or update website configuration file in Apache:

Configure your website or update website configuration file in Apache:

sudo nano /etc/apache2/sites-available/your_domain.conf
<VirtualHost *:80>
    ServerName your_domain
    ServerAlias www.your_domain 
@akramhossainrabbi
akramhossainrabbi / process_of_cloning_private_git.md
Last active January 13, 2024 12:42
Process of cloning private git repo to cpanel

Process of cloning private git repo to cpanel

Generate ssh key (cpanel terminal command)

ssh-keygen -t rsa -b 2048 -C "username@cpanelurl"

Give permission

@akramhossainrabbi
akramhossainrabbi / mysql_8_group_by.md
Last active November 22, 2023 07:27
Can't use GROUP BY in mysql 8 and above? Here's the solution!

Can't use GROUP BY in mysql 8 and above? Here's the solution!

Remove ONLY_FULL_GROUP_BY from mysql console

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Be aware that this setting is NOT persistent across restarts, then use

@akramhossainrabbi
akramhossainrabbi / reqrite_a2enmod.md
Last active November 22, 2023 07:27
.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration solution

.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration solution

sudo a2enmod rewrite && sudo service apache2 restart
@akramhossainrabbi
akramhossainrabbi / import_sql_using_command_line.md
Last active November 22, 2023 07:30
Import an SQL file using the command line in MySQL

Import an SQL file using the command line in MySQL

mysql -u username -p database_name < /path/to/file.sql
@akramhossainrabbi
akramhossainrabbi / mrdir_permission_denied.md
Last active February 18, 2024 04:16
Php mkdir(): Permission denied problem solution ubuntu

Php mkdir(): Permission denied problem solution ubuntu

sudo chown -R www-data:www-data /path/to/webserver/www
@akramhossainrabbi
akramhossainrabbi / remove_package_or_apps_from_ubuntu.md
Last active November 22, 2023 07:34
Remove Package/Application from ubantu permanently

Remove Package/Application from ubantu permanently

sudo apt-get remove name
sudo apt-get purge name
sudo apt-get autoclean