Skip to content

Instantly share code, notes, and snippets.

View morshadunnur's full-sized avatar
🏠
Working from home

Md. Morshadun Nur morshadunnur

🏠
Working from home
View GitHub Profile
@morshadunnur
morshadunnur / db_backup.sh
Last active August 23, 2022 19:18
Backup database and find 3 days old files and delete old files
#!/bin/bash
BACKUPDIR="/directory_path"
# assuming that /nas is mounted via /etc/fstab
if [ ! -d $BACKUPDIR ]; then
mkdir -p $BACKUPDIR
else
:
fi
@morshadunnur
morshadunnur / Install Maria DB
Created August 25, 2020 12:29
Install Maria DB on Ubuntu
// Add Repository
sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://sgp1.mirrors.digitalocean.com/mariadb/repo/10.5/ubuntu bionic main'
// Install Mariadb Server
sudo apt update
sudo apt install mariadb-server
sudo mysql -u root
@morshadunnur
morshadunnur / SwapOn
Last active June 4, 2020 10:11
Swap disk ubuntu
sudo fallocate -l 1G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
apt-get update
apt-get install python-minimal
python --version
apt-get install git-core
git --version
cd /opt
git clone https://github.com/certbot/certbot.git
cd certbot && ./certbot-auto
apt-get install letsencrypt
./certbot-auto certonly — manual — preferred-challenges=dns — email saurabh@erpnext.com — server https://acme-v02.api.letsencrypt.org/directory — agree-tos -d *.frontliner.xyz
~$ npm config set prefix ~/.npm
~$ echo 'export PATH="$HOME/.npm/bin:$PATH"' >> ~/.bashrc
~$ source ~/.bashrc
Step One:
sudo snap install docker
Latest Version
sudo snap install --edge docker
Step Two:
Docker command run without sudo
1.sudo addgroup --system docker
@morshadunnur
morshadunnur / Laravel on VestaCP.md
Created October 19, 2017 08:43 — forked from peterbrinck/Laravel on VestaCP.md
Laravel web templates for VestaCP

I've made a new web template to make Laravel work easily on VestaCP, and so I wouldn't have to change my Laravel installation, if I ever wanted to deploy it elsewhere.

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Laravel and just upload your whole project into public_html

All necessary elements:
PHP
Git
Composer
Virtual Box
Vagrant
After setting up PHP & Git just setting up composer , Virtual box and vagrant. Downloads Link
Composer https://getcomposer.org/
Virtualbox https://www.virtualbox.org/
@morshadunnur
morshadunnur / LEMP
Created December 18, 2016 19:20
Install LEMP-(Linux Nginx MySQL PHP ) stack on Ubuntu 16.04
#The LEMP software stack is a group of software that can be used in dynamic websites and web Application. This is an acronym that describes a Linux operating system with an Nginx Web Server. MySQL database stored the data and dynamic data handled by PHP.
#Imstall Nginx as web server
$ sudo apt-get update //update our local index packages
$ sudo apt-get install nginx
# If ufw firewell running we need to allow cooection to nginx.We can enable this by this
$ sudo ufw allow 'Nginx HTTP'
# MySQL Installation