$ docker
The man doveadm-sync
pages are cryptic and not very well explained, as well they are missing quality real-world examples.
This gist aims to give some clarity and explanation.
Here is the command I got to successfully transfer (and sync backwards too) an email account from an old Dovecot email server to a new Dovecot email server:
To my knowledge, both servers must have a matching account already setup for this to work:
This file contains 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
#! /bin/bash | |
# ECHO COMMAND | |
# echo Hello World! | |
# VARIABLES | |
# Uppercase by convention | |
# Letters, numbers, underscores | |
NAME="Bob" | |
# echo "My name is $NAME" |
This file contains 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 | |
function get_plural($value, $singular, $plural = NULL){ | |
if($value == 1){ | |
return $singular; | |
} else { | |
if(!isset($plural)){ | |
$plural = $singular.'s'; | |
} | |
return $plural; | |
} |
This file contains 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 | |
// Custom Search Results Subheading | |
add_filter( 'custom_search_results_subheading', function( $subheading ) { | |
if ( is_search() ) { | |
global $wp_query; | |
$posts_per_page = $wp_query->query_vars['posts_per_page']; | |
$posts_found = $wp_query->found_posts; | |
if ( $posts_found ) { | |
$subheading = sprintf( | |
esc_html__( 'Displaying results 1-%1$s out of %2$s for %3$s', 'total' ), |
This file contains 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 | |
$slug = get_post_field( 'post_name', get_post() ); | |
echo $slug; | |
?> |
This file contains 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
find . -name "*.pdf" -type file -exec cp {} /path/to/directory \; |
This file contains 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
# ssh-keygen for ed25519 | |
ssh-keygen -a 100 -t ed25519 -f "/ABSOLUTE/PATH/TO/.ssh/PROFILE_SAASPROVIDER_ed25519" -C "PROFILE_SAASPROVIDER_ed25519" | |
# ssh-keygen for rsa 4096 | |
ssh-keygen -b 4096 -t rsa -f "/ABSOLUTE/PATH/TO/.ssh/PROFILE_SAASPROVIDER_rsa" -C "PROFILE_SAASPROVIDER_rsa" |
This file contains 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
// From: https://codingartistweb.com/2021/06/highlight-searched-text-with-javascript/ | |
function search() { | |
// Use the id of the input ex: text-to-search | |
let textToSearch = document.getElementById("text-to-search").value; | |
// Use the id of the source to be searched ex: paragraph | |
let paragraph = document.getElementById("paragraph"); | |
// Characters in search input to be escaped: [.*+?^${}()|[\]\\] | |
textToSearch = textToSearch.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | |
let pattern = new RegExp(`${textToSearch}`, "gi"); |
This file contains 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
#!/usr/bin/env bash | |
# From: https://stackoverflow.com/a/42956288 | |
# example: dir=/home/smith/Desktop/Test | |
parentdir=$(builtin cd $dir; pwd) |
OlderNewer