Wednesday, June 10, 2020

.htaccess cook book, examples, and favourites

All of My Favourite .HTAccess Examples

Wildcard Domain Example #1

This will take your URL request, for and redirect to  Combined with an CNAME Record for @

#### URL Rewrite Handler for Subdomains (by Randall Krause) ####
RewriteCond %{HTTP_HOST} !^www\.dummysite\.com$
RewriteCond %{HTTP_HOST} ^(\w+)\.dummysite\.com$
RewriteCond %{REQUEST_URI}:%1 !^/([^/]+)/([^:]*):\1
RewriteRule ^(.*)$ /%1/$1 [QSA]

Wildcard Domain Example #2

What this does is if user visits:, it will show contents of file: If someone goes to, it will show page: but the URL will remain the same with the subdomain, like and
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC]
RewriteRule ^/?$ /user/profile.php?name=%1 [L]

Single Argument Example

## example:
## example:
RewriteRule ^cities/([a-zA-Z0-9-_]+).html$ /city-search.php?city=$1

Double Argument Example

RewriteRule ^newsreader/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)$ /readnews.php?id=$1
RewriteRule ^newspreview/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)$ /previewnews.php?id=$1


Thursday, May 7, 2020

Wordpress Showing Insecure Icon in Address Bar When Using https

Wordpress Site Shows Insecure Icon in Browser Address Bar When Using https

Here's a common scenario: you build a new wordpress site, and then decide to turn on https after it's fully built, as a result some of your image assets are still referenced with http vs https.  Chrome and Firefox will show "insecure" when they are loaded.  This is how to change that broken lock symbol to a closed lock symbol.

How to Fix

There are add-ons that will try to fix this or you can use URL re-writing, or you could edit the SQL database records and change all http to https.  My preferred method is to dump the WP_POSTMETA and WP_POSTS tables from the Wordpress SQL database, then edit the dump files with vim, then load them back in.

Dump The Tables

Dump the Tables

The dump Files
Using VIM to edit
Use this VIM command
Import them now using source command in mysql


SSH into your server, then dump the tables, then use vim to search and replace all http:// with https://, then save the file and import the tables back into mysql.

Sunday, May 3, 2020

Top Ten Newfangled Concepts in HTML User Interface Design

My List of Newfangled Concepts in HTML User Interface Design

1) React Web Framework or React JS

React is one of the newest kids on the block when it comes to user interface design and development for HTML pages. It was launched in May 2013. See the tutorial below. I am seeing more and more job ads calling for React programmers.  React is free to all. It even has a github where you can get more of it.

2) Angular JS Web Framework

Another new kid on the block.  Angular JS is now obsolete and Angular Web is the new defacto kid on the block. 

Wednesday, April 22, 2020

Find and Remove Incorrect Office 2019 Keys

Find and Remove Incorrect Office 2019 Keys

Remove a bad key that you installed previously. Using cmd.exe DOS prompt in elevated mode.

in this directory
C:\Program Files\Microsoft Office\Office16

Office 2016 / 2019: C:\Program Files\Microsoft Office\Office16
C:\Program Files (x86)\Microsoft Office\Office16
Office 2013: C:\Program Files\Microsoft Office\Office15
C:\Program Files (x86)\Microsoft Office\Office15

look for ospp.vbs
Looking for ospp.vbs

Show the keys

Now you can check the license status by running the script called ospp.vbs, which is located in your Office program folder.
cscript ospp.vbs /dstatus
(will show you the keys circled)

Remove the keys

To remove your Office product key, you need to use the /unpkeyswitch, along with the last 5 characters of the product key.
cscript ospp.vbs /unpkey:{last five characters of product key}

Using key tool


Wednesday, April 15, 2020

How to Convert Cisco 7965G from SCCP to SIP Firmware Load

SIP Firmware Load on Cisco 7965G

First Step is to get the firmware from 3CX

Then follow these steps:

When SCCP is loaded:
    Complete the following steps:

    Unplug the power cable from the phone, hold dows the # key, and
    then plug the power cable in again.

    The phone begins its power up cycle.

    Release the # key after the Speaker button is no longer

    You should see the following message on the phone:

    "Reset key sequence detected"

    Press 123456789*0# within 60 seconds after the Headset, Mute,
    and Speaker buttons begin to flash.

    If you enter this key sequence correctly, the phone displays
    this prompt:

    Keep network cfg? 1 = yes 2 = no

    In order to maintain the current network configuration settings
    for the phone when the phone resets, press 1. In order to reset the
    network configuration settings when the phone resets, press 2.

