Friday, October 15, 2021

Microsoft Edge Kiosk Update Kills Printing with UseSystemPrintDialog registry enabled

I found an interesting issue that happened on Microsoft Edge version 94.  Vend is setup as a cash register on a touch screen windows 10 machine, and is running in Kiosk mode, when all of a sudden printing stopped working.  Now to make edge waste as little paper as possible all margins, were disabled and to skip the page setup option that is enabled in chrome based browsers.  The issue with chrome is if you skip the page setup you end up printing the header and footer wasting a good 4 inches of paper tape, when you open the cash drawer.  Edge was able to bypass this using Kiosk mode and the following registry key.

It is located Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge

The registry key to bypass the print preview in edge kiosk mode is 

UseSystemPrintDialog  which is a dword 32bit and has a value of 1 or 0.  To do the page setup bypass the value was set to zero but since edge version 94, having the value set to 0 crashes edge printing.

https://support.vendhq.com/hc/en-us/articles/201378390-Enable-kiosk-silent-printing-for-Google-Chrome-on-Windows-Video-





With the edge updates you get the following error when you try to print a receipt or open the cash drawer with UseSystemPrintDialog enabled.







Disabling the registry key allows the printing to continue to but is a two step process where the print preview is shown.

Unfortunately, I haven't been able to fix the issue in edge in kiosk mode so I had to switch to chrome.  Using the kiosk flag, It does print without the print preview showing up but when you go to open the drawer it now prints about 4 inches and displays the header and footer, which using edge resolved.

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk https://stalbertpubliclibrary.vendhq.com/signin/ --kiosk-printing --enable-print-preview

I've also tried the @page{margin:0px, auto;} to get rid of the header but that has not worked out.

For edge a I have a similar setup as chrome.  I hope the fix for this comes soon.  In the meantime the register will have to be using chrome for now.

Below is the browser setup for edge kiosk.

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --kiosk https://stalbertpubliclibrary.vendhq.com/signin/ --edge-kiosk-type=fullscreen --kiosk-printing

For more information on the changes to Edge's kiosk mode you can find that at 


Tuesday, September 28, 2021

Changing email setting for users in google group workspaces

Logged into google workspaces. You can control how you get emails from specific google groups however sometimes users may or may not get emails from groups. Here is how to fix it.

1. Go to groups.google.com. It should automatically take you to "My Groups" if not select "My Groups"




2. Go to People -> Members

You can change subscription and posting settings here.







Under subscriptions change subscription to Each Email if you want to get the emails for all emails.



This will change or reset the email settings for the user on the google group.

Monday, September 27, 2021

"LbShrMem.FindName: invalid 'shared memory' pointer" Error when Launching Reports in Horizon on Windows 10

There is a bug in the ILS system for Horizon by SirsiDynix where for what ever reason, reports are not accessible and you get the following errors.





You will need a SirsiDynix account to view the KB https://support.sirsidynix.com/kb/164380 but essentially when you go to run reports the ILS system errors out with a LBShrMem pointer error. In the past, by that I mean going back to Windows Vista putting in a global system variable for the ILS application resolves the error.

Variable name: HzShrMemBase
Variable value: 1912602624

However under windows 10 this prevents access to the ILS application but adding and removing the variable fixes it as does running the app in legacy mode for Windows XP SP2 but this is temporary. After a reboot the issue remains persistent. Doing file system scans (SFC) and check disk also occasionally resolves the issue, but the issue remains persistent and comes back after a couple shutdown and restarts.

After doing some intense investigation into this matter it appears to be related to security and application permissions.  Unfortunately thus far the only resolution I could find had to do with running the ILS application as an administrator and for staff convivence disabling UAC.

Step 1.  - Make the user using the application a local admin as shown below.

Make use a local admin



Step 2. - Set the app to run as administrator



Step 3. - Change UAC (Reason for this is to prevent the popup prompt)



After running the ILS application like this for 3 weeks I am confident that the issue has been mitigated.  Do I recommend running an application like this?  No.  However it was consuming IT resources having to go back and disk scanning, adding/removing system variables to get the report to run.  There is extra security precautions put on to the system for monitoring and firewall blocking.  For now that is all that can be done until an application update.

Tuesday, September 14, 2021

Allowing iframes from a shared hosting server

Shared Hosting Providers

Website security is a very important thing these days.  There are lots of reasons to refuse sites from embedding your site via iframe or embed tag.  However if you have or are purchasing a paid for services like an intranet and you don't want to re-write everything to work with that services JavaScript library and security policy, an embed or iframe may just be what you need to use.  

