Top Poster
#1 ramon fincken 398
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 pEcosespedex 1
#8 khadish 1
#9 moxxx 1
#10 nistelrock 1

The time now is Mon Nov 11, 2019 11:24 pm
Ramonfincken.com Forum Index
View unanswered posts
[chrome] re-add (unhide) www in address bar
Author ramon fincken :: Posted: Thu Oct 31, 2019 1:34 pm :: Category: Ubuntu


visit
Code:
chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains


set
Omnibox UI Hide Steady-State URL Trivial Subdomains

to Disabled and restart to see the www. again.


[solution] composer "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Author ramon fincken :: Posted: Mon Sep 02, 2019 3:08 pm :: Category: Bash, perl, python and CLI linux


Code:
composer install


Code:
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?



if it is NOT your PHP (when as zip); don't forget to update your composer!!
Code:
find . -type f -name '*.php' -exec php -l {} \; |grep -v "No syntax errors detected"



Ubuntu:
Code:
/usr/local/bin/composer self-update


[date] Find booking date overlap
Author ramon fincken :: Posted: Fri Jul 05, 2019 7:24 am :: Category: PHP coding
Tagged: , ,


Booking date checker: start & end = guest wish date.
Must NOT overlap with any known availability start-end periods.


Code:

start-end is exactly the same as non-availability start-end
OR
start-end is within the range as non-availability start-end

start is within the range as non-availability start-end

end is within the range as non-availability start-end


https://pastebin.com/cjYSAGf5


[solution] WordPress a3 Lazy Load plugin Background image inline
Author ramon fincken :: Posted: Tue Jun 18, 2019 11:25 am :: Category: CMS-ses (Joomla, WordPress, etc..)


The WordPress a3 Lazy Load does not work for background images in HTML.

The lazy load javascript comes from https://github.com/ressio/lazy-load-xt

its readme shows this nice example: http://ressio.github.io/lazy-load-xt/demo/bg.htm


steps to enable background image lazy loading for WordPress:

  • Download jquery.lazyloadxt.bg.js from https://github.com/ressio/lazy-load-xt/...adxt.bg.js into yourtheme/dist/js/jquery.lazyloadxt.bg.js
  • Use this in your theme functions.php file
    Code:


    add_action( 'wp_enqueue_scripts',  'enqueue_javascripts' );

    function enqueue_javascripts() {
              /**
               * https://github.com/ressio/lazy-load-xt
               * http://ressio.github.io/lazy-load-xt/demo/bg.htm
               */
              $in_footer = true; // Overwrite any setting from a3 lazy loading
              wp_register_script( 'jquery-lazyloadxt-bg',
                  get_template_directory_uri().'/dist/js/jquery.lazyloadxt.bg.js',
                  array( 'jquery', 'jquery-lazyloadxt', 'jquery-lazyloadxt-srcset', 'jquery-lazyloadxt-extend' ),
                  A3_LAZY_VERSION,
                  $in_footer );
              wp_enqueue_script( 'jquery-lazyloadxt-bg' );
    }

  • Convert your background HTML element URL calls like:
    Code:
    style="background-image: url(image_url.jpg)"

    to:
    Code:
    data-bg="image_url.jpg"




done!


[wordpress][woocommerce] Get all order notes
Author ramon fincken :: Posted: Fri May 10, 2019 7:28 am :: Category: CMS-ses (Joomla, WordPress, etc..)


First remove the filter that does NOT allow to query the order_notes
Code:
remove_filter('comments_clauses', array( 'WC_Comments' ,'exclude_order_comments'), 10, 1 );


Now, get the comments
Code:
$comments = get_comments( [ 'post_id' => $wc_order->get_id(), 'comment_type' => 'order_note' ]);



@see class-wc-comments.php
Code:
   /**
    * Exclude order comments from queries and RSS.
    *
    * This code should exclude shop_order comments from queries. Some queries (like the recent comments widget on the dashboard) are hardcoded.
    * and are not filtered, however, the code current_user_can( 'read_post', $comment->comment_post_ID ) should keep them safe since only admin and.
    * shop managers can view orders anyway.
    *
    * The frontend view order pages get around this filter by using remove_filter('comments_clauses', array( 'WC_Comments' ,'exclude_order_comments'), 10, 1 );
    *
    * @param  array $clauses A compacted array of comment query clauses.
    * @return array
    */
   public static function exclude_order_comments( $clauses ) {
      $clauses['where'] .= ( $clauses['where'] ? ' AND ' : '' ) . " comment_type != 'order_note' ";
      return $clauses;
   }


