Show windows side by side in windows 10

  1. Press and hold Windows logo key.
  2. Press the left or right arrow key.
  3. Press and hold Windows logo key + Up arrow key to snap the window to the top halves of the screen.
  4. Press and hold Windows logo key + Down arrow key to snap the window to the bottom halves of the screen.
  5. Press Windows logo key + Up arrow key twice to maximize the window.
  6. Press Windows logo key + Down arrow key twice to minimize the window.

    https://answers.microsoft.com/en-us/windows/forum/windows_10-start/show-windows-side-by-side-in-windows-10/4d437298-310f-4429-9297-328406a2e941

Surprisingly Complicated: Export from VMWare, Import into vSphere

Create an .ovf template from a VMWare VM.
C:\Program Files\VMware\VMware OVF Tool> .\ovftool.exe -tt=OVF c:\vms\my-virtual-machine.ova c:\vms\OVF

Download a template from vSphere to help make sure all of the Item nodes such as VirtualSystemType, disk controllers and network settings are correct.
.\ovftool.exe vi://my.name:’password’@server.domain.com/my-datacenter/host/my-cluster/Resources/my-collection/my-vm c:\OVF\my-vm.ovf

Comparing the two, edit my-virtual-machine.ovf and change relevant nodes to:

<System>
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
<vssd:InstanceID>0</vssd:InstanceID>
<vssd:VirtualSystemIdentifier>orkos.2.rhel.virtual-machine</vssd:VirtualSystemIdentifier>
<vssd:VirtualSystemType>vmx-13</vssd:VirtualSystemType>
</System>

Watch your InstanceIDs. They must be unique.

Delete and recreate the manifest file: my-virtual-machine.mf
c:\Program Files\OpenSSLCommandPrompt> openssl sha1 *.vmdk *.ovf > my-virtual-machine.mf

Import your converted VM to vSphere
C:\Program Files\VMware\VMware OVF Tool> .\ovftool.exe –acceptAllEulas –datastore=”datastore” –ipProtocol=”IPv4″ –ipAllocationPolicy=”fixedPolicy” –vmFolder=”Discovered virtual machine” –name=”my-virtual-machine” C:\vms\OVF\my-virtual-machine\my-virtual-machine.ovf vi://my.name:’password’@server.domain.com/my-datacenter/host/my-cluster/Resources/my-collection/

Process to Submit an App Hosted on Ubuntu 16.04 to AWS Marketplace