By default, most of the shared webhosts I've used allow configuration with a .htaccess file.  Now I do recommend going though and assessing what you need to setup for your site to get done what you need to get done security wise; but in this case I need to allow for iframes from an igloo intranet site.

Typically if you have experience in setting up something like apache, you would use the x-frame header to do this; however this has changed for modern browsers, and while you may still need to add the x-frame for some legacy browsers, I'm going to be focusing on edge, chrome and firefox.

On igloo I have a embed tag, with the source going to a website which I have on a shared host.  I have a sample that can be seen below.  By default the shared hosting provider refuses the iframe connection by default.

<embed type="text/html" src="https://websiteIcontrol.ca" width="500" height="200">

On your host, edit your .htaccess file and find your mod_headers.c by default it should be something link this below.

## Suppress mime type detection in browsers for unknown types
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
</IfModule>

We want to add the following (the one highlighted in green).

## Suppress mime type detection in browsers for unknown types
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header set Content-Security-Policy: frame-ancestors 'self' https://websiteIcontrol.ca
</IfModule>

Once you add that and save the .htaccess file and when you refresh you page on igloo your iframe/embed will show up in igloo. as shown below.

For more information please refer to the links below for more information about .htaccess, x-frames and content-security policy.

https://htaccessbook.com/

https://htaccessbook.com/important-security-headers/#xframe


Friday, September 10, 2021

How to deploy a printer with zero (no) touch though Active Directory


What is zero touch or no touch deployment?  Well it is the process of configuring devices and pushing updates out to the network from a central location. As the term implies, zero-touch configuration enables IT teams to configure, or modify, hundreds or even thousands of devices remotely.  In this case a zero touch deployment of a printer to a half dozen workstations.  Now I understand there are many different ways of doing it and Microsoft has allowed this pretty far back and was mostly done with bat files and scripts.  In an effort to modernize things here is how you can do it using just your active directory.  I do have some caveats that will need to be in place first.  Also be aware that this is what Print Nightmare exploits, I will go though some mitigation things that can be done; however as always you have convince vs security.

Here are some mitigation links you can read about for the Print nightmare exploits.


  1. You will need a print server and it will have to be connected to your AD
  2. You will need properly setup security groups in your ad
  3. You will need your print servers setup with drivers installed and drivers setup for deployment.
On the print server I have everything patched as much as I can; and I have employed all the print nightmare mitigations, besides disabling the print spooler for obvious reasons.  So on your print server you should have your printer shared with proper permissions.  Here is where you set all your printer defaults for your clients, like the default paper tray, duplex, etc.



So in this case I have the administrators group for the domain, the local admin, and the organizational group that needs to print to the printer.


As you can see if it is deployed with group policy, the shows up in the "Deploy with group policy" menu item


Then in deployed printers it will show how you have the printer deployed.


Now on your active directory controller, go to the group policy object you deployed the printer to in this case "Group That needs printer"


Edit the Group policy "Group that needs printer" which we deployed our printers on from the print server.  In the Policies settings we should see the deployed printers for both users and computers because that is where we deployed them.


Now it's up to you how to want to install the printer.  You can deploy it by user or computer, in this case I am deploying it by user, if you want things to be a bit more restrictive deploying by location based computer would definitely be the way to go as the use will still have the printer if they use say a remote desktop server to connect occasionally.  In this case I do want that functionality as it was requested and approved.  In group policy go to User Configuration or Computer Configuration -> Preferences -> Control Panel Settings -> Printers


To add a printer; right click in printers -> select shared printer (which is what I want in my case you can also select an ip printer or a local printer)


Select your share path and fill out any options you need.  Such as update, create, remove, etc.  In this case I used create, and set as default printer.  



The printer should automatically deploy though group policy.  In this case, I had users already logged in get the printer with the defaults.  In this case Tray 2's uptake was not working so I disabled it in the driver and had setup tray 3 to be the default.  The deployment went quickly and easily; granted print nightmare is still a problem but we still need to use these printers, and we have all the print nightmare fixes in that we can have, so users can still use their printers.

Wednesday, August 25, 2021

SQL for recovering a pull list on Horizon ILS

The Horizon ILS has a list of holds where the report is run but if the list is not kept it is lost and you have to run a sql script to recover the list.  You will require sql studio, and a login to the database.  Once logged in.

Select your ILS DATABASE using SQL Studio or change "$ILSDatabase" in the script below to be the name of your ILS Database and it will automatically select the database for you.


        

 USE [$ILSDATABASE]

 GO

update request set fill_date = NULL, fill_location = NULL,
fill_item# = NULL where
fill_date = datediff(dd,'01 jan 1970',getdate())