[iptables] remove DROP block
Author ramon fincken :: Posted: Mon Apr 08, 2019 11:43 am :: Category: Bash, perl, python and CLI linux


Code:
iptables -L -nv --line-numbers

Code:
iptables -D INPUT 7


letsencrypt CertStorageError: renewal config file {} is missing a required file reference
Author ramon fincken :: Posted: Tue Aug 07, 2018 8:13 am :: Category: Bash, perl, python and CLI linux


Seeing
Code:
WARNING:letsencrypt.cli:Renewal configuration file /etc/letsencrypt/renewal/*.conf is broken. Skipping. and
Additionally, the following renewal configuration files were invalid: /path/to/conf (parsefail)


Use this and create a backup first of /etc/letsencrypt/renewal
Note that this does not work for subdomains. Only for www.domain.ext && domain.ext

Create /tmp/workingtemplate as template based on a working conf file in /etc/letsencrypt/renewal

example
Code:
# renew_before_expiry = 30 days
version = 0.26.1
archive_dir = /etc/letsencrypt/archive/THEDOMAIN
cert = /etc/letsencrypt/live/THEDOMAIN/cert.pem
privkey = /etc/letsencrypt/live/THEDOMAIN/privkey.pem
chain = /etc/letsencrypt/live/THEDOMAIN/chain.pem
fullchain = /etc/letsencrypt/live/THEDOMAIN/fullchain.pem

# Options used in the renewal process
[renewalparams]
account = YOURACCOUNTHERE
server = https://acme-v02.api.letsencrypt.org/directory
authenticator = webroot
rsa_key_size = 4096
webroot_path = /www/letsencrypt,
[[webroot_map]]
THENOWWWDOMAIN = /www/letsencrypt
THEDOMAIN = /www/letsencrypt



now use this and kick off your renewal process
Note, this list is created using a grep on '0 Aug'. Make sure to adapt that using
Code:
cd /etc/letsencrypt/renewal && ls -lah



Code:
workingtemplate=/tmp/workingtemplate
cd /etc/letsencrypt/renewal

mylist=`ls -lah | grep '    0 Aug' | awk '{print $9}'`

IFS_BAK=$IFS
IFS='
'
count=0
for domainfile in $mylist
do
   count=$((count+1))
   domainshort=${domainfile/.conf/}
   domainshortnowwww=${domainshort/www./}
   echo $count $domainshort

   cat $workingtemplate | sed -r s/THENOWWWDOMAIN/${domainshortnowwww}/g  | sed -r s/THEDOMAIN/${domainshort}/g > ${domainfile}
done

IFS=$IFS_BAK


[solution] Only allow cloudflare IP to my server
Author ramon fincken :: Posted: Sat Jul 28, 2018 5:59 pm :: Category: HTML and other markup&programming languages


Based on apache htaccess.

Code:
###
# https://www.cloudflare.com/ips/
# https://www.cloudflare.com/ips-v4
# https://www.cloudflare.com/ips-v6

#[solution] Only allow cloudflare IP to my server
#Permalink: http://www.ramonfincken.com/permalink/topic448.html

Deny from all

Allow from 103.21.244.0/22
Allow from 103.22.200.0/22
Allow from 103.31.4.0/22
Allow from 104.16.0.0/12
Allow from 108.162.192.0/18
Allow from 131.0.72.0/22
Allow from 141.101.64.0/18
Allow from 162.158.0.0/15
Allow from 172.64.0.0/13
Allow from 173.245.48.0/20
Allow from 188.114.96.0/20
Allow from 190.93.240.0/20
Allow from 197.234.240.0/22
Allow from 198.41.128.0/17

Allow from 2400:cb00::/32
Allow from 2405:8100::/32
Allow from 2405:b500::/32
Allow from 2606:4700::/32
Allow from 2803:f800::/32
Allow from 2c0f:f248::/32
Allow from 2a06:98c0::/29


# https://www.cloudflare.com/ips/
# https://www.cloudflare.com/ips-v4
# https://www.cloudflare.com/ips-v6


All times are GMT
Who is Online
Who is Online Our users have posted a total of 404 articles
We have 26 registered users
The newest registered user is MathewCow
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest   [ Administrator ]   [ Moderator ]
Most users ever online was 41 on Wed Sep 09, 2015 1:34 am
Registered Users: None
This data is based on users active over the past five minutes
Log in
Username:    Password:      Log me on automatically each visit    

New posts New posts    No new posts No new posts    Forum is locked Forum is locked
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads