Install Amazon WorkSpaces on Linux (Ubuntu 18.04 LTS 64-bit)

Happy Friday the 13th…

1. Download the Windows .MSI installer from:
At time of this post, the Amazon WorkSpaces Client was:
Updated: 6/7/2018

Information about the Ubuntu release:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

Perform a quick package update check:

$ sudo apt update

Install wine:

$ sudo apt install wine64
$ wine64 --version
wine-3.0 (Ubuntu 3.0-1ubuntu1)

Install the Amazon WorkSpaces MSI file into the default .wine prefix:

$ wine64 msiexec /i ~/Downloads/Amazon+WorkSpaces.msi

Afterwards, remove a file that causes an application crash. (Replacing “username” with your account’s username and “.wine” if you used a different prefix):

$ rm /home/$(whoami)/.wine/drive_c/Program\ Files\ \(x86\)/Amazon\ Web\ Services\,\ Inc/Amazon\ WorkSpaces/vchan_plugins/pcoip_vchan_remoteprintclient.dll

Start the Amazon WorkSpaces client and enjoy that sweet AWS cloud WorkSpace!

Windows Anniversary – Enable Bash

Hurrah! Windows 10 (Version 10.0.14393) is here.

Prerequisites: you will need a 64-bit installation of Windows. Then you will need to have enable Developer Mode .

Start a new PowerShell window running as an Administrator. Run the following to enable the feature:

Enable-WindowsOptionalFeature -Online -FeatureName 'Microsoft-Windows-Subsystem-Linux'

Reboot your device and log back in.
Open the Start Menu, and type in “bash”.  (It points here: C:\Windows\System32\bash.exe).

The following prompt will appear:

-- Beta feature --
This will install Ubuntu on Windows, distributed by Canonical
and licensed under its terms available here:
Type "y" to continue:

If you agree, type in “y” and press <Enter>. A download will begin:

Downloading from the Windows Store... 100%
Extracting filesystem, this will take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit:
Enter new UNIX username: <username>
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
The environment will start momentarily...
Documentation is available at:

Then go to town! You’ll get a new shortcut labeled ‘Bash on Ubuntu on Windows’ which points at the bash.exe and get the initial package updates out of the way.

<username>@<hostname>:/mnt/c/Windows/System32$ sudo apt-get update
<username>@<hostname>:/mnt/c/Windows/System32$ sudo apt-get upgrade

And does ‘cmatrix’ work…?

<username>@<hostname>:/mnt/c/Windows/System32$ sudo apt-get install cmatrix cmatrix-xfont
<username>@<hostname>:/mnt/c/Windows/System32$ cmatrix

It does!

If you want to poke around from Windows, the root filesystem is located here:


T-SQL Bulk Insert From Text (TXT) File Into A Temporary Table

First, have a text file with some values you would like to BULK INSERT.
The example below is a text file called ‘animals.txt’ with contents of:


The SQL snippet:

 CREATE TABLE #TempTable (Pets CHAR(16));
 FROM 'C:\SQLTesting\animals.txt'
 ROWTERMINATOR='\r' -- Carriage Return
 SELECT Pets FROM #TempTable;
 -- Remove our temporary table.
 DROP TABLE #TempTable;



PowerShell – Calculated Property Example & Export-Csv Formatting

Import-Module MSOnline
Connect-MSOLService -Credential (Get-Credential)
$groupid = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' # A GroupID with a known single Error.
$groupdetails = Get-MSOLGroup -ObjectID $groupid -ErrorAction 'Stop'
$groupdetails | `
Select-Object ObjectID,DisplayName,GroupType,`
@{ Label='ExpandedErrorCode';Expression={$PSItem.Errors[0].ErrorDetail.ObjectErrors.ErrorRecord.ErrorCode} },`
@{ Label='ExpandedErrorDescription';Expression={$PSItem.Errors[0].ErrorDetail.ObjectErrors.ErrorRecord.ErrorDescription} }
| `
Export-Csv -LiteralFile "$env:USERPROFILE\Desktop\MyGroupFile.csv" -NoTypeInformation
Remove-Variable groupid

Running $groupdetails | Get-Member shows Name of ‘Errors’ as a MemberType of: ‘Property’, with a Definition of: ‘System.Collections.Generic.List[Microsoft.Online.Administration.ValidationError] Errors {get;set;} ‘

PowerShell – Array vs. ArrayList Performance

Let’s take a look at performance when dealing with looping over an array variable; adding a new item and overall performance.
A standard array object in PowerShell is of a fixed size when created and cannot expand automatically. When you use the “+=” operator to append an entry, a new array object is created in memory with the additional overall previous array object. This leads to a large performance hit when dealing with a large number of items and increased memory consumption. For example:

$ArrayList = New-Object -TypeName 'System.Collections.ArrayList';
$Array = @();

for($i = 0; $i -lt 10000; $i++)
$null = $ArrayList.Add("Adding item $i")
for($i = 0; $i -lt 10000; $i++)
$Array += "Adding item $i"

Recommendation: use generics!

Modifying Multivalued Attributes With PowerShell


# Get the user's Distinguished Name (DN) however you prefer.
# Utilize the above option switch to adjust.
$ADuser = [ADSI]"LDAP://SERVER-NAME-HERE/$($theUserAccount.DistinguishedName)"          
$ADuser.PutEx($ADS_PROPERTY_DELETE, "proxyAddresses", @("smtp:$"))
$ADuser.PutEx($ADS_PROPERTY_APPEND, "proxyAddresses", @("SMTP:$"))

# Commit the changes to the AD User Object:


More Debian Adventures

Tried a NetBoot install of Debian and was a big fan of this post:

The NIC in my NUC wasn’t auto-detected initially and had to use a Debian Unstable net-boot image as mentioned in this post:

PowerShell – Dispose()

You may be asking yourself “Why is that one script keeping all my RAMs?!”.

Maybe you should call the .Dispose() method on the variable to clean-up.

Another option is to use Remove-Variable .


Linux Adventures With Debian

1 – Install your distro, I am using Debian NetInst and then adding in some XFCE. A nice Terminal command for some more info:

uname -a && cat /etc/*release

2 – Patch!:

apt-get update && apt-get upgrade -y

3 – Customize your Terminal (bash) prompt:

a. Yours:


(Hidden Path) a.k.a.


b. The “root” account’s is located here:


I used this:

4. Install some themes:


5. More visuals: conky :

apt-get install conky-all

a. Custom conky files –

Your conky preferences are stored here:


Additional add-on files/scripts can be placed here (?):


6. Adding/editing repos: