Skip to content

Instantly share code, notes, and snippets.

View mhrubel's full-sized avatar
💼
Open to Work

Mahamudul Hasan Rubel mhrubel

💼
Open to Work
View GitHub Profile
@mhrubel
mhrubel / address.json
Created February 8, 2019 14:08 — forked from AminulBD/address.json
Bangladdesh divisions, districts and upazila list in php array and json
{
"Rajshahi": {
"Joypurhat": [
"Akkelpur",
"Joypurhat Sadar",
"Kalai",
"Khetlal",
"Panchbibi"
],
"Bogura": [
@mhrubel
mhrubel / banglaSpellOut.php
Created February 8, 2019 14:09 — forked from AminulBD/banglaSpellOut.php
Spell out money amount in bangla word.
<?php
/**
* Convert number to word in bangla
*
* @param int $number
* @param string $after
* @param string $before
* @return string
*/
function banglaSpellOut($number = 0, $after = '', $before = '')
@mhrubel
mhrubel / wp-increase-timeout.php
Created February 8, 2019 14:12 — forked from sudar/wp-increase-timeout.php
Increase the curl timeout in WordPress
<?php
Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/
//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'bal_http_request_args', 100, 1);
function bal_http_request_args($r) //called on line 237
{
$r['timeout'] = 15;
return $r;
}
@mhrubel
mhrubel / fix-wordpress-permissions.sh
Created February 8, 2019 14:15 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@mhrubel
mhrubel / README.MD
Created February 8, 2019 14:22 — forked from AminulBD/README.MD
BD Domain ability checker with php.

(DOT) .BD DOMAIN ABILITY CHECKER

You can use this as WHMCS or other domain checker to check ability of .bd domains. This is a concept for how to create your own whois server.

WARNING: WHEN YOU USE THIS SCRIPT, YOU KNOW WHAT YOU ARE DOING. I'M NOT RESPONSIVE FOR ANY PROBLEM

First login to your server (Any distro) and install the following dependencies.

For ubuntu user:

apt-get install xinetd dnsutils php-cli

@mhrubel
mhrubel / affiliate.php
Created February 8, 2019 14:25 — forked from mgmynul/affiliate.php
WHMCS Affiliate Program
{*
**********************************************************
* Developed by: MG Mynul
* Website: https://www.mgmynul.com
**********************************************************
*}
{if $inactive}
{include file="$template/includes/alert.tpl" type="danger" msg=$LANG.affiliatesdisabled textcenter=true}
@mhrubel
mhrubel / index.php
Created February 8, 2019 14:31 — forked from agarzon/index.php
WHMCS server status script
<?php
/*
*************************************************************************
* *
* WHMCS - The Complete Client Management, Billing & Support Solution *
* Copyright (c) WHMCS Ltd. All Rights Reserved, *
* Release Date: 24th November 2011 *
* Version 5.0 *
* *
*************************************************************************
@mhrubel
mhrubel / WHMCSDecryptor.php
Created February 8, 2019 14:51 — forked from Wruczek/WHMCSDecryptor.php
Simple PHP script to decrypt WHMCS hashed strings
<?php
$encoded_string = "JATa2iUqVdzCkBP5RiyitlQlUiACl8UrpJOeGUJO";
$cc_encryption_hash = "SOmECRAZYLONGHASHROFLCOPTERBBQKTHX";
echo decrypt_whmcs($encoded_string, $cc_encryption_hash);
function decrypt_whmcs($encoded_string, $cc_encryption_hash) {
$key = md5(md5($cc_encryption_hash)) . md5($cc_encryption_hash);
$hash_key = _hash($key);
$hash_length = strlen($hash_key);
@mhrubel
mhrubel / gofas_whmcs_favicon.php
Created February 8, 2019 14:51 — forked from mauriciogofas/gofas_whmcs_favicon.php
Add favicon in WHMCS admin and Alient Area
<?php
/**
* Include custom code in template head
* © 2017 gofas.net
*
*/
// Favicon in clientarea
add_hook( 'ClientAreaHeadOutput', 1, function( $vars ) {
$gofas_clientarea_favicon = array();
<?php
/**
* Custom Affliates Redirects
* © 2017 gofas.net
*
*/
add_hook('AffiliateClickthru', 1, function($vars) {
$affiliate_id = (int)$vars['affiliateId'];
$destination = (string)'https://example.com'; // default destination after affiliate link click