Related tutorial: https://code64.de/visionerdy/wordpress-backups/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# Composer Path | |
export PATH="$PATH:$HOME/.composer/vendor/bin" |
- Make sure SSH is enabled on client server.
- Run
ssh username@websitename.com
- Run
mysqldump -u dbusername -p dbname > backup_dbname.sql
- Once inside run
rsync -avz public_html/ testservername@testserver.com:public_html/testfolder
- Log in to your test server using SSH.
- Navigate to the test site folder with
cd public_html/subdomain-folder
. - Run
find . -type f -exec chmod 644 {} \;
for files. - Run
find . -type d -exec chmod 755 {} \;
for directories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# If images not found on development site, load from production | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^wp-content/uploads/[^/]+/.+\.(jpe?g|jpg|png|gif)$ https://example.com/$0 [R=302,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.107.2", | |
"settings": { | |
"blur": 0, | |
"brightness": 100, | |
"contrast": 100, | |
"grayscale": 0, | |
"huerotate": 0, | |
"invert": 0, | |
"saturate": 100, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @link https://github.com/gatsbyjs/gatsby/issues/2753#issuecomment-387700344 | |
add_action( 'save_post', 'fireFunctionOnSave' ); | |
function fireFunctionOnSave($post_id) | |
{ | |
if(wp_is_post_revision($post_id) || wp_is_post_autosave($post_id)) { | |
return; | |
} | |
// @link https://stats.seandolinar.com/automatically-build-gatsbyjs-site-when-publishing-wordpress-post/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Abstract class which has helper functions to get data from the database | |
*/ | |
abstract class Base_Custom_Data | |
{ | |
/** | |
* The current table name | |
* | |
* @var boolean |
Files:
- index.html: example of queue (the part that is always shown)
- third-party.js: example of third party javascript (the part no one ever talks about)
Inspiration:
- google analytics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gform_pre_render', 'disable_captcha' ); | |
add_filter( 'gform_pre_validation', 'disable_captcha' ); | |
// add_filter( 'gform_pre_validation', 'disable_captcha' ); | |
// add_filter( 'gform_admin_pre_render', 'disable_captcha' ); | |
add_filter( 'gform_pre_submission_filter', 'disable_captcha' ); | |
function disable_captcha( $form ) { | |
foreach( $form['fields'] as $key => $field ) { | |
if ( $field->type === 'captcha' && wp_is_mobile() ) { | |
unset( $form['fields'][$key] ); |
Essentially just copy the existing video and audio stream as is into a new container, no funny business!
The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.
With ffmpeg
this can be achieved with -c copy
. Older examples may use -vcodec copy -acodec copy
which does the same thing.
These examples assume ffmpeg
is in your PATH
. If not just substitute with the full path to your ffmpeg binary.