Categories
General

Self Hosted Dynamic DNS with CloudFlare

Ok, “Self Hosted Dynamic DNS” may be a bit of a stretch here. When I was looking at solutions to self host my DNS, I found out that it might fall into the realm of overkill to run a full application. If, for the sake of dabbling, you want to go the full on self hosting route, then a great option is the free and open source nsupdate.info

However we are going to achieve our end goal here via a simple bash script and a free Cloudflare account.

Categories
General Server Configuration Ubuntu

Cannot add PPA: ppa:yannubuntu/boot-repair

Cannot add PPA: ‘ppa:yannubuntu/boot-repair’

Often, when trying to reapair Windows MBR or even modify the boot order on a Ubuntu and Windows dual boot system, it is recommended to use the package “boot-repair”.

the first step in this process is adding the repository: sudo add-apt-repository ppa:yannubuntu/boot-repair

However, many people end up getting an error stating that the repository doesn’t exist: “”

Cannot add PPA: 'ppa:~yannubuntu/ubuntu/boot-repair'.
ERROR: '~yannubuntu' user or team does not exist.

How can you repair Grub if yannubuntu doesn’t exist?

Because this operation is generally recommended to be done on a live USB or disk version of the OS it is very common to forget to connect to the wifi.

If you are experiencing ” ~yannubuntu’ user or team does not exist. ” or “Cannot add PPA: ppa:yannubuntu/boot-repair”, I suggest you make sure you are on the internet first!

Categories
General

WordPress Email Error Handling

  add_action( 'wp_mail_failed', 'onMailError', 10, 1 );
function onMailError( $wp_error ) {
    echo "<pre>";
    print_r($wp_error);
    echo "</pre>";
} 

Have you ever had to debug WordPress email problems, like mail not being sent, without any apparent reason? The wp_mail function is usually used to send emails from within WordPress code. This is a pluggable function and, thus, resides in wp-includes/pluggable.php.

Debugging wp_mail in WordPress

Its default behavior prevents it from returning anything but false when sending fails for one reason or another. And that often times poses a problem when trying to debug wp_mail issues.


Debugging wp_mail() can be a lot easier with this simple method: wp_mail_failed . It will display a more helpful error message (the original phpmailer error) than WordPress will by default. Just add this function to display the real wp_mail() error. But only use this for debugging.

WordPress relies on the PHPMailer class to send email through PHP’s mail function.

Since PHP’s mail function returns very little information after execution (only TRUE or FALSE), I suggest temporarily stripping down your mv_optin_mail function to a minimum in order to see if the wp_mail functions works.

Example:

$mailResult = false;
$mailResult = wp_mail( '[email protected]', 'test if mail works', 'hurray' );
echo $mailResult;

Since you’ve tested PHP’s mail function already, the mail should arrive.

If it does not, the problem lies in the other statements of your function or in the PHPMailer class.

Categories
General

Post-processing of the image failed – WordPress

PHP Log: [17-Dec-2021 00:59:19 UTC] PHP Fatal error: Maximum execution time of 300 seconds exceeded in \site\wp-includes\functions.php on line 8179

WP Admin Error: Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.

https://wordpress.org/support/topic/files-upload-but-not-in-media-library/page/2/

Som e info about a directory cache, and multisite, added 5.6.0: https://wordpress.org/support/topic/files-upload-but-not-in-media-library/

I simply went to the function that line 8179 of wp-includes/functions.php is in and added a return statemnt as the firsat line of the function. Short term solutuion – dunno if it causes other issues, but my uploader works again. function clean_dirsize_cache( $path ) { … }

Dev Console:
Failed to load resource: the server responded with a status of 524 () asynch-upload.php wordpress multisite

Categories
General

Web.config Basics – What is it?

What is a Web.config file? How do you edit a Web.config file? Here are some Web.config Basics. A Web.config file is used to configure various settings for a website running on Microsoft IIS. It is structured using XML in a file that is separate then your website/application’s code. You can have a single Web.config, or several spread throughout folders on your site – they can assign different permissions, references, application variables, setup caching, and more!

Editing Web.Config in IIS 7