Saturday, January 18, 2020

CSS Grid Layout in Stupid Internet Explorer 11 using -ms styles

How To Get Your Web Pages to Display CSS Grids in IE and Chrome

All of us web developers know that IE 10 and 11 cannot display grid layouts like FireFox and Chrome.  In fact we know that Microsoft is lagging behind on their support of standards in their IE browser. Thanks Steve and Bill!   However some of us are discovering that Edge can display them kind of correctly now.  Unfortunately, Edge is as stupid as IE.   If you developed fantastic looking grid layout pages for Chrome and do not want to revert back to old fashioned table layouts, I have the ultimate solution for you. It's called vendor extensions.
First thing to do is to drop some of your CSS into the autoprefixer to allow it to add new MS vendor extensions. Then you add your new CSS into your sheets.
If you had this CSS and it worked in Chrome, you will then add -ms-grid and -ms-grid-columns. Plus you will also add .ms-grid-row and -ms-grid-column to each row/column cell.

.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  background-color: #2196F3;
  padding: 10px;
}

Then you will get this out of the autoprefixer. just add the -ms elements to your CSS.

.grid-container {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: auto auto auto;
  grid-template-columns: auto auto auto;
  background-color: #2196F3;
  padding: 10px;
}

Then you need to add these CSS elements to tell stupid IE where to put each cell, or it will overlay everything in the first row/column. duh.

.rc11 { -ms-grid-row: 1; -ms-grid-column: 1; }
.rc12 { -ms-grid-row: 1; -ms-grid-column: 2; }
.rc13 { -ms-grid-row: 1; -ms-grid-column: 3; }
.rc21 { -ms-grid-row: 2; -ms-grid-column: 1; }
.rc22 { -ms-grid-row: 2; -ms-grid-column: 2; }
.rc23 { -ms-grid-row: 2; -ms-grid-column: 3; }
.rc31 { -ms-grid-row: 3; -ms-grid-column: 1; }
.rc32 { -ms-grid-row: 3; -ms-grid-column: 2; }
.rc33 { -ms-grid-row: 3; -ms-grid-column: 3; }
.rc41 { -ms-grid-row: 4; -ms-grid-column: 1; }
.rc42 { -ms-grid-row: 4; -ms-grid-column: 2; }
.rc43 { -ms-grid-row: 4; -ms-grid-column: 3; }
.rc51 { -ms-grid-row: 5; -ms-grid-column: 1; }
.rc52 { -ms-grid-row: 5; -ms-grid-column: 2; }
.rc53 { -ms-grid-row: 5; -ms-grid-column: 3; }

This is how these .rcNN will be used in each grid cell. This is a snippet of HTML from a form.

      <form action="registration.php" method="post" id="subForm" style="margin: 10px 0 8px;">
          <div class="grid-container">
             <div class="grid-item rc11">
             <span>First Name</span>
             <input class="f_left" type="text" name="firstname" id="firstname" value="First Name" onkeyup="clean('firstname')" onkeydown="clean('firstname')" maxlength="40"
               onfocus="javascript:if(this.value=='First Name') {this.value='';}" onblur="javascript:if(this.value=='') {this.value='First Name'}" />
             </div>

             <div class="grid-item rc12">
             <span>Last Name</span>
             <input class="f_left" type="text" name="lastname" id="lastname" value="Last Name" onkeyup="clean('lastname')" onkeydown="clean('lastname')" maxlength="40"
               onfocus="javascript:if(this.value=='Last Name') {this.value='';}" onblur="javascript:if(this.value=='') {this.value='Last Name'}" />
             </div>

             <div class="grid-item rc13">
             <span>Email Address</span>
             <input class="f_left" type="text" name="email" id="email" value="Email Address" onkeyup="clean('email')" onkeydown="clean('email')" maxlength="40"
               onfocus="javascript:if(this.value=='Email Address') {this.value='';}" onblur="javascript:if(this.value=='') {this.value='Email Address'}" />
             </div>

             <div class="grid-item rc21">
             <span>Password</span>
             <input class="f_left" type="password" name="password" id="password" value="Password" onkeyup="clean('password')" onkeydown="clean('password')" maxlength="40"
               onfocus="javascript:if(this.value=='Password') {this.value='';}" onblur="javascript:if(this.value=='') {this.value='Password'}" />
             </div>

             <div class="grid-item rc22">
             <span>Phone Number</span>
             <input class="f_left" type="text" name="phone" id="phone" value="Phone Number" onkeyup="clean('phone')" onkeydown="clean('phone')" maxlength="40"
               onfocus="javascript:if(this.value=='Phone Number') {this.value='';}" onblur="javascript:if(this.value=='') {this.value='Phone Number'}" />
             </div>

             <div class="grid-item rc23">
             <span>Company Name</span>
             <input class="f_left" type="text" name="company" id="company" value="Company Name" onkeyup="clean('company')" onkeydown="clean('company')" maxlength="40"
               onfocus="javascript:if(this.value=='Company Name') {this.value='';}" onblur="javascript:if(this.value=='') {this.value='Company Name'}" />
             </div>

This is how it looks in IE now. (this is the form)

Sunday, January 12, 2020

Use Postfix to Relay Mail Thru Godaddy SMTP Servers

How to Install and Configure Postfix to Relay Thru Godaddy SMTP

postfix logo
postfix logo
If you have an Asterisk server on Amazon ECS, you need a means to send voicemails out to email. Use postfix with a godaddy smtp server and your godaddy email credentials.

First you need to install ubuntu on an amazon ecs virtual machine. Start by setting up their free tier ubuntu 18 LTS server.  Then you need to use apt-get to install postfix and mailutils.

To install the required items:

apt install postfix
apt install mailutils
apt install cyrus-sasl-plain

