Author:
erics , February 11th, 2021
## to add a single backslash in front of whatever char was matched
my $ password = q #abc'A1r%Fgt&jh[-#;
$ password = ~ s / ( [ '])/\\$1/g;
print qq#' $ password '\n#;
' abc \ 'A1r % Fgt & jh [ - '
## to double whatever char was matched
my $ password = q #abc'A1r%Fgt&jh[-#;
$ password = ~ s / ( [ '])/$1$1/g;
print qq#' $ password '\n#;
' abc '' A1r % Fgt & jh [ - '
## to convert ‘ to ‘\” for shell execution
my $ password = q #abc'A1r%Fgt&jh[-#;
$ passwordShell = ~ s / ( [ '])/$1\\$1$1/g;
print qq#' $ password '\n#;
' abc '\'' A1r % Fgt & jh [ - '
Categories: How-To's , Technology Tags: Backslash , Characters , double , double quotes , Escape , howto , perl , quote , quotes , Replace , Single , single quotes , Speci , Special , Special character , Substitute , tips
| No comments
Author:
erics , August 6th, 2018
Create a new page and set the Page Template to Blog. Add a new Custom Field to the page. Set the Name to the string query_args and the value to cat=NNN&orderby=title&order=ASC, where NNN is the ID of the desired category. Ne sure to use the PLURAL form query_args NOT query_arg Be sure to click Publish […]
Categories: How-To's , Technology Tags: Blog , Cat , Categories , Category , Custom , Custom Field , Field , howto , query_arg , query_args , Single , tips
| No comments
Author:
erics , October 21st, 2017
wordpress/wp-content/themes/yourTheme/single-yourCPTslug.php
add_action ( 'genesis_before_entry_content' , 'display_custom_fields' ) ;
function display_custom_fields ( ) {
$ jobTitle = get_field ( '_jobTitle' ) ? : '-' ;
print <<< EOT
< br style = "clear:both" / >
< p > Job Title : $ jobTitle < / p >
EOT ;
}
// Genesis Loop
genesis ( ) ;
Categories: How-To's , Technology Tags: add_action , cpt , Custom , custom post type , genesis , genesis_before_entry_content , howto , Loop , meta , POST , post type , Single , Theme , tips , WordPress
| No comments
Author:
erics , January 24th, 2016
add_action ( 'genesis_entry_content' , 'featured_post_image' , 8 ) ;
function featured_post_image ( ) {
$ categories = get_the_category ( ) ;
foreach ( $ categories as $ category ) {
// You can use slug, ID or any other identifier from the WP_Object
//if ($category->term_id == 288) {
if ( $ category -> slug == 'your-slug-here' ) {
print '<div id="sub-header-image">' ;
the_post_thumbnail ( 'post-image' ) ;
print '</div>' ;
}
}
return ;
}
Categories: How-To's , Technology Tags: Categories , Category , howto , POST , Single , Slug , tips , WordPress
| No comments
Author:
erics , January 6th, 2013
To view the Postfix deferred queue: postqueue -p To view a specific email: postcat -q {Queue ID} To delete a specific email: postsuper -d {Queue ID} Example of viewing the deferred queue and deleting a message: # postqueue -p -Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——- E15B9FC221 11627 Sun Jan 6 16:47:29 MAILER-DAEMON (connect to sight.mlorol.com[46.249.46.181]: […]
Categories: How-To's , Technology Tags: Delete , Email , postcat , PostFix , postqueue , postsuper , Single
| No comments