Skip to content

Instantly share code, notes, and snippets.

View SHSharkar's full-sized avatar

Md. Sazzad Hossain Sharkar SHSharkar

View GitHub Profile
@SHSharkar
SHSharkar / list-out-the-files-in-a-directory-for-download.md
Created December 31, 2017 08:31
List Out The Files in a Directory for Download
<?php
if($handle = opendir('.')) {
    while(FALSE !== ($file = readdir($handle))) {
        if($file !== '.' && $file !== '..') {
            $list .= '<li><a href="' . $file . '">' . $file . '</a></li>';
        }
    }
    closedir($handle);
}
@SHSharkar
SHSharkar / format-pen-drive-or-flash-drive.md
Last active September 5, 2022 09:31
Format Pen-drive or Flash Drive from command line in Windows Operating System

Run command prompt or powershell as admin and type:

diskpart

select disk 1

or whatever number that corresponds to your flash drive, unless you have other external drives or more than one hard-drive in your computer, this is almost always select disk 1; to view all your disks use,

@SHSharkar
SHSharkar / git-tag.sh
Last active February 27, 2020 16:19
Git Auto Tag
#!/bin/bash
VERSION_MODE=$1
ENV_TAG_PREFIX=v
# "major": 1,
# "minor": 0,
# "revision": 0,
# "buildNumber": 1
if [ "$VERSION_MODE" = "" ] ; then
VERSION_MODE="buildNumber"
fi
@SHSharkar
SHSharkar / police-stations.php
Created May 4, 2020 15:05
Police Stations list of Bangladesh
<?php
$policeStations = ['Dhaka','Dhamrai','Dhanmondi','Gulshan','Jatrabari','Joypara','Keraniganj','Khilgaon','Khilkhet','Lalbag','Mirpur','Mohammadpur','Motijheel','Nawabganj','Kalabagan','Palton','Ramna','Sabujbag','Savar','Sutrapur','Tejgaon','Tejgaon Industrial Area','Uttara','Alfadanga','Bhanga','Boalmari','Charbhadrasan','Faridpur Sadar','Madukhali','Nagarkanda','Sadarpur','Shriangan','Gazipur Sadar','Kaliakaar','Kaliganj','Kapashia','Monnunagar','Turag','Sreepur','Sripur','Gopalganj Sadar','Kashiani','Kotalipara','Maksudpur','Muksudpur','Tungipara','Bajitpur','Kuliarchar','Bhairob','Hossenpur','Itna','Karimganj','Katiadi','Kishoreganj Sadar','Mithamoin','Nikli','Ostagram','Pakundia','Tarial','Barhamganj','Kalkini','Madaripur Sadar','Rajoir','Doulatpur','Ghior','Lechhraganj','Manikganj Sadar','Saturia','Shibloya','Singari','Gajaria','Lohajong','Munshiganj Sadar','Sirajdikhan','Sreenagar','Tangibari','Araihazar','Sonargaon','Baidder Bazar','Bandar','Fatullah','Narayanganj Sadar','Rupganj','Siddirganj',
@SHSharkar
SHSharkar / police-stations.txt
Created May 4, 2020 15:06
Police Stations list of Bangladesh - Raw Format
Dhaka
Dhamrai
Dhanmondi
Gulshan
Jatrabari
Joypara
Keraniganj
Khilgaon
Khilkhet
Lalbag
@SHSharkar
SHSharkar / my.cnf
Last active December 17, 2023 00:09
MySQL 8 Configuration for Production Use
[mysql]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set = utf8mb4
[client]
default-character-set = utf8mb4
[mysqld]
# Required Settings
@SHSharkar
SHSharkar / Laragon-MySQL-v8-x-upgrade-fix.md
Created November 28, 2021 07:23
Laragon MySQL v8.x upgrade / fix

Laragon MySQL v8.x upgrade / fix

Solution for: https://laragon.org

If you are setting up MySQL v8.x for the first time for Laragon, you will see that MySQL failed to load and asking for an upgrade the MySQL. Although showing user table not found, plugins table not found errors, etc.

To fix the problem, follow the steps accordingly.

  1. Delete Laragon MySQL data directory. If you have already existed databases, make sure to export first. Location path example: C:\laragon\data where the folder contains mysql-8. Delete the mysql-8 folder. You can also delete the mysql folder if not needed.
  2. Access to the MySQL BIN folder or add the MySQL BIN folder to the windows system environment path. Location example: C:\laragon\bin\mysql\mysql-8.0.27-winx64\bin. Open a terminal or navigate the location from Laragon's built-in terminal.
@SHSharkar
SHSharkar / DNS-over-HTTPS-DoH-MikroTik.md
Created November 30, 2021 17:56
DNS over HTTPS (DoH) - MikroTik

Setup DNS over HTTPS (DoH) - MikroTik Router

Login to MikroTik Router, Open the Terminal, and execute the following commands.

For demonstration, Cloudflare's 1.1.1.1 was used. It can change to any other DNS provider that supports DoH.

/ip dns set servers=1.1.1.1,1.0.0.1
@SHSharkar
SHSharkar / MikroTik-Router-set-DHCP-Servers-DNS-Server-from-Terminal.md
Created November 30, 2021 18:05
MikroTik Router set DHCP Servers DNS Server from Terminal

MikroTik Router set DHCP Servers DNS Server from Terminal

/ip dhcp-server network set 0 dns-server=1.1.1.1,1.0.0.1

Demonstration with Cloudflare's 1.1.1.1 DNS.

Please note, set 0 means applying the DNS Server change for interface 1. If you have multiple DHCP Server interface, you will have to mention the number of the interface. Normally starts with 0.

@SHSharkar
SHSharkar / .wslconfig
Last active January 22, 2022 07:16
Advanced settings configuration in WSL2
# C:\Users\<UserName>\.wslconfig
[wsl2]
memory=8GB
processors=4
swap=8GB
debugConsole=true