Finally install some configuration files. First file to work on is /etc/postfix/main.cf
suppose your server is called asterisk.elevendimensions.com and your domain is called elevendimensions.com.   Do not change the default hostname that amazon ecs gives you.  While installing postfix, the initial dialog will ask you what kind of site to setup. Choose "internet site" you will only be using this service to send and relay outbound email.

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
readme_directory = no
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
masquerade_domains = elevendimensions.com
myhostname = asterisk.elevendimensions.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydomain = elevendimensions.com
mydestination = asterisk.elevendimensions.com, $myhostname, ip-172-16-17-0.ec2.internal, localhost.ec2.internal, localhost
relayhost = smtpout.secureserver.net:465
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all

# use godaddy smtp as a relay
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
relayhost = smtpout.secureserver.net:465

## THIS ITEM: append_dot_domain will take the domain from /etc/mailname and set your from name
append_dot_mydomain = no
# --> Setting it to yes appends the domain to the hostname

# get CA bundles https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt

Next You need to enter your Godaddy SMTP credentials in the file called sasl_password

smtpout.secureserver.net    admin@elevendimensions.com:YourPasswordGoesHere

Next you need to hash the file up with this command
postmap hash:/etc/postfix/sasl_passwd

Next we need to test it out with sendmail. send a message to johnson@yahoo.com

root@ip-172-16-17-0:/etc/postfix# /usr/sbin/sendmail -F "MIKE Martin" -f admin@elevendimensions.com johnson@yahoo.com
subject: This is a test of Postfix again
Hello There This is how we test postfix using the sendmail command == bye

.

Some Useful Tidbits of Information

reload and force a re-read of config files:  postfix reload
restart the service:  /etc/init.d/postfix reload
see the log files: more /var/log/mail.log

Known Postfix bugs


root@ip-172-16-17-0:/etc/postfix# postconf -d myhostname
myhostname = ip-172-16-17-0.localdomain
even if you set myhostname in main.cf to something else, you still get this.

If you install ssmtp, it will delete the sendmail command and softlink it to ssmtp instead.


Saturday, January 4, 2020

Windows Internal Database Service: Will Not Start and Fails with Error Code 1297

Windows Internal Database Fails to Start or Fails to Install from Server Manager

Greetings, y'all.  Recently, I started building a WSUS server on Windows Server 2012 R2. While trying to install Windows Internal Database from the Server Manager, it fails to install, yet leaves the services.msc control panel with a non-starting service called "Windows Internal Database." It refuses to start, that's why the installer refuses to finish.  I was using "Add Roles and Features" to add this service.  Curiously enough, after a reboot, the service will be removed. But, If you try to start the service before the reboot, you will see this message dialog.
Service Fails to Start

How to Fix It

In your group policy for your AD domain, make sure that "NT SERVICE\ALL SERVICES" and "everyone" is granted rights for.  Adding "Everyone" is foolish and dangerous thing to do.  Just to be safe, add a separate group policy object just for this server, so that these changes don't contaminate other servers.
  • Bypass Traverse Checking
  • Generate Security Audits
  • Logon As A Service
You can find these in:
Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment

Group Policy Object
Group Policy Object in rsop

How Do We Know This


By looking at the definition of this service in the registry, you can see this "SeChangeNotifyPriviledge" which means Bypass Traverse Checking.

Friday, January 3, 2020

Ellie Mae Encompass: Encompass Has Stopped Working, while trying to print custom forms


Encompass Crashes and Quits While Trying to Print Custom Forms

Article Number: 31474
Created On: Sep 08, 2017
Updated On: Jun 04, 2019

Details:
When attempting to print documents in Encompass the program freezes and the following error is encountered:
Encompass Has Stopped Working!

Article Details:

This error is a commonly related to the current version of Adobe on the machine. Encompass requires a version(s) of Adobe Acrobat Reader to be installed for PDF document processing. The Encompass software does not support Adobe Acrobat (the paid premium version). Both Adobe Acrobat (paid premium edition) and Adobe Acrobat Reader DC (free version) can exist on the same machine, but Adobe Acrobat Reader DC must be the default program for all PDF documents.

How to Fix


Check that a version of Adobe Acrobat Reader DC is installed on the machine:
- Windows Start menu -> Control Panel -> Programs -> Programs and Features
If a version of Adobe Acrobat Reader DC does not exist, it can be downloaded and installed through the following link: https://get.adobe.com/reader/otherversions/
If a version of Adobe Acrobat Reader DC does exist, check if Adobe Acrobat is installed as well. If so, ensure that Adobe Reader DC is set as the Default Program for all PDF documents:

- Windows Start menu -> Control Panel -> Programs -> Set your default programs
- select Adobe Acrobat Reader
- select Set this program as default
- click OK
OR
- Right Click on a PDF file
- then choose default program

Try printing through Encompass once more.

If the issue still persist, the existing installation of Adobe may be corrupt. Uninstall all versions of Adobe Acrobat and/or Adobe Acrobat Reader DC from the machine.
- Windows Start menu -> Control Panel -> Programs -> Programs and Features
- Once uninstalled, reboot the machine
- If applicable, re-install Adobe Acrobat
    Note: if your using Adobe Acrobat Pro, you will need a valid CD key for re-installation.
- Re-install Adobe Acrobat Reader
- Verify that Adobe Acrobat Reader is listed as the Default Program for all PDF documents

Try printing through Encompass once more.

An Alternative Method

Install Foxit Reader and use it to print Encompass documents instead. It works well, but is not recommended. 

Gibberish and Gobbledygook in Printed Documents

if you see gibberish and gobbledygook in your printed documents, that were produced using the paid and premium edition of Adobe Acrobat, you must choose the option to use system fonts only, or use Foxit Reader to print them instead.