SSLStream Failure with .Net 4.x in Unity 2018.1

When Unity 2018.1 was released I jumped (perhaps too quickly) to using “.Net 4.x Equivalent” for the scripting runtime version under “Build Settings->Player Settings.”

Everything ran fine in the Unity Editor, but socket reads would silently fail after a few seconds on iOS.

I use SSLStream and SSLStream.Read() in a while loop running under its own thread. This runs without any issue using IL2CPP under the .Net 3.5 runtime, but fails almost immediately under iOS using 4.x.

I’m not sure what the exact problem is, but a forum post on seems to indicate that TLS related functions aren’t going to be fully ready using the .Net 4.x runtime and IL2CPP until 2018.2:

Either way, if you come across this issue, simply reverting back to .Net 3.5 seems to resolve the problem.

Upgrading to PostgreSQL 10 on Centos 7

Here’s a quick rundown on upgrading a very simply configured PostgreSQL 9.x server to PostgreSQL 10 running on Centos 7.

First, and this goes without saying, backup your server!

In these examples, I’m using upgrading from PostgreSQL 9.5. If you’re upgrading from a different version, just replace 9.5 and 95 wherever you see it with your appropriate version number.

Install the repo RPM for PosgresSQL 10

sudo yum install

Install PosgreSQL 10

sudo yum install postgresql10-server

Stop Postgresql 9.5 and Postgresql 10

sudo systemctl stop postgresql-9.5.service && sudo systemctl stop postgresql-10.service

Initialize the PostgreSQL 10 database

sudo su postgres
cd ~/
/usr/pgsql-10/bin/initdb -D /var/lib/pgsql/10/data/

Migrate your database from the 9.x version to 10

/usr/pgsql-10/bin/pg_upgrade --old-datadir /var/lib/pgsql/9.5/data/ --new-datadir /var/lib/pgsql/10/data/ --old-bindir /usr/pgsql-9.5/bin/ --new-bindir /usr/pgsql-10/bin/

Make any necessary changes to postgresql.conf . I’d recommend making the changes to the new version rather than copying over postgresql.conf from 9.5, since there are a bunch of new options in the PostreSQL 10 version of the file.

You can view your 9.5 configuration with:

nano /var/lib/pgsql/9.5/data/postgresql.conf

You can make your changes to the 10 configuration with:

nano /var/lib/pgsql/10/data/postgresql.conf

If you need to connect from other servers, make sure to change:

#listen_addresses = 'localhost'

to (apostrophes may not survive copy/paste, may want to hand enter)

listen_addresses = '*'

(or whatever is appropriate for you)

Now do the same with pg_hba.conf

View the old configuration

nano /var/lib/pgsql/9.5/data/pg_hba.conf

Edit the new configuration

nano /var/lib/pgsql/10/data/pg_hba.conf

Start the server

systemctl start postgresql-10.service

Analyze and optimize the new cluster


If everything is working, set the PostgreSQL 10 service to start automatically

systemctl enable postgresql-10

If you wish to remove PostgreSQL 9.x and its data

sudo yum remove postgresql95-server
sudo yum remove pgdg-centos95

That should do it!

Fixing 404 Errors on WordPress with Let’s Encrypt

Since my SSL cert was nearing expiration, I thought it would be a good idea to give Let’s Encrypt (free SSL certs!) a try.

Let’s Encrypt has a helper app called certbot that will configure Apache for you automatically. The really nice thing about certbot is that it will also (via crontab) renew your cert and configure Apache to use the new cert. This is useful, since Let’s Encrypt certs expire every 90 days.

To use certbot effectively, you need an Apache configuration that’s setup the way your distro expects. Mine was not (I hand ported the configs from Ubuntu), so I figured it was a good time to reinstall Apache with the default configs, then run certbot (official instructions here: ).

This initially seemed to work great, but I quickly noticed all of my subpages returned 404 errors. WordPress works best when you allow it to configure a .htaccess file to do URL rewrites. Allowing URL rewrites via .htaccess requires some additional configuration in your ssl.conf file.

sudo nano /etc/httpd/conf.d/ssl.conf

Add the following just before </VirtualHost> at the very end of your config.

<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

Thanks to Mike McMurray who posted the instructions at:


Fix: Office Updates and Malwarebytes

If any of you are big fans of Malwarebytes (and why wouldn’t you be?) you may be experiencing crashes in Office 2013 and 2016 under Windows 10.

Microsoft has identified the problem:

The workaround is to use the latest beta of Malware Bytes:

Hope this helps!

Enabling HDR for XBox One with Samsung 4K TV

(Skip to the bottom for the instructions after my tale of woe)

Yesterday I setup a new 4K Samsung UN65KU650D TV with HDR.

