How to Determine Your LiveZilla Version Number

I am a long-time user of LiveZilla, primarily due to the availability of a Windows app. Aside from some minor quirks here and there, my biggest complaint is not being able to find the version in the Windows/web management user-interface. When I’m looking for the version, it’s usually to see if I’m running a relatively current release (fairly common administrator task). Continue reading How to Determine Your LiveZilla Version Number

Use jQuery Without Loading Scripts in Document

So, I was working on a new theme for an OpenCart store I manage. Since creating it from scratch, I decided to adhere to suggestions from Bootstrap, Google and others that advise loading content-blocking scripts at the bottom of the page instead of in the <head>.

Of course, I ran into the same problem that probably has you reading this article.

How the hell am I supposed to use ‘jQuery’ or ‘$’ before the library is loaded?! Short answer, you can’t. You can however get around the problem with this solution. Continue reading Use jQuery Without Loading Scripts in Document

How to Determine Your Actual Windows Username for Purposes Like Remote Access

I regularly use remote access tools such as LogMeIn, RemoteDesktop and TeamViewer to provide remote support for clients all over the country. Since Windows 8 arrived, getting the Windows username from clients has become increasingly difficult. More often than not I hear “I don’t know” or “my PIN is …”, neither of which provide insight to the actual username. Continue reading How to Determine Your Actual Windows Username for Purposes Like Remote Access

MYSQL: Get Flag Emoji Unicode from ISO 3166-1 Alpha-2 Country Codes

Today I had to figure out the most efficient way to generate Emoji from ISO 3166-1 Alpha-2 country codes such as US, GB, etc. I opted to go for a for 100% SQL solution.

The most efficient way to convert each ASCII letter to their Unicode Regional Indicator Symbol Letter that I determined is provided below (simplified)… Continue reading MYSQL: Get Flag Emoji Unicode from ISO 3166-1 Alpha-2 Country Codes

Adjust the Volume for Individual Windows 10 Applications

A quick run-through to show you how to adjust the volume of individual Windows applications…

  1. Right-click your “Volume” icon and select “Open Volume Mixer”
  2. Slide “Device” to 100
  3. Adjust “System Sounds” until achieving desired level
    • You will hear Windows’ “Default Beep” sound when releasing the slider. If moving the slider with your mouse wheel, click/tap bar to hear the test sound.
  4. Continue adjusting the volume for other applications

Do not see your application in the list? Open the program and perform any action that generates a sound. Sound must be internal, not a system sound (eg: alert or info message box). You should see the program in the “Applications” and make your adjustments.

LiveZilla Input Field Validation (eg: Require Email)

I realize LiveZilla has their own suggestion for performing input field validation, but here is my spin on the process.

Create `validation.php` in your main LiveZilla folder with the following code (update input field IDs accordingly)…

<?php

$debug = true;

if (isset($_GET['id']) && isset($_GET['value'])) {
    switch ($_GET['id']) {
        case '112':
            $field = 'Email';
            $valid = filter_var($_GET['value'], FILTER_VALIDATE_EMAIL);
            break;
        default:
            $field = 'Unknown';
            $valid = false;
    }

    if ($debug) {
        date_default_timezone_set('America/New_York');
        file_put_contents('./validation.log', sprintf("%s - %s (%d): %s (%s)\n", date('Y-m-d G:i:s'), $field, $_GET['id'], $_GET['value'], $valid ? 'pass' : 'fail'), FILE_APPEND);
    }
    
    echo sprintf('lz_validate_input_result(%s,%d);', $valid ? 'true' : 'false', $_GET['id']);
}

Note: Includes optional debug logging in case you need to test new fields and encounter unexpected results.

Configure LiveZilla…

  1. Server Configuration > Input Fields > Email > Validation
    • Validation Active: Checked
    • Validation URL:
      /livezilla/validation.php?id=112&value=<!–value–>
      Change “livezilla” to match your installation folder
    • Timeout: 5
    • Pass on timeout / error: Checked
    • Click Ok
  2. Click Ok or Apply

 

Better Windows Batch (.bat) File for Testing Internet Connections

I wrote a post yesterday about testing your internet connectivity using a Windows batch file, but since I cannot leave well-enough alone, I decided to keep working on it.

A few things to keep in mind…

  • The line “set ESC=” ends with a non-printable ASCII ESC character (ASCII 27; Hexadecimal 0x1B) that may not be visible in your browser. Editors like Notepad++ show non-printable characters.
  • If you add “hosts” you should also add “names” – hosts entry will be displayed otherwise.
  • hosts index should start at zero with no sequence gaps
  • The “for” loop’s “end” should match count(hosts + 1)

Continue reading Better Windows Batch (.bat) File for Testing Internet Connections

Create a Windows Batch (.bat) File to Test Your Internet Connectivity

I have been having issues with my ISP‘s WiFi router, so I decided to create a batch file I could run as-needed to check internet connectivity.

@echo off
cls
set "router=192.168.0.1"
set /p "router=Enter router IP address or press [ENTER] for default [%router%]: "
@ping %router% -n 1 | FIND "Reply"
@ping google.com -n 1 | FIND "Reply"
@ping bing.com -n 1 | FIND "Reply"
echo Press any key to exit...
pause >nul

Save that as `ping.bat` and put in somewhere convenient. Then… Continue reading Create a Windows Batch (.bat) File to Test Your Internet Connectivity

Disable SSH (Secure Shell) “root” user login Linux / cPanel / WHM

I was hardening a server this morning and decided my reference for disabling root access within Linux / cPanel / WHM may benefit someone else.

Note: Some may end up here trying to find out how to disable the WHM’s  root user login. I do not believe that is possible. Continue reading Disable SSH (Secure Shell) “root” user login Linux / cPanel / WHM

Organizing Images or Other Files with Hashed Folder Names

I finally decided to tackle a site that had over 20GB of images in a single folder. I won’t say who created this monster (whoops), but while moving the site to a new dedicated server, I decided it was time to remedy the situation.

The first issue is with anything you want to (graphically) process folders is limited greatly by the GUI and how much data needs to be processed for each request. This is why I decided a hashed folder naming convention would be the best approach. The folder names do not matter, just so long as there is reasonable grouping and/or separation. Continue reading Organizing Images or Other Files with Hashed Folder Names

Freelance Developer