Home

Never send a human to do
a machine's job

All content on this site comes from several sources.
It is a collection of code that at some point we needed.
It is not our intention to credit as ours.
Amen!

Drush Cron Already Running Issue

#Fix Cron Already Running Problem
#please replace ?text? appropriately

#log in to mysql from terminal:
mysql -u ?dbusername? -p

#Sequential mysql commands to fix:
------------------------------------
mysql> show databases;
mysql> use ?dbname?;
mysql> DELETE FROM `variable` WHERE name = 'cron_semaphore';
mysql> DELETE FROM `variable` WHERE name = 'cron_last';
mysql> exit
---------------------------------------------------

drush cc all

#Test
drush cron

How to force HTTPS using a web.config file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Redirect to https" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>

Create new wp user using the db

INSERT INTO `wp_monicarissler`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'tamberra', MD5('!!zest35TAM!!--'), 'tamberra', 'knoreika@tamberra.com', '', '', '', '0', 'tamberra);

INSERT INTO `wp_monicarissler`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

Disable Yoast features on function.php

// Remove multiple Yoast meta tags
add_filter( 'wpseo_canonical', 'remove_multiple_yoast_meta_tags' );
add_filter( 'wpseo_metadesc', 'remove_multiple_yoast_meta_tags' );
function remove_multiple_yoast_meta_tags( $myfilter ) {
    if ( is_page ( 'about' ) ) {   <-- FILTER BY SLUG
        return false;
    }
    return $myfilter;
}

To completely disable Yoast:

Docker - Update Portainer

sudo docker stop portainer
sudo docker rm portainer

Remove the portainer-ce image using the docker UI

sudo docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ce

Warning: The file will have its original line endings in your working directory

The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in ...

Generally in the Unix your end of a line is always represented with the line feed (LF). And in windows the line is always represented with the carriage return (CR) and your end of line (LF) thus (CRLF). So when you have code from git that was uploaded by the unix system then it will only have the LF.

If you want to turn warning off then you can do it by typing a below command in your git command line

Postfix commands

List all emails - you can list all mail of queue, using one of the following commands:

<strong>postqueue -p</strong>

Flush all emails - To delete or flush all emails from Postfix mail queue using the following command:

<strong>postsuper -d ALL </strong>

Flush deferred mails only - use the following command to delete deferred emails from the queue.

<strong>postsuper -d ALL deferred </strong>

vi editor - A quick cheat sheet

:x Exit, saving changes.
:w Save file.
:q Exit if no changes have been made.
:q! Exit and undo any changes made.

r Replace one character.
x Delete character to the right of cursor.
i Insert before cursor.
o Open a new line below current line.
dd Delete current line.

With Esc we can swap from command mode to input mode and viceversa.