Thursday, November 26, 2020

Bark.com appears to have set up in Australia and are sending out leads.

Yesterday I started to receive "leads" from Bark.com. Now as a business leads are good, but in this case I'm concerned about the approach. I never contacted or had even heard of Bark.com and then out of the blue I start getting leads.

The first problem is my business appears to have been included as a supplier/member without my permission or knowledge.

The second is the leads aren't particularly well targeted. The leads have mostly been for physically damaged computers (broken screens) and that's not the type of service I offer. Leads are also mostly much further than I'd consider in terms of travel.

This looks like another company that just sets up and grabs some list of suppliers and then starts promoting themselves. People will think I've signed up with them and I haven't. The old fake it til you make approach. Seems to be the way businesses work now and that's their choice. It isn't the way I like to do business. Before a company promotes my services I'd prefer the company first get my permission. People don't know I haven't signed or joined the service. I have no track record with bark.com so potential customers have no assurance I'm a quality supplier or not. Doesm't give me confidence.

Interestingly the first review I read of bark.com was a supplier who felt most leads were tyre kickers. Looks like an opportunity I'm happy to pass on and leave for others.

Kelvin Eldridge
www.OnlineConnections.com.au


Tuesday, October 20, 2020

Interesting feature in PHP where if you do a $_GET on a variable that has a zero (0) value the result is empty and not zero.

Today I noticed a divide by zero error in the error log for my Voltage Drop Calculator. That didn't make sense to me because I test to see if a value is being divided by zero before doing a divide. That's pretty basic computer programming logic.

 However the test to see if the variable was zero wasn't working. If I put a number in the Cross Section field the calculation works perfectly. When I put a zero in the Cross Section field the zero was effectively being ignored. This didn't make sense to me.

I'll admit this is a limitation of my knowledge of PHP. Each programming language has it's quirks (features) and this is one of PHP's that I missed and to be fair, it was bad programming on my part.

When receiving the variable in the URL I would then use if ( $_GET['variable']) to test to see if the variable had a value. What I didn't know was a zero value is treated as being empty. Thus when I later tested the value of the variable against zero the test was false and a divide by zero would occur because the calculation would be performed.

What I really should have done (and have now done) in the code is to test if the variable was set. I've now updated the code to be, if ( isset($_GET['variable']) ) and the code works as it should.

I'm sure if I've made this simple mistake others may also fall into this trap. Hopefully others can learn from my mistake.

Kelvin Eldridge
www.OnlineConnections.com.au



Friday, October 2, 2020

Recovering files from a corrupted SD card and an SD card Windows suggested needed formatting. The SD cards were used in a Canon camera.

A family member gave me a couple of SD cards which had become corrupted. One was not able to be read, but the other one had three folders and one very big file which had non-English characters in the file name. A good sign of corruption.

The first SD card gave the following message.

The second SD card's file directory looked like the following.



Over the years I tried a few programs so like most people I tend to go back to what I know that what's worked in the past, plus I tried Microsoft's new Windows File Recovery tool. You would think Microsoft could produce the best tools, but in this case the Windows File Recovery tool was a waste of time.

I also tried a product called RECUVA, but the product was not able to recover anything.

Another company that has produced results in the past is called EaseUS and they have a product called EaseUS Partition Master, but that product didn't help. However in the menu of this product I was able to download their EaseUS Data Recovery Wizard and with this product I was able to find 751 files I could recover from the SD card with the corruption.

I started the recovery process for a subset of the files as the website said the free version can recover up to 2GB of data. Whilst true I found it would only recover 500MB. I then checked the website again and found the 2GB feature is unlocked if you share a post on Facebook or Twitter. For a moment I thought I perhaps should have tried their free trial on their pro version. I decided to test the free trial. No help as it only scans and displays the files found. No ability to recover.

In total there was around 3GB of data that could be recovered. With a 2GB limit it meant I need to find out more information about what the family member already had and what they didn't have. It turned out they didn't need the RAW files taken by the camera. Once that information was available I was able to complete the recovery of the photos.

Full credit to EaseUS for providing the ability to recover the person's photos for them.

Now for the SD card that just gave the message it needed to be formatted, I decided to search for another program since EaseUS couldn't help. I found an open source program called PhotoRec and tried the program on both SD cards. PhotoRec was able to recover most of the photos from the corrupted SD card, and also recovered a large number of files for the SD card that gave the prompt the card needed to be formatted. The only real issue is PhotoRec does not use the original file names, but instead gives them the next sequential number. Although to be fair, having photos even if the file names don't match isn't as big an issue as not photos at all.

Both EaseUS and PhotoRec produced results, although you can never be sure of what files were missed. EaseUS was able to identify three video files that PhotoRec did not detect.

One tip I'd like to share is if your SD card gives you issues, put it aside immediately and then use a recovery program. Don't keep using the SD card otherwise files may not be able to be recovered.

Another tip is don't use your computer to format the SD cards or delete or edit files on the SD card. To use and work on the photo files copy the files to your computer. To format the card or delete files use the camera. There's a feeling that incompatibility between devices may lead to corruption.

Finally don't just keep taking photos and videos on the SD card and think they're safe. Everyone now and then take a backup copy of the SD card. One day you'll be glad you did.

Kelvin Eldridge
www.OnlineConnections.com.au

Thursday, September 17, 2020

Quick method on Windows 10 to make thumbnail for YouTube video.

