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 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
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, August 10th, 2020
For more information about Tagging in GIT, please visit: https://git-scm.com/book/en/v2/Git-Basics-Tagging Add an Annotated Tag:
|
git tag -a v1.0.0 -m "Software version 1.0.0" git show v1.0.0 |
Add a Lightweight Tag:
|
git tag v1.0.1 git show v1.0.1 |
Show all tags:
Push all tags:
Add a Tag Later:
|
git log --pretty=oneline git tag v1.0.2 5370c8da4095fefad7476fa1c226a309dd00a9f7 git tag -a v1.0.2 5370c8da4095fefad7476fa1c226a309dd00a9f7 fatal: tag 'v1.0.2' already exists git tag -d v1.0.2 Deleted tag 'v1.0.2' (was 5370c8d) git tag -a v1.0.2 5370c8da4095fefad7476fa1c226a309dd00a9f7 git push origin --tags |
Use a Tag:
|
git checkout -b {new branch name} {tag name} git checkout -b v1.0.2-from-tag v1.0.2 |
Categories: How-To's, Technology Tags: git, howto, Tag, Tags, tips
|
No comments
Author:
erics, August 6th, 2020
Disable NOW in vim:
To disable auto-comments permanently, add the following line to ~/.vimrc:
|
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o |
To see the current settings:
Visit https://vim.fandom.com/wiki/Disable_automatic_comment_insertion for more information!
Categories: How-To's, Technology Tags: Auto-Comment, Comment, Comment Insertion, Comments, Disable, howto, Stop, tips, turn off, vim
|
No comments
Author:
erics, August 3rd, 2020
|
convert BIA_Plate_Number_Checklist_1-20000.pdf[0-819] new.pdf |
Categories: How-To's, Technology Tags: convert, howto, ImageMagick, PDF, Remove, tips
|
No comments
Author:
erics, July 22nd, 2020
dscacheutil -flushcache System Preferences -> Network -> Advanced -> DNS -> Add 1.1.1.1, 8.8.4.4 and 8.8.8.8 at the top. If they are already there, CHANGE THE ORDER!
Categories: How-To's, Technology Tags: 10.14, Cache, dig, DNS, dscacheutil, Flush, flushcache, howto, lookup, MacOS, Mojave, Ping, tips, util
|
No comments