and fill_location = '$location' and request_status = 0

 

Below is a sample of what the script looks like in SQL Studio.


In the script change $location with your location code that is setup in Horizon to recover the branch pull list.



Thursday, August 12, 2021

Customizing Shopify to remove the add to card button

Going with Shopify has been pretty good for my organization (in my opinion) the recurring costs of $29.99 a month for e-commerce capabilities is not overly onerous for a smaller organization. There are a couple of things I wonder if it can do but I'll have to look into that later.  For now I want to show a capability that shopify has that is pretty useful; the customization of the templates to remove the add to cart button of a product and replace it with something else.  It is a nifty and powerful feature.

So here is how I came across this.  It is a particular use case, you see the organization is putting on an event and they wanted to sell tickets to that event.  Which is why I did a post about Event Ticketing.  The organization already had a monaris account for taking debit payment, I decided to work with shopify because it tied in with monaris and there wouldn't be any additional cost to the organization besides shopify (and the monaris transaction cut).

So I setup the sales page, in a standard three row grid layout sorted by manual order.



So when we look at event one, the layout is the same more or less depending on what we put in the description field, and you can add images and other items.  By default all the product pages are the same and if you have your products organized by categories, then your suggested purchases come from the same pool


The description box shown below is what is shown under the add to cart button.


So we have our templates that are assigned to each product, and we have the ability to change the image, title and description.  We don't have the ability to change the link or the add to cart button.  

So with Event Two, if we want to change the add to cart button we will need to create a new template.  The procedure is provided by shopify but a few more graphics in their article would help a lot.


To edit the theme you need to be logged into the administration section and select customize


You will then be taken to an edit screen with your home page selected and some options for editing the page as shown below.


Then click on the 3 little dots and select edit code.


Then scroll down to templates and select "Add a new template"


Shown below is the settings for the template file.  Select Product from the drop down liquid for the template type and in this case and the example provided by shopify we are naming our file requires-contact


edit product.requires-contact.liquid you should see it under the templates section as shown below.


and replace {% section 'product-template' %} with {% section 'product-template-requires-contact' %} and hit save located on the top right of the editor window.

You can see the difference in the image below. We have the original product.liquid on the right and the new product.requires-contact.liquid on the left.


Now scroll down to the section section of the templates as shown below and click on the "Add a new section", following the shopify tutorial I called mine
"product-template-requires-contact"


With that done, click on product-template.liquid; select all and copy the code then click on product-template-requires-contact.liquid and paste the code into the file and click save.  At this point we can actually assign the template to the product we want to point to.  Since this is a one off this will work fine, however if I had several I had to do this two I would have to figure out a way of assigning the correct URL.

In the shopify admin, go to the products section and find the product you want to assign the template to.  Scroll down to the Online Store section it is under the Tags section as shown below next to pricing and inventory.  Change the template to requires-contact and hit save.  Now any changes you make to product-template-requires-contact.liquid can be viewed on that product page.



Going back and editing product-template-requires-contact.liquid here is where the shopify tutorial and I differ.  In their tutorial they want to you hide the whole product form; which I don't want to do.  I do want all the options and feel of having the add to cart button but I just don't want the "Add to cart" button.  I want to boot the user to another payment system like eventbright.

What I found is if I hide the form I also lose the suggested items, and if I hide only part of the form I lose some of the CSS on the site as shown below.  You can see the logo has a grey back ground and the suggested items are removed.


What I found is I need to edit the button section which is around line 220 as shown below.


Here is the code.  The highlighted green is what is added.

<a href="$Yourweblink" class="btn product-form__cart-submit">Buy Tickets</a>
               <button style="display:none;"  type="submit" name="add"
                {% comment %} {% unless current_variant.available %} aria-disabled="true"{% endunless %}
                  aria-label="{% unless current_variant.available %}{{ 'products.product.sold_out' | t }}{% else %}{{ 'products.product.add_to_cart' | t }}{% endunless %}"
                  class="btn product-form__cart-submit{% if section.settings.enable_payment_button and product.selling_plan_groups == empty %} btn--secondary-accent{% endif %}"
                       {% if settings.enable_ajax %}aria-haspopup="dialog"{% endif %} {% endcomment %}
                  data-add-to-cart >
                
                  <span data-add-to-cart-text>
                   {% comment %} {% unless current_variant.available %}
                      {{ 'products.product.sold_out' | t }}
                    {% else %}
                      {{ 'products.product.add_to_cart' | t }}
                    {% endunless %}
                     {% endcomment %}
                  </span>
                           
                  <span class="hide" data-loader>
                {% comment %}    {% include 'icon-spinner' %} {% endcomment %}
                  </span>
                </button>
              {% comment %}  {% if section.settings.enable_payment_button %}
                  {{ form | payment_button }}
                {% endif %} {% endcomment %}