When I upload videos to YouTube, a number of thumbnails are created for you to select from. Unfortunately, often the thumbnails don't highlight anything of particular interest in the video. For some time I've simply left the thumbnail as the default that was selected by YouTube. However, I thought there has to be a better way as I can't help thinking the thumbnail is an important bit of information that helps people to select a video.

Since most YouTube videos don't make much money if you're monetising them (I haven't currently reached that level), you really can't justify putting a lot of time into a thumbnail. Then the idea came to me. If I can watch the video and find the highlight, I can capture that highlight using the PrintScreen key, open Paint and paste the picture into Paint and save as a jpeg image. The saved image is perfect for YouTube and now you have a thumbnail you can upload that's much more interesting for viewers.

Kelvin Eldridge
YouTube channel



Monday, August 31, 2020

Hostgator warning message: Imagick was compiled against Image Magick version 1654 but version 1650 is loaded

On Hostgator I noticed in my site logs the following error message.

PHP Warning:  Version warning: Imagick was compiled against Image Magick version 1654 but version 1650 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0

I don't know what Image Magick is and I don't think I've done anything to invoke Image Magick. I can only think this is something that's been done on Hostgator's end and may fix itself over time.

I regularly check for error logs in case something I didn't expect/plan for, is occurring on my site. The error.log file only occurs if there's an error, so usually I just have to check for the existence of the file. Once checked I can delete the file. The error.log file then doesn't exist until another unexpected error occurs. Having an error like this means there's always an error.log file and checking every error.log file on every site I maintain, potentially every day, isn't practical.

A bit of research revealed Hostgator support for one person made the following change to their system to suppress the error message. Of course this shouldn't be necessary, but may be required as a short term fix.

https://forums.cpanel.net/threads/getting-an-imagick-error-after-update-to-php-7-3.672365/

The solution according to this post is:

Create a file called .user.ini

Type the following into the file.

 imagick.skip_version_check=true

Save the file in the top level folder for the site.

I ran this suggestion on my site www.5kmradius.com.au and it worked to remove the warning message for Imagick.

Kelvin Eldridge
www.OnlineConnections.com.au


How to redirect Hostgator site requests for http to https

One of the things that bothers me every now and then is that when I create a new site and enter www.SiteName.com.au it goes to the http site instead of the https site and that may cause some features to fail, such as location features. Then my browser remembers the http site and I end up at the site that doesn't work property, having to re-enter the site using https. For me that's an inconvenience, but for uses of my site the real concern is they'll move on thinking the site doesn't work.

To fix this issue I need to automatically redirect people to the https address if they enter the http address.

Let's use an example.

Right now I find if I type www.JustLocal.com.au (one of my sites) I end up going to http://www.justlocal.com.au and the site comes up as not secure. The site still works, but a person seeing that message may not feel comfortable. So I want to redirect a user to use https.

If you have a site on Hostgator that does this, the following is what you can do to automatically redirect users.

Log into your cPanel
Select Files
Open the folder for the site - Previously the site was under the public_html folder, but more recently sites will be found in the folder you start at in Files.
Select the file .htaccess and click Edit (always a good a good idea of taking a copy of what is already there if something goes wrong you can paste it back. A photo using you mobile phone makes a quick image copy.)
Now paste in the following lines. I paste this at the start of the .htaccess file. The first line is usually blank so I enter this starting on the second line. I don't know if the blank line makes any difference.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Save the changes and Close

Now test to see if using http in the URL is automatically redirected to https. I did this edit as I wrote this post and it worked perfectly for me. I hope this post helps you solve this issue.

Kelvin Eldridge
www.OnlineConnections.com.au

PS. Performed the same change on the site www.CoronavirusVictoria.com.au and it worked perfectly. The .htaccess file did contain lines I'd not seen before so it's important not to touch any lines in the .htaccess file that are already there.

Monday, August 10, 2020

YouTube VR/360 doesn't work with Samsung Galaxy S7. Images too far apart with Cardboard type viewer.

 I must admit getting a cheap (around $10-$12) VR viewer from Big W felt like a great bargain. I could check out VR/360 videos and see what I thought. Whilst I didn't expect the quality to be perfect, at least I didn't have to spend hundreds of dollars.

For a while this seemed to work well. Then I change to a Samsung Galaxy S7 and nothing seem to work. The images just didn't line up so I ended up with two distance images and not the two images merged into one. Something didn't seem right so today I decided to investigate.

At first I started to look for apps that could play YouTube videos in stereoscopic and after a little hunting realised this feature is actually built into YouTube. One path led to another and eventually I found a site which enabled me to set up my own QR Code for Google Cardboard.

My gut feeling was telling me the two images were too far apart. I wanted to make a QR Code for Google Cardboard (an app you can install) so I could get the two images lined up better. You can find the facility to build you own QR Code for Google Cardboard at https://arvr.google.com/cardboard/viewerprofilegenerator/.

Completing the form based on my measurements produced the same two images that were too far apart. My two lens have inter-lens measure of 65mm. I built a number of profiles and found if I had the inter-lens gap of 40, this would produce what I wanted. There may be an even better size but this was good enough for me.

Now I can watch 360VR movies using YouTube using the Samsung Galaxy S7 using my VR Viewer from Big W. I can also watch normal movies in stereoscopic which makes the movies look like they on the big screen. Pretty cool.

The following is the QR Code to set the inter-lens gap to 40.

Kelvin Eldridge
360 VR videos