Thursday, 23 April 2020

How to fix a "cURL error 28: Connection timed out" in WordPress?



My Wordpress Site Health Status check showed me some critical issues that I needed to take further look at. "The REST API request failed due to an error."

The REST API request failed due to an error

Error: cURL error 28: Operation timed out after 10000 milliseconds
 with 0 bytes received (http_request_failed)

After a lot of search results that did NOT lead me to the right direction I finally stumbled up on a short article about this subject. A few items in a list on "How to Fix" this. The most interesting line in the article mentioned the Query Monitor plugin to check the status of the HTTP API Calls in the admin page where the error is displayed. And that vas the single most helpful plugin I ever found. Within a minute I had identified the problem the problem which was I my case the WP Social Avatar plugin.

wp-social-avatar error

This Query Monitor plugin saved my day, but mostly a lot of time.

*** EDIT *** It turned out I had second plugin causing the same error. "PHP Code For Posts" that has has been closed and is no longer available for download.

--cheers
Monday, 7 October 2019

No default realm defined for Kerberos


When you connect to some old cisco routers using iterm2 on an OS X, it might takes some time before it prompts for a username. And it might also promt you with this message.
Kerberos: No default realm defined for Kerberos! 
To disable this message you need to create or edit the file .telnetrc in your home directory and add default unset autologin
$ vim ~/.telnetrc
  default unset autologin
esc : wq
Monday, 19 February 2018

WordPress Memory Exhausted Error


I've got allowed memory size exhausted error in WordPress. Well not for the first time and I guess it's not the last time.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 12288 bytes) in /home/user/public_html/wp-admin/includes/menu.php on line 65

So the I increase PHP Memory Limit in WordPress in one easy step, by editing the wp-config.php file on the WordPress site. It is located in the WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.

Add this line:

define( 'WP_MEMORY_LIMIT', '256M' );


before the line that says ‘That’s all, stop editing! Happy blogging.’

This tells WordPress to increase the PHP memory limit to 256MB And once you are done, you need to save your changes and upload your wp-config.php file back to your server, or save your file in the file managers editor.

Thursday, 15 February 2018

How to reprogramme the central locking on a Mazda 6



I ran into "key problem" with my car few days a go. The remote central locking stopped working and at first I put the blame on the battery in the key, so I changed the battery. That did not fix my problem and the remote central locking was still not working.
Now I really thought I was facing some expenses getting this fixed properly. But Internet to the rescue. After short search I found method that might be wort trying. Reprogramme the central locking.
Here are step by step instructions I found from The Car Key Man


1. Enter your car and leave the driver door open.
2. Turn the ignition key on and off three times (leave key in ignition)
3. Shut and open the door three times.
   a. You should hear the lock cycle.
4. Press one of the button two times on your key.
   a. You should hear the lock cycle.
   b. Take your second key, if you have one, and press twice.
      i. You should hear the lock cycle.
5. Turn the ignition on an off one time and take the key out.

The also have a demonstration video for this



--Cheers
Thursday, 12 October 2017

Telnet Removed in Mac OS High Sierra 10.13


Found out that telnet as been removed in Mac OS High Sierra 10.13 when I upgraded last night, which is bad for me as i work in networking and some legacy equipment still only has telnet. You can enable it with Homebrew. First, update or install Xcode from the App Store.

brew tap theeternalsw0rd/telnet
brew install telnet 

If Homebrew is not installed, it's available here >> brew.sh

Another option is to copy it from a backup, or other machine, if you have one into /usr/local/bin/

--cheers
Thursday, 19 January 2017

Change default Screenshot Save Location MacOS X


I take a lot of screenshots for different reasons. I keep some, post others on social media or I use them to illustrate my posts. The default save lcation is current users desktop, and you might find the desktop to be cluttered with the screenshot files rather quickly.

Keyboard Shortcuts to Capture a Screen Shot with Mac OS X

Save to location
⌘ Cmd + Shift + 3 - Entire screen
⌘ Cmd + Shift + 4 - Portion of the screen
⌘ Cmd + Shift + 4 then Space - Specific application window

Copy to clipbard
⌘ Cmd + Ctrl + Shift + 3 - whole screen capture
⌘ Cmd + Ctrl + Shift + 4 - selective capture
⌘ Cmd + Ctrl + Shift + 4 Space - window screen capture

How to change default Screenshot Save Location

Press ⌘ Cmd + Space to open Spotlight and type terminal or, as I prefer, iTerm 2
$ mkdir $HOME/Documents/Screenshots
$ defaults write com.apple.screencapture location $HOME/Documents/Screenshots/
$ killall SystemUIServer

You also might want to move all your existing screenshots from the desktop to your new folder.
$ mv $HOME/Desktop/Screen\ Shot\ *.png $HOME/Documents/Screenshots/.

Change the default screenshot file name

The default screenshot name is "Screen Shot 2017-01-18 at 10.56.49.png"
[Name] [date] at [time].[type] You can only change the [Name] and [type]

$ defaults write com.apple.screencapture name "Prefix Name"

Change the screenshot image type

By default, OS X saves screenshots as .png (or Portable Network Graphics) files. Valid formats: .bmp, .pdf, .jpg, .jp2, .tif, .pict, .tga and .png

$ defaults write com.apple.screencapture type jpg
Tuesday, 3 January 2017

Mac OSX keeps prompting for SSH key passphrase


So, since I upgraded my MAC to OSX 10.12.2 I always get promted for my SSH key passphrase witch is rather annoying.
$ ssh example.com
Enter passphrase for key '/Users/<username>/.ssh/id_rsa':
This passphrase was stored in Keychain and was unlocked when I unlock my MAC
By adding UseKeychain yes to your ~/.ssh/config it solves this problem.
$ cat ~/.ssh/config
Host *
  UseKeychain yes
In courtesy of  @aral on Twitter.
You can also read more about Keychain changes in Technical Note TN2449
Keychain changes
Prior to macOS Sierra, ssh would present a dialog asking for your passphrase and would offer the option to store it into the keychain. This UI was deprecated some time ago and has been removed.
Instead, a new UseKeychain option was introduced in macOS Sierra allowing users to specify whether they would like for the passphrase to be stored in the keychain. This option was enabled by default on macOS Sierra, which caused all passphrases to be stored in the keychain
--Cheers