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 / 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
@mhrubel
mhrubel / 2011-08-18_whmscripts_disabling_invoice_emails.md
Created February 8, 2019 15:05 — forked from RWJMurphy/2011-08-18_whmscripts_disabling_invoice_emails.md
WHMScripts: Disabling invoice creation emails in WHMCS on a per-client basis

If you’re using WHMCS to manage your cPanel shared servers, this is probably a request that you’ve received a few times. You have clients that are set up to pay invoices automatically from their credit cards, and they’d rather not receive the “Invoice Created” or “Invoice Payment Reminder” emails every month.

Normally WHMCS only allows you to disable these emails globally but, by making use of the EmailPreSend action hook, we can set up a list of clients not to receive these.

To get started just download the following script, change the file extension to .php, edit it to set up the $client_ids and place it in your WHMCS /includes/hooks/ directory

Please note, this script doesn’t disable only the automatically sent invoice notification emails, but also blocks manual sending of these for the selected clients.

(originally posted at http://whmscripts.net/whmcs/2011/disabling-invoice-creation-emails-in-whmcs-on-a-per-client-basis/)

@mhrubel
mhrubel / disable_zero_invoices.php
Created February 8, 2019 15:01 — forked from Pierowheelz/disable_zero_invoices.php
A hook for WHMCS which disables email notifications for invoices with a zero total. Modified from existing code to use the new Capsule database handler ( http://www.whmcsjet.com/how-to-disable-invoice-generation-for-0-00-invoices/ ).
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
use WHMCS\Database\Capsule;
function disable_00_invoices($vars) {
$merge_fields = array();
$email_template_name = $vars['messagename']; # Email template name being sent
@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 / set_sub_account_info.php
Created February 8, 2019 15:00 — forked from Pierowheelz/set_sub_account_info.php
A WHMCS hook to copy Company Name and Address from Clients to Contacts (sub-accounts) upon creation of a new Contact. This ensures that invoices always show the correct Company Name and Address.
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
use WHMCS\Database\Capsule;
/*
* Copies account details from parent accounts to sub-accounts
*/
add_hook('ContactAdd', 1, "wb_setup_sub_accounts");