Skip to content

Instantly share code, notes, and snippets.

View mhrubel's full-sized avatar
🖥️
Programming

Mahamudul Hasan Rubel mhrubel

🖥️
Programming
View GitHub Profile
@mhrubel
mhrubel / mark_zero_invoices_paid.php
Created February 8, 2019 15:00 — forked from Pierowheelz/mark_zero_invoices_paid.php
A hook for WHMCS which marks invoices which have received payment as paid, where the WHMCS system doesn't automatically mark them paid. I found that if manually associating a transaction with an invoice number in WHMCS, the invoice is not marked as paid even when there is zero total remaining. This fixes that.
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
use WHMCS\Database\Capsule;
function wb_mark_zero_invoices_paid(){
//get all unpaid invoices
$unpaid_invoices = Capsule::table('tblinvoices')->where('status', 'Unpaid')->get();
foreach( $unpaid_invoices as $inv ){
@mhrubel
mhrubel / Full Apache2, Multi PHP & MariaDB - Web Server on Ubuntu 18.04 or later
Last active September 23, 2023 19:58
Full Installation and Configuration of Apache2, Multiple PHP, MariaDB, phpMyAdmin, LetsEncrypt, HTTP/2, IonCube, Postfix, Dovecot, SPF, DKIM, Roundcube Webmail and Files Permission Commands on Ubuntu 18.04 and 18.10 Web Server
Complete Installation and Configuration of Apache2, Multiple PHP, MariaDB, phpMyAdmin, LetsEncrypt,
HTTP/2, IonCube, Postfix, Dovecot, SPF, DKIM, Roundcube Webmail and
Files Permission Commands on Ubuntu 18.04 and 18.10 Web Server
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
This is a complete Ubuntu Linux based web server for Website, PHP, SSL, TLS, Database and Email hosting purpose.
Built with the below components for good performance. Also, I tried to make it as secure as possible.
@mhrubel
mhrubel / Ubuntu Linux - Nginx Web Server - Full
Last active August 10, 2023 12:38
Install Nginx, PHP7.2-FPM, PHPmyAdmin, MariaDB, IonCube, LetsEncrypt SSL, Proftpd, Pure-FTPD, Postfix, Dovecot, SpamAssassin, Calm-V, Spam filter, Email Encryption, Email Signature, RainLoop and Roundcube Webmail, HTTP/2 on Ubuntu 18.04 / 18.10 Server (with all software's complete configuration)
Install Nginx, PHP7.2-FPM, PHPmyAdmin, MariaDB, IonCube, LetsEncrypt SSL, Pure-FTPD, Postfix, Dovecot, Email Encryption,
Email Signature, RainLoop and Roundcube Webmail on Ubuntu 18.04 / 18.10 Server (with all software's complete configuration)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
This is a complete Ubuntu Linux based web server for website hosting purpose. Built with the below components for good performance.
Also, I tried to make it as secure as possible.
DISCLAIMER: I'm making this guide just for my own purpose and needs. But, If it meets your requirements,
please feel free to use the command with your own responsibility. Remember, I'm not liable if any bad thing happens to your server.
My recommendation is to you that use the command on a testing server before using it in a production server.
@mhrubel
mhrubel / 01_postfix_installer.md
Created February 8, 2019 06:43 — forked from baronkis/01_postfix_installer.md
Postfix + Dovecot + Postgresql + Postfixadmin + Roundcube + Opendkim

Postfix Installer

Following script may be used for configuring complete and secure email server on fresh install of Ubuntu 18.04 LTS. It will probably work on other distributions using apt-get. After minor changes you'll be able to use it on other Linux distros.

What it does?

02_postfix.sh:

  • Install Postfix and configure it with TLS support.
  • Install Dovecot and configure it's transport on Postfix.
  • Download, extract and correct permissions for Postfixadmin.
  • Download, extract and correct permissions for Roundcube.
@mhrubel
mhrubel / enable_lst_debian_repo.sh
Created April 28, 2023 14:44
Added litespeedtech RPMS FOCAL repo for lsphp72 and lsphp73 into the SH script
#!/bin/bash
if [ -r /etc/os-release ]; then
echo " detecting OS type : "
. /etc/os-release
if [ $ID == "debian" ]; then
@mhrubel
mhrubel / youtube_topicIDs.md
Created May 5, 2021 11:02 — forked from stpe/youtube_topicIDs.md
YouTube Topic IDs

Music topics

  • /m/04rlf Music
  • /m/05fw6t Children's music
  • /m/02mscn Christian music
  • /m/0ggq0m Classical music
  • /m/01lyv Country
  • /m/02lkt Electronic music
  • /m/0glt670 Hip hop music
  • /m/05rwpb Independent music
There are three things to do to allow a 'service user' like www-data to login via ssh.
DISCLAIMER:
READ EVERYTHING BEFORE USE ANY COMMAND... OTHERWISE, YOU MIGHT LOSE ACCESS OF YOUR SERVER...
#Step 01
########################
#Use the below GIST and propely follow the command then come here and use below steps.
Link: https://gist.github.com/mhrubel/43825450cba521ede15d7b73cf865472
### Lets Check that swap file is already created or not
htop
## Use F10 Key from your keyboard to quit the htop screen!
## Lets create Swap file
## Use only one section from below 01 and 02 sections (1GB, 2GB)
## 01 Section - For 1GB Swap, use below commands (Section 01)
sudo fallocate -l 1G /swapfile
@mhrubel
mhrubel / Enable Root Login via SSH in Ubuntu or Debian
Last active November 7, 2019 12:34
SSH on various Linux based VPS or Dedicated server comes configured in a way that disables the root users log in. As a security precaution, it's enabled, which means that you cannot directly log in as the root user over SSH. However, In some cases, though it is just more convenient to get directly logged in as root.
### Login to your server
### Create a root user password
sudo passwd root
### Choose a strong password!****
### Lets Edit SSHD Config file
sudo nano /etc/ssh/sshd_config
### Remove the Comment (#) sign from Port and Enable the port
Port 22
### Add below text inside the file (sshd_config) under "Authentication" block
@mhrubel
mhrubel / Mr.Rap.py
Created February 8, 2019 15:06 — forked from ryanta12342221475/Mr.Rap.py
Enjoy
#!/usr/bin/env python2.7
#
# _ _ ___ _____ _ _____________ _____ _ _ _____ ___ _ _
# | | | | / _ \/ __ \| | / /_ _| ___ \ _ | \ | |_ _|/ _ \ | \ | |
# | |_| |/ /_\ \ / \/| |/ / | | | |_/ / | | | \| | | | / /_\ \| \| |
# | _ || _ | | | \ | | | /| | | | . ` | | | | _ || . ` |
# | | | || | | | \__/\| |\ \ | | | |\ \\ \_/ / |\ |_| |_| | | || |\ |
# \_| |_/\_| |_/\____/\_| \_/ \_/ \_| \_|\___/\_| \_/\___/\_| |_/\_| \_/
# ~ Tools For Hacking by Mr. SAGE