As you can see I have commented out all the variable sections and added a css style on the actual cart button.  I created a link which has the same class as the "add to cart" button and gave it the name "Buy Tickets".  With the end result being very similar to our other product pages included the suggested items. However now we have a note on that product that the "buy tickets" button is going to route you to another site.





Thursday, August 05, 2021

Using Event Ticketing in Shopify

The organization I work for started using shopify during the pandemic, and it has been a useful tool but because of factors beyond my control it was a little tricky to setup. However now that it is been working for about 8 months now, they are looking at running an event and selling tickets through shopify, instead of using eventbright. So I found a "app" in shopify called Event Ticketing, it seems to do the trick. The setup is pretty long, but you do get a nice result after.

It would help if you had this information when you go to create your events in Event Ticketing

  • A list of events with dates, times and durations

  • Shopify Graphic, 344x521px

  • Ticket Graphics - PDF - generic logo is 800x300px

  • Apple Wallet Icon 114px x 114px

  • Apple Wallet Logo 837px x 285px

  • Apple Wallet Banner 1125px x 294 px

Events are made one at a time, with tickets and graphics being done at this time.  You can go back and edit graphics for events, though it will be easier to do it all at once.


Create Event -> Customize Ticket -> Customize Variant (Shopify Version of Product). -> Make variant active (allow it to be sold)


IMPORTANT.  Besides updating the description, status and the image DO NOT EDIT the variant.


Log into shopify and select apps





 


Select Event Ticketing


Create Event


Select the event type, give it a name, location and date





Enter Ticket Details such as price inventory, ticket type (guest, comp, online, vip, etc)




Here is where you can specify a total number of tickets to sell.  You check the box set total capacity.  In the screenshot below, you can see the inventory is no longer available on a per ticket basis.  For the purposes of most library events I would recommend specifying a specific number of free tickets first if desired then taking away from the ticket pool.  Event Ticketing can split tickets into pools, but it does so equally for the ticket types so there is no 80/20, 90/10 split or anything like that. See explaination


Below I have 2 tickets: General admission and COMP which takes from the same pool.  However it will split the tickets automatically into equal pools.  It is recommended that if you want to approach an event this way, that you have multiple ticket types much like a hockey or football game (front row, 2nd row, 3rd row, 4rth row, 5 row, comps).



Additional Options were not available in the trial.


Shopify Preview.  Below is a preview of the typical setup and below is a explanation of using total capacity.  I don’t recommend using total capacity unless seats will start being sold based on how close a person is the “stage” or event.  IE. Hockey Game bowel colours.  You can click on the preview variant to view the info..




When using the set total capacity it event ticketing doubles the number of tickets for each event.  You can see the tickets either together or separated. See below.




Hit Save to save the event.


<!--IMPORTANT--!>


Don't edit the options, values, or variants in Shopify! It is critically important that you do not edit the product options, values, variants, SKU's, or duplicate the product as this is not supported yet.


DO NOT:

  • Add, edit, or remove product options and values

  • Duplicate the product or variants

  • Add more variants

  • Change SKU's

  • Change the product type (keep as Ticket)


Doing any of the above actions will cause the app to be unable to issue and fulfill tickets.


It is SAFE to edit the description, images, price, title, tax, and tags. You may also delete variants.



<!--IMPORTANT--!> 

By Default, the variant (shopify version) is not active.  You must edit the variant and change the status from draft to active but do so only after your event is ready. (Ticket customization, etc). After finishing with setting up the event the next step is to customize the tickets.


With the tickets there two types of tickets you can use PDF and Apple Wallet



Setup PDF - You can get very fancy with the ticket setup.  The fastest and easiest way is to select standard.  


Then you will get a basic interface where you can upload a identity banner (branding) and change the label and text color.




For this example I have Location Name, Price, Event Start Date (Date & Time), Event Name and Ticket Type




Select Done when you are done editing.  You should do both the Apple Wallet and pdf version.  If you want to view this you must have a iOS device available

 

Once your ticket is customized you can update the image, status and description on variant. Click on the Event name to edit the variant.  It is recommended that you edit ONLY the description, status and image.




When you are done editing the image and description and want to make the item live, change the status from draft to active and save the variant.  If you want to see a preview select the preview button in the top right next to More actions.  Hit save to save your changes.










Crontab changes in Linux 26.04 vs previous versions

I use a small Linux server to control the turning on and shutting off our client stations with crontab.  The system I typically use is Ubunt...