Of course the 1st thing I did was to hook it up to XBox One to see it in all its 4K HDR glory! Once I selected the correct HDMI input, XBox One automatically recommended switching to 4K (very cool!). I also wanted to make sure it was also displaying in HDR.

I went to Settings > All settings > Display & sound, then chose Advanced video settings > 4K TV details as described here (

While 4K HDR was detected, HDR could could be found at any refresh rate and was therefore disabled for Video and Games. (Lots of yellows and reds, not nearly enough green checkboxes)

As you can imagine, my heart sank! But fear not, this is just some silliness on Samsung’s part, I imagine for compatibility with devices that don’t support HDR.

By default, this Samsung TV has HDR disabled for all inputs. To enable it for your XBox One (or other HDR device):

1) Turn on the TV and turn off whatever device will be using HDR.

2) Hit the Home button on your remote to bring up the menu
4khdr13) Choose the Settings icon (looks like a gear or cog)4) Choose Picture
4khdr35) Choose Expert Settings
4khdr46) Choose HDMI UHD Color
4khdr57) Choose the HDMI input you are using for your XBox One or other HDR capable device and select “On”.
Click “Close”
4khdr6 8) Turn your XBox One (or whatever) back on.
Go to Settings > All settings > Display & sound, then choose Advanced video settings > 4K TV details
It should now look like:
9) (Optional but highly recommended) Play Mass Effect: Andromeda in all its HDR glory!

Create 1 Frame Animations in Unity 3D

I was looking to make a 1 frame animation in Unity and wasn’t able to find a guide. In case anyone is curious, this is what I did:

When making a multi-frame animation, you can simply select all of the frames in a sprite and drag them to the prefab. This creates the animation for you. However, if you drag just one frame from the sprite, it will add it as a sprite renderer.

If you would likeĀ  a 1 frame animation from that sprite, right click the frame you want in the Unity Editor and click Create->Animation

Ta da! You’ve now got a 1 frame animation.

Installing Network Policy Server from PowerShell

Recently I encountered a strange error where I couldn’t install Network Policy Server from the Server Manager.

Rather than fight with Server Manager, I punted and installed it via PowerShell. The installation that way worked without an problem.

Run PowerShell as Administrator


Import-Module Servermanager


install-windowsfeature -name npas-policy-server -IncludeManagementTools

That’s it!

Fix: Unable to Auto-Update WordPress 7.1-7.2

When attempting to upgrade WordPress 7.1 to 7.2 I received the following error:

The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

A little Binging around and I found the solution here:

Just in case that site goes down, here’s what to do:

SSH into your web server and run the following 3 commands:

Reset the permissions of all files to 664:

find /path/to/site/ -type f -exec chmod 664 {} \;

Reset permissions of directories to 775:

find /path/to/site/ -type d -exec chmod 775 {} \;

Reset the group to the apache group

chgrp -R apache /path/to/site/

Fix: Windows Media Center Can’t Update

If you’re still using Window Media Center to power your OTA cable cutting hotness: go you! We are a dwindling number :p

I recently had a problem where I kept being alerted that the guide data only had 3 days left. Allowing it to download the data did not seem to fix it.

(As a side note: it was also showing the wrong program icons for TV shows.)

The fix it turns out is very simple (so you can hold off buying that Tivo Roamio OTA for now):


Delete all of the files in that folder. There will likely be 3 files and folder:

You will probably be told that you can’t delete one or more of the files because they are in use by some process.
Don’t cancel, leave that message up and continue following these instructions.

Press: Control-Alt-Delete
Choose Task Manager
Click the “Processes” tab
At the bottom, click the “Show processes from all users” button.
Click the column header that says “Image Name” to sort by name (and make your life easier).
Find the process that in the error message when you delete.
Click the process, then click the “End Process” button in the lower-right corner.

In the error message window that said you couldn’t delete, click “Try Again.”
Repeat this process until all of the files are deleted.

Launch Windows Media Center
Go to Guide
You should now see a full schedule of programs.

Restart your Windows Media Center computer to make sure all of the processes you ended are started back up correctly.

Where’d the Timer Go?

So. System.Threading.Timer. Right.

I’m really starting to miss the old System.Timers.Timer. Built like a tank. System.Threading.Timer is a bit more finicky, but is the only option in .Net Core.

My fun of the day:

It turns out, when the timer goes out of scope, it will be disposed of. Even if you’d told it to, for example, tick every 3 seconds. Though I probably should have known that.

This will tick exactly once:

private void foo()
Timer t = new Timer(bar, null, 0, 3000);

Instead, you must do:

Timer t = null;
private void foo()
t = new Timer(bar, null, 0, 3000);

Just so you don’t waste a couple of frustrating hours like I did.

Happy coding!