Entries Categorized as 'Technology'
Author:
erics, January 5th, 2021
|
global $wp; $slug_missing_outside_slashes = add_query_arg( array(), $wp->request ); $current_url = home_url( $slug_missing_outside_slashes ); $form_action = '/' . $slug_missing_outside_slashes . '/'; |
https://codex.wordpress.org/Determining_Plugin_and_Content_Directories
Categories: How-To's, Technology Tags: Current, howto, Page, Path, Slug, tips, URI, URL, WordPress
|
No comments
Author:
erics, December 5th, 2020
|
S.example.doTask({task:'getdata',step:2}); var S = {}; S.example.doTask = function({task = '',step = 0} = {}) { alert('Task: '+task+', 'Step: '+step); } |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
Categories: How-To's, Technology Tags: Arg, Argument, howto, JavaSvript, JS, Named parameter, param, Parameter, tips
|
No comments
Author:
erics, December 3rd, 2020
Problem While running the aws cli command from a Perl async command inside apid, I go the following error:
|
IOError: [Errno 10] No child processes |
Solution The issue turned out to be a bug in Python2.7, so I upgraded to Python3.4, then uninstalled and re-installed the aws cli software so that it used the proper Python34 version. Procedure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
sudo -i cd ## Upgrade Python yum install python34 alternatives --config python ## "Uninstall" old aws cli mv /opt/aws /opt/aws.fcs cd /usr/bin/ mv aws aws.fcs mv aws_completer aws_completer.fcs ## Install new aws cli curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip ./aws/install -i /opt/aws -b /usr/bin /usr/bin/aws --version |
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html […]
Categories: How-To's, Technology Tags: alternatives, API, apid, AWS, aws cli, AWS Linux, Broken, cli, Cloudformation, Command, Curl, Error, Exec, Execute, howto, IOError, Linux, No child processes, perl, Python, Python27, Python34, tips, Yum
|
No comments
Author:
erics, November 19th, 2020
|
$ git reset --hard HEAD~1 |
Categories: How-To's, Technology Tags: git, git revert, HEAD, Merge, Reset, Revert
|
No comments
Author:
erics, November 18th, 2020
|
yum install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm yum install mysql-community-server mysql-community-client mysql-community-common mysql-community-devel mysql-community-libs nagios-plugins-all nagios-plugins-mysql sysbench grep 'temporary password' /var/log/mysqld.log 2020-11-18T15:17:13.884662Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ujtBqhNzE0>8 mysql_secure_installation -p'ujtBqhNzE0>8' systemctl enable --now mysqld mysql -uroot -p mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'secretStr0ngPassw0rd!'; |
Categories: How-To's, Technology Tags: AWS, AWS Linux, AWS Linux 2, howto, Install, Linux, mysql, MySQL 8, tips
|
No comments
Author:
erics, November 2nd, 2020
|
clear; printf '\e[3J' && log show --predicate 'subsystem == "com.apple.TimeMachine"' --info --last 24h | grep -F 'eMac' | grep -Fv 'etat' | awk -F']' '{print substr($0,1,19), $NF}' |
Categories: How-To's, Technology Tags: cli, Extract, howto, Log, Logs, Script, Shell, Terminal, Time Machine, tips, view
|
No comments
Author:
erics, October 29th, 2020
Show All Branches, Local and Remote
Show Local Branches
Show Remote Branches
Categories: How-To's, Technology Tags: All, Branch, Branches, Display, git, git branch, git branch -a, local, remote, Show, view
|
No comments
Author:
erics, October 29th, 2020
First quit Mail, if open. In Terminal, enter the following to disable the Data Detectors which could be responsible for the hang:
|
defaults write com.apple.terminal DisableDataDetectors YES |
Categories: How-To's, Technology Tags: Freeze, Hang, howto, MacOS, macosx, select, selection, Terminal, text(), tips
|
No comments
Author:
erics, October 13th, 2020
The first query gets all custom publication posts that have a value in field book_seq ordered by book_seq The second query gets all custom publication posts that have no meta value for book_seq or no meta record for key book_seq ordered by post_title.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
$querytop = get_posts(array( 'post_type' => 'publication', 'numberposts' => -1, 'orderby' => 'meta_value', 'meta_key' => 'book_seq', 'order' => 'ASC', 'meta_query' => array( // meta query takes an array of arrays, watch out for this! array( 'key' => 'book_seq', 'value' => array('', 'NULL'), 'compare' => 'NOT IN' ) ) )); $querybottom = get_posts(array( 'post_type' => 'publication', 'numberposts' => -1, 'orderby' => 'post_title', 'order' => 'ASC', 'meta_query' => array( // meta query takes an array of arrays, watch out for this! 'relation' => 'OR', array( 'key' => 'book_seq', 'compare' => 'NOT EXISTS' ), array( 'key' => 'book_seq', 'value' => array('', 'NULL'), 'compare' => 'IN' ) ) )); $store_query = array_merge($querytop, $querybottom); |
Great article here: https://rudrastyh.com/wordpress/meta_query.html
Categories: How-To's, Technology Tags: get_posts, meta_query, Or, php, Query, search, Store, WordPress
|
No comments
Author:
erics, October 11th, 2020
Format the new USB flash drive as Mac OS Extended (Journaled) and label it “MyVolume” Click the Mojave Download Link: https://itunes.apple.com/us/app/macos-mojave/id1398502828?ls=1&mt=12 Download the installer package from the App store – it will land in the main /Applications folder. Open Terminal and run:
|
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume |
Full article at Apple Support “How to create a bootable installer for […]
Categories: How-To's, Technology Tags: apple, boot, Bootable, Catalina, createinstallmedia, Download, Drive, Flash, High Sierra, Install, Mac, MacOS, macosx, Mojave, Reinstall, Terminal, USB
|
No comments