Preparing the VM

  1. Import the virtual-machine.ova into VMWare Workstation.
  2. Start the VM and login
  3. Remove the GUI and all unnecessary services 
    1. sudo apt purge -y ubuntu-desktop unity gnome-shell lightdm account-plugin-aim account-plugin-facebook account-plugin-flickr account-plugin-google account-plugin-jabber account-plugin-salut account-plugin-yahoo avahi-autoipd avahi-daemon avahi-utils bluez bluez-cups bluez-obexd gnome-bluetooth cups* empathy* evolution* firefox gnome*
    2. sudo apt -y autoclean autoremove clean 
  4. Update repos
    1. sudo apt-get update
  5. Fix Spectre/Meltdown without full upgrade which would break the app
    1. sudo apt install -y amd64-microcode linux-aws linux-euclid linux-gcp linux-gke linux-goldfish linux-kvm linux-oem qemu
  6. Install AWS requirements
    1. AWSCLI
      1. sudo apt install -y awscli
    2. SSM Agent
      1. mkdir /tmp/ssm
      2. cd /tmp/ssm
      3. wget https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb
      4. sudo dpkg -i amazon-ssm-agent.deb
      5. sudo systemctl status amazon-ssm-agent
      6. cd ~/
    3. Cloud-init
      1. sudo apt install -y cloud-init
      2. Add myusername to cloud-init
        1. sudo nano /etc/cloud/cloud.cfg
          1. default_user: name: myusername
  7. Remove public keys
    1. sudo rm ~/.ssh/authorized_keys
    2. sudo rm ~/.ssh/id_rsa.pub
  8. Change default passwords
    1. sudo passwd -l root
    2. sudo passwd -d whoopsie
  9. Shred things
    1. sudo shred -u id_rsa*
  10. Change SSH
    1. sudo nano /etc/ssh/sshd_config
      1. PermitRootLogin without-password
      2. PubkeyAuthentication yes
      3. AuthorizedKeysFile %h/.ssh/authorized_keys
      4. PasswordAuthentication no
      5. UseDNS no
  11. Remove SSH Host Key Pairs
    1. sudo shred -u /etc/ssh/*_key /etc/ssh/*_key.pub
  12. Regenerate OpenSSH host keys
    1. sudo dpkg-reconfigure openssh-server
    2. sudo systemctl restart ssh
  13. Shred more things
    1. shred -u ~/.*history
  14. sudo shutdown now
  15. Export VM to .ova

Import .ova as AMI

  1. Upload .ova to S3
  2. Import to EC2: Import .ova to AWS
  3. Launch the AMI
  4. Choose to create a new keypair
  5. Confirm you are able to ssh
  6. Share the AMI
    1. https://aws.amazon.com/marketplace/management/manage-products/?#/build.build-new 
    2. Click AMIs
    3. Click Unshared
    4. Select your AMI
    5. Change the OS Username to myusername
    6. Click Share AMI button

AWS Marketplace User Guide Best Practices

AWS Marketplace User Guide Product Policies

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html#amazon-linux-cloud-init

https://cloudinit.readthedocs.io/en/latest/

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-user-account-cloud-init-user-data/

https://stackoverflow.com/questions/23411408/how-do-i-set-up-cloud-init-on-custom-amis-in-aws-centos

https://aws.amazon.com/marketplace/management/manage-products/#/build.build-new

https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html#agent-install-ubuntu

https://aws.amazon.com/articles/how-to-share-and-use-public-amis-in-a-secure-manner/

https://aws.amazon.com/marketplace/management/manage-products/?#/manage-amis.unshared

https://docs.aws.amazon.com/marketplace/latest/userguide/product-submission.html

https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html

https://docs.aws.amazon.com/marketplace/latest/userguide/best-practices-for-building-your-amis.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/building-shared-amis.html

https://docs.aws.amazon.com/marketplace/latest/userguide/product-and-ami-policies.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html

https://docs.aws.amazon.com/marketplace/latest/userguide/best-practices-for-building-your-amis.html

https://documentation.avaya.com/bundle/DeployingAEServicesinIaaSEnvironment_r8.0/page/Importing_the_OVA_for_AMI_conversion.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/building-shared-amis.html#public-amis-install-credentials

https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Images:sort=name

https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#SecurityGroup:group-id=sg-0ac5ff5c34eb4db70

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/paid-amis.html

https://aws.amazon.com/marketplace/help/200899830/

https://docs.aws.amazon.com/marketplace/latest/buyerguide/buyer-getting-started.html

https://docs.aws.amazon.com/marketplace/latest/buyerguide/buyer-product-categories.html

https://docs.aws.amazon.com/marketplace/latest/buyerguide/buyer-private-offers.html

https://docs.aws.amazon.com/marketplace/latest/buyerguide/buyer-aws-free-tier.html

https://docs.aws.amazon.com/marketplace/latest/userguide/user-guide-for-sellers.html

https://console.aws.amazon.com/support/cases?#/create?issueType=customer-service

https://aws.amazon.com/marketplace/management/tour/

https://aws.amazon.com/marketplace/management/homepage?pageType=awsmpmp%3Acustomer#

https://aws.amazon.com/marketplace/management/products/server?#

https://docs.aws.amazon.com/marketplace/latest/userguide/product-preparation.html

https://docs.aws.amazon.com/marketplace/latest/userguide/ami-products.html

https://aws.amazon.com/marketplace/management/manage-products/?#/build.build-new

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device

https://aws.amazon.com/getting-started/projects/connect-data-center-to-aws/

https://docs.aws.amazon.com/directconnect/latest/UserGuide/getting_started.html

https://aws.amazon.com/premiumsupport/knowledge-center/expand-ebs-root-volume-windows/

https://aws.amazon.com/marketplace/management/products/requests/wf_mco_awsmp_ssl_create_product_v1.4.8.7mrtinwOTSelCxDVmYYrZA/general


PowerShell Script to Prevent Your Machine From Logging You Out or Sleeping While You Do Other Things

In certain environments, my development machine does not have access to the interwebs. I have to use a separate machine that is connected to the outside world to lookup a snippet or research a deeper issue. If I don’t think to tap the space bar at least every four minutes and 59 seconds, I have to re-authenticate to continue development. Then those dozen or so characters I’ve had to memorize interrupt me (Squirrel!) from the issue at hand; worse if I fat-finger the input. So here is a PowerShell script that does the mindless key tapping for me:

param($numKeyTaps = 90)
$wsShell = New-Object -com "Wscript.Shell"
for ($i = 0; $i -lt $numKeyTaps; $i++) {
Start-Sleep -Seconds 360
$wsShell.sendkeys("{NUMLOCK}")
Write-Host "Tapped Numlock key"
}

Notes on Moving Meteor Development to WSL Debian

https://docs.microsoft.com/en-us/windows/wsl/wsl2-install

Turn Windows Features on and off, scroll down and check Windows Subsystem for Linux

Click on OK, and WSL will install. You’ll need to reboot to enable it.

From there, go to the Windows Store and choose your preferred Linux distribution. I used Debian.

Click on Get, install the distribution, and if you want, launch the terminal from the Start menu Debian Icon.

I use CMDR (https://cmder.net). It is superior to the default WSL Bash terminal and Windows Terminal for WSL support, multiple tabs and better character support. You’ll need the multiple tabs to run meteor and meteor mongo simultaneously.

Open up a CMDR WSL Bash terminal. You are in the home/user folder.

Update:
sudo apt update

Install curl
sudo apt-get install curl

Install Meteor
curl https://install.meteor.com/ | sh

Install MongoDB Tools, allows you to bulk import json data
sudo apt-get install mongo-tools

Install git
sudo apt-get install git

Create a Meteor app
meteor create –react ~/myapp
cd ~/myapp
meteor

Open a new WSL tab
meteor mongo

If you get an error like:
WSL Error:
Retrying after error { Error: SQLITE_IOERR: disk I/O error
=> awaited here:
at Promise.await
(/home/debian/.meteor/packages/meteor-tool/.1.8.1.ani1yi.p0f9s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:60:12)
at Db._execute (/tools/packaging/catalog/catalog-remote.js:347:15)

You will need to:
vi .meteor/packages/meteor-tool/.1.8.1.ani1yi.p0f9s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/packaging/catalog/catalog-remote.js

Find:
self._execute(`PRAGMA journal_mode=${JOURNAL_MODE}`);
Replace with:
self._execute(`PRAGMA journal_mode=TRUNCATE`);
Exit and Save (ESC :wq ENTER)

If you had to sudo vi running meteor may error with permission denied. So youmay need to:
chmod +rw .meteor/packages/meteor-tool/.1.8.1.ani1yi.p0f9s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/packaging/catalog/catalog-remote.js

All of that should allow you to open multiple tabs while running meteor. Run meteor in the first tab then in the second tab import your data:
mongoimport -h localhost:3001 –db meteor –collection mydata –type json –file “./.db-json/mydata.json” –jsonArray

show dbs
use meteor
show collections
db.mydata.find().count()
db.mydata.find().pretty()
db.mydata.remove({}) – to delete all records

You can also:

Open explorer where you are:
explorer.exe . (that is a space and a period after the exe)

Open Visual Studio Code where you are:
code .

Other Notes:

meteor remove blaze-html-templates
meteor add angular-templates
meteor npm install –save angular angular-meteor

meteor remove static-html

meteor add accounts-password dotansimha:accounts-ui-angular
meteor npm install –save bcrypt

meteor remove insecure

meteor remove autopublish

Need to get Docker to work:

sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
manually add deb https://download.docker.com/linux/ubuntu bionic stable to software sources
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo systemctl status docker
sudo docker run hello-world
sudo docker info
sudo docker version

sudo usermod -a -G docker $USER
sudo reboot

npm update caniuse-lite browserslist ???

docker build -t pipefitters .
docker run -d -p 80:3000 pipefitters
no workie

https://cloud.mongodb.com

Duet Display on Windows. How to Rip it Out by Its Roots.

I tried to upgrade a working version of Duet Display on Windows 10. Installing the current version errors with “The older version of Duet Display cannot be removed”. Then it didn’t work anymore nor could I uninstall it.

If you can, uninstall duet display and kairos.
Uninstall everything Apple.
Delete these folders:
c:\programdata\caphyon
c:\program files\common files\duet display
c:\program files (x86)\common files\duet display
c:\program files\kairos
c:\users\chris\appdata\roaming\duet
c:\users\chris\appdata\roaming\kairos
c:\users\chris\appdata\local\advinstanalytics
and anything that doesn’t look like it belongs in c:\users\chris\appdata\local\temp
Check the event viewer for cryptic folders where the .msi gets extracted.
In your registry, delete folders and keys named advinstanalytics, apple, bonjour, caphyon, duet display, kairos

Reboot (because Windows) and run the executable again. Repeat if necessary.

Kairos, you’re THAT developer.

Create Windows 10 Install USB Drive

How to create a bootable Windows 10 USB drive from the command line.

You’ll need the .ISO file for Windows 10.

Open the command prompt as the administrator, type “diskpart” without the quotes, and hit enter.

Plug in your USB drive. Type “list disk” without the quotes and hit enter. Take a look at the Size column and figure out which disk number your USB drive is.

Ours is number 1, so we’re going to type “select disk 1” without the quotes and hit enter. Adjust your disk number accordingly.

Now wipe the drive by typing in “clean” without the quotes and hitting enter.

Type “create partition primary” without the quotes and hit enter.

Then type “select partition 1” without the quotes and hit enter.

Next type “active” without the quotes and hit enter.

Finally, type “format fs=fat32” without quotes and hit enter.

When that’s done, type “assign” without the quotes and hit enter.

Mount the .ISO.

Close diskpart and open up cmd again. Type “xcopy g:*.* /s/e/f h:” without the quotes, where “g:” is the drive letter for your mounted .iso file and “h:” is the drive letter for your USB flash drive. Don’t worry if install.wim takes a while to copy: It’s easily the biggest file on the disc.

Type “exit” without the quotes and hit enter. You’re done. You can now install Windows 10 from your USB drive, either by booting from it or from within an existing installation of Windows.