After SIP is loaded:

Unlock the Config and Set the TFTP Server:

1) Press the Settings button on your 7960 phone
2) press 9 to unlock config, or scroll down to "Unlock Config"
3) Enter "cisco" on the keypad in alpha chars
4) Press Accept button after entering the pass
6) scroll Up to Network Configuration, press Select
7) Locate "Alternate TFTP" option, change to YES
8) Locate "32 Alternate TFTP" item, and then change NO to YES, press YES button, DONT press SAVE button
9) Scroll up to "7 TFTP Server" press EDIT, press "<--"
10) enter, press ACCEPT, then SAVE
11) Phone reboots and contacts your TFTP server

Secret Keystokes for Cisco 7965G

Lock and Unlock the Configuration:  **#   (press settings button on phone then enter this)
Reboot the phone:  **#**  ( press settings button first, then enter this )
Firmware Load:  #  (press & hold # during power up until speed dial lights flash, then enter 1234567890*# )

Sample Dialplan for USA

    <TEMPLATE MATCH="0"              Timeout="1" User="Phone"/> <!-- Local operator-->
    <TEMPLATE MATCH="011*"         Timeout="6" User="Phone"/> <!-- International calls-->
    <TEMPLATE MATCH="0"            Timeout="8" User="Phone"/> <!-- PSTN Operator-->
    <TEMPLATE MATCH="11"           Timeout="0" User="Phone" Route="Emergency" Rewrite="9911"/>
    <TEMPLATE MATCH="w!"             Timeout="1" User="PHONE" Route="Emergency" Rewrite="9911"/>
    <TEMPLATE MATCH=".11"          Timeout="0" User="Phone"/> <!-- Service numbers -->
    <TEMPLATE MATCH="1.........."    Timeout="0" User="Phone"/> <!-- Long Distance -->
    <TEMPLATE MATCH="......."        Timeout="0" User="Phone"/> <!-- Local numbers -->
    <TEMPLATE MATCH="2..."           Timeout="0" User="Phone"/> <!-- Corporate Dial plan-->
    <TEMPLATE MATCH="3..."           Timeout="0" User="Phone"/> <!-- Corporate Dial plan-->
    <TEMPLATE MATCH="*"              Timeout="15"/>             <!-- Anything else -->

dialplan reference:

Here are some resources that may help

The Sepmac

Patching Asterisk to Work on Cisco Phones

Firmware is Here

Download The SCCP and SIP Firmware

Sunday, April 12, 2020

How to Make A Self Signed SSL Certificate Using apache openssl

Make Your Own Self Signed Certificate Using openssl

Step 1: use openssl command

this will make a new key called server.key and a new certificate called server.crt. the expiration will be 2 years from now.

openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout server.key -out server.crt

openssl session
This command will make a file called server.key, containing your private key, with no password, and a server certificate called server.crt.

Make a Certificate Request and A Password Protected Private key

openssl req -new -passout pass:"Secret" -keyout priv-pass.key -subj "/" -out server.csr -sha512 -newkey rsa:2048

making a new private key with password=Secret
Decrypt the private key with your password
openssl rsa -in priv-pass.key -passin pass:'Secret' | head -n2

decrypting the key


Thursday, April 9, 2020

Ellie Mae Encompass - Cannot Initialize MS Word

While Printing Custom Forms It Fails with "Cannot Initialize MS Word"

This Fix Below:

1. When attempting to print a custom doc in Encompass, change the Options drop down box, located at the bottom right of the Encompass Print window, to "Print forms with field IDs".
2. Next, click the Preview button at the bottom of the Encompass Print window.
3. Once Microsoft Word opens up, change the view from Read Mode to Print Layout (lower right corner of the Word document).
4. Close Microsoft Word.
5. Change the Options drop down box, located at the bottom right of the Encompass Print window, to "Print forms with borrower data".
6. Click Print.


-Open Regedit

-Back up HKEY_CLASSES_ROOT\TypeLib\{00020905-0000-0000-C000-000000000046}, by right-clicking on it and selecting Export. name and save the KEY in an easy to access location. This will allow you to recover the KEY is anything goes wrong.

-Delete HKEY_CLASSES_ROOT\TypeLib\{00020905-0000-0000-C000-000000000046}, by right clicking on it and selecting Delete