Skip to content

Instantly share code, notes, and snippets.

View stefanpejcic's full-sized avatar
:octocat:
Live long and may the source be with you

Stefan Pejcic stefanpejcic

:octocat:
Live long and may the source be with you
View GitHub Profile
@beatwiz
beatwiz / cleartrash.sh
Last active April 22, 2022 12:13
[bash] cPanel / WHM Cron bash script to delete all accounts > domains > users, trash / spam / junk emails with more than 30 days
#!/bin/bash
# All users from all domains from all accounts in /home
MAILDIRS=$(find /home/*/mail/ -type d)
# Only .Trash .Junk .Spam folders
INBOXFOLDERS=(.Trash .Junk .spam)
for basedir in $MAILDIRS; do
for ((i = 0; i < ${#INBOXFOLDERS[*]}; i++)); do
# Only cur and new folders
for dir in cur new; do
# Only if the full path to the folder exists
@Ara4Sh
Ara4Sh / cloudflare-failover.sh
Created October 12, 2016 13:49
CloudFlare A records failover script using CloudFlare api v4 (https://api.cloudflare.com) required jq and curl to run.
#!/bin/bash
# Copyright (C) 2016 Arash Shams <https://github.com/Ara4Sh>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@hackerdem
hackerdem / encrypt_1.py
Created May 14, 2016 07:45
python simple encryption and database connection example
from passlib.hash import pbkdf2_sha256
import getpass
import mysql.connector
def enc_pass(pwd):
hash=pbkdf2_sha256.encrypt(pwd,rounds=200,salt_size=16)
return hash
def con_database(pwd):
cnx=mysql.connector.connect(user='*****',password='*****',host='*******',database='******')
cursor=cnx.cursor()
try:
@rushipkar90
rushipkar90 / rushi.txt
Last active June 1, 2023 19:07
rushi.txt
prestashop - 500 error
===================
https://www.prestashop.com/forums/topic/421126-request-exceeded-the-limit-of-10-internal-redirects-due-to-probable-configuration-error/
===================
CloudFlare installation:
==========
http://www.cpanelkb.net/cloudflare-plugin-install/
http://crybit.com/install-cloudflare-plugin-on-cpanel/
http://stackoverflow.com/questions/23860877/how-to-install-cloudflare-on-cpanel-servers
@richardjoo
richardjoo / how-to-manage-exim.md
Last active December 1, 2023 07:25
my most frequently used exim commandlines
  • Print a count of the messages in the queue:

    exim -bpc

  • How to resend frozen messages in exim4 queue

    exim -bp | grep frozen | awk '{print $3}' | xargs exim -v -M

  • Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):

@sblask
sblask / ls
Created November 19, 2013 13:46
ls with list, human readable sizes, hidden files and sorting
ls -lhac
@irazasyed
irazasyed / common-cPanel-WHM-paths.md
Last active April 7, 2023 14:35
Common paths in cPanel and WHM, Useful for regular use. Source: http://www.webhostingbuzz.com/wiki/common-paths-cpanel-and-whm/ Note: I don't take any credits for this article (All credits go to the author who published it), I've just converted into markdown format for regular reference (Personal preference).

Common paths in cPanel and WHM


For those users who use cPanel/WHM on their virtual or dedicated servers the following article describes common system paths and utilities.

Paths of Base Modules


PHP /usr/bin/php

@unusorin
unusorin / whois.php
Created September 19, 2012 12:02
PHP Whois
<?php
function whois_query($domain) {
// fix the domain name:
$domain = strtolower(trim($domain));
$domain = preg_replace('/^http:\/\//i', '', $domain);
$domain = preg_replace('/^www\./i', '', $domain);
$domain = explode('/', $domain);
$domain = trim($domain[0]);