Skip to content

Instantly share code, notes, and snippets.

View jetchirag's full-sized avatar

jetchirag

View GitHub Profile
@jetchirag
jetchirag / directadmin_staff_login.php
Created February 10, 2024 22:10
Log in to DirectAdmin from WHMCS admin area module hook
<?php
/*
* Credits: https://chirag.sh
*/
add_hook('AdminClientServicesTabFields', 1, function($vars) {
$serviceid = $vars['id'];
$command = 'GetClientsProducts';
#!/bin/sh
#
# Please paste the output of this script when asking for installation related support on CyberPanel Forum
# Link: https://forums.cyberpanel.net/
#
clear; clear
echo
echo "Starting installation fault script"
echo Data: `date`
Here
@jetchirag
jetchirag / rotate.py
Last active January 15, 2018 21:11
Rotate backups files and folder older than
import os
import time
import shutil
# Declare paths below
# "{dir}": {OPTIONS}
# TYPES:
# 1: Files only
# 2: Folders only
# 3: Both
@jetchirag
jetchirag / dirUpdateCheck.py
Last active January 15, 2018 21:11
Script to ensure (upto a level) backups are working
import sendgrid
import os
import time
from sendgrid.helpers.mail import *
#import rotate
# Declare paths below
dirList = {
"/home/dir1":31,
"/home/dir2":4
@jetchirag
jetchirag / 0_reuse_code.js
Created May 6, 2017 15:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#Expire Header
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 2 hours"
</FilesMatch>
or
# Expire images header
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
// Don't reveal username when password is incorrect but username is correct.
function override_login_error(){
return '<strong>ERROR</strong>: Incorrect username or password.';
}
add_filter( 'login_errors', 'override_login_error' );
// Enable Auto Update for WordPress Core.
define( 'WP_AUTO_UPDATE_CORE', true );