jump to navigation

macOS running on VMWare ESXi 7 5 January 2021

Posted by David Wilson in General.
add a comment

#macOS
#VirtualMachine
#ESXi

You can run macOS as a virtual machine on VMWare ESXi 7… along with other virtual machines.
Warning: macOS terms of service may permit you to run macOS as a virtual machine – proceed on your own choice, also refer license agreement below.

You will need a installation of VMWare into which you can create the macOS virtual machine. VMWare ESXi will need some dedicated hardware to run on. I have a Levovo Tiny PC, with 16GB of ram and a 240GB SSD. If you haven’t seen one – it’s physically of a similar size to a Mac Mini. When you perform the initial installation of VMWare ESXi you will need a monitor and keyboard attached – after that you won’t need them. I would recommend a large SSD – initially I had a 120GB SSD and have since changed it for another I happened to have – depending on what you want to do I would recommend a minimum of 512GB.

The installation sequence:
1. Setup the VMWare Host PC – ensure you have memory and SSD/Hard drive space
2. Download and create VMWare ESXi install media
3. Install VWare ESXi
4. Install VMWare Unlocker software (I’ll explain why later)
5. Create macOS install image (you don’t need to create a physical USB key for this)
6. Install VMWare Tools on the macOS image
7. change the macOS screen resolution – using the command line instruction
8. Find something to do with the new macOS installation! – While I’ve done this – I haven’t actually used it.

ESXi
https://my.vmware.com/en/web/vmware/evalcenter?p=free-esxi7
You need to create an account for your free download and license key.
You will want to download “VMware vSphere Hypervisor (ESXi ISO) image”.
Then setup a USB key with the .iso image to install on your server.

ESXi – Unlocker
This is a very small and quick installation. It is needed because any attempts to install macOS cannot be completed because there seems to be no keyboard or mouse support – this means you can’t select any of the required install options etc.
https://github.com/hugepants/esxi-unlocker
https://www.insanelymac.com/forum/topic/335756-macos-unlocker-v30-for-vmware-esxi/page/4/

macOS – install image
https://virtuallywired.io/2020/08/01/create-a-bootable-esxi-7-usb-installer-on-macos/

macOS – Install
https://www.techrepublic.com/article/how-to-virtualize-macos-on-vmware-esxi/
Be sure to install VMWare tools for macOS.

macOS Screen Resolution
https://www.virtuallyghetto.com/2015/10/heads-up-workaround-for-changing-mac-os-x-vm-display-resolution-in-vsphere-fusion.html

/Library/Application Support/VMware Tools
./vmware-resolutionSet 1920 1080

Apple Licence Agreement
https://www.apple.com/nz/legal/sla/
https://www.apple.com/legal/sla/docs/macOSCatalina.pdf

(iii) to install, use and run up to two (2) additional copies or instances of the Apple Software within virtual operating system environments on each Mac Computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using macOS Server; or (d) personal, non-commercial use.

What Next

In theory with all this done you should be able to create snapshots and clones of the machine… I haven’t done this due to being “disk space challenged”.
You could install Xcode and use it as a server for automated testing.
You could install macOS Server and use the machine for server things…
You could use it to test OS releases before installing on your main desktop / laptop to increase your own level of confidence that these installs will be successful on your real machine. Maybe Snapshot first so you have something to go back to in case of issues.

You can export/import VMWare images – I did this when I changed the SSD. Use OVF Tool to export them as OVAs and then re-import them.
https://code.vmware.com/web/tool/4.4.0/ovf
Install this on your desktop computer… Then do something like:

ovftool vi://192.168.1.1/VM1 vm1.ova
then
ovftool –dm=thin vm1.ova vi://192.168.1.1/

… although I did the import from the VMWare GUI.

And done. Have Fun. Learn. Enjoy.

iOSUIActivityViewController and Objective-C 4 January 2021

Posted by David Wilson in General.
add a comment

#iOS
#OBJC
#OBJECTIVE-C

I wanted to include the iOSUIActivityViewController (Share Sheet) into my application and all of the example code on the web pretty much is written in Swift. Additionally beyond the initial simple code I wanted a bit more control over how the share information is presented. Then share slightly different information for AirDrop vs Mail vs Twitter – this requires using the protocol UIActivityItemSource.

The images below show the results of this working solution where the share sheet has been presented giving the user control over where to share too. Additionally the mail message has a custom subject line. When you drag the sheet up, you get to see additional sharing options such as Save to Photos, Save to Files, Print, Copy and edit the actions.

I’ve built a demo application and have shared this in GitHub here: https://github.com/dgwilson/iOSShareActivity
It is a demo app that shows how to use UIActivityViewController with Objective-C. Includes use of procol UIActivityItemSource and LPLinkMetadata. This is a working demo, built successfully with Xcode 12.3 for iOS 13 deployment target to an iPhone 7 running iOS 14.4

I had a lot of difficulty getting the initial summary information to display how I wanted it to and thought that the LPLinkMetadata would give me total control. So improvement is likely possible.
I did have the Application icon displaying at one stage, for now I’ve landed on what works for me. There seems to be some AI control over what is displayed that took control away from the developer.

The core of the work is done in the code below – it will do the job without any more code. Though to share to AirDrop (Image only) a bit more code is required. See the demo application.

NSArray * theItems = @[self, favouriteImageItemView.itemImageView.image]; // SELF - big clue, because the protocol UIActivityItemSource is declared in the @interface this now means the protocol procedures are invoked, for example - activityViewController:itemForActivityType: - they are only invoked if SELF is passed into theItems Array.

UIActivityViewController *controller = [[UIActivityViewController alloc]
initWithActivityItems:theItems
applicationActivities:nil];
controller.excludedActivityTypes = @[UIActivityTypeAssignToContact,
UIActivityTypeOpenInIBooks, UIActivityTypeAddToReadingList];

controller.popoverPresentationController.barButtonItem = self.shareButton;
controller.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionUp;
[self presentViewController:controller animated:YES completion:^{}];

And here is my code for the LPLinkMetadata. In the demo App, uncomment the line meteData.originalURL and rerun the app to see what happens.

- (LPLinkMetadata *)activityViewControllerLinkMetadata:(UIActivityViewController *)activityViewController API_AVAILABLE(ios(13.0))
{
NSLog(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));

UIImage * justAnImage = [UIImage imageNamed:@"JustAnImage"];
UIImage * theImage = [UIImage imageNamed: @"AppIcon"];
NSItemProvider * iconProvider = [[NSItemProvider alloc] initWithObject:theImage];
// NSItemProvider * iconProvider = [[NSItemProvider alloc] initWithObject:justAnImage];
NSItemProvider * imageProvider = [[NSItemProvider alloc] initWithObject:justAnImage];
LPLinkMetadata * metaData = [[LPLinkMetadata alloc] init];
metaData.title = @"This title shows we care";
// metaData.originalURL = [NSURL URLWithString:@"https://www.apple.com"];
// metaData.URL = [NSURL URLWithString:@"https://www.apple.com"];
metaData.iconProvider = iconProvider;
metaData.imageProvider = imageProvider;

return metaData;
}

Hoping someone finds this useful.

– David

David Wilson
https://dgwilson.wordpress.com
https://nz.linkedin.com/in/dgwilson65

Power BI – SharePoint List 2.0 Beta connector 9 November 2020

Posted by David Wilson in General.
Tags: , ,
add a comment

#PowerBI #PowerQuery #M

The October 2020 release of Power BI includes the new SharePoint List 2.0 Beta connector. Keen to try it out I had a go at upgrading my imports of existing lists to the new connector.

I was able to, in most cases, update the references to the SharePoint List by editing one line in the Power Query code.
From this:
Source = SharePoint.Tables(“https://xxxx.sharepoint.com/sites/MyList”, [ApiVersion = 15]),
To this:
Source = SharePoint.Tables(“https://xxxx.sharepoint.com/sites/MyList/”, [Implementation=”2.0″, ViewMode=”All”]),

That was the easy part. The good news is that the import/load is now much cleaner and it brings in renamed columns as their new names.
I struct a particular challenge with the “People” type column definition and with the field being partially populated – for example we have 50 customers in the list and only three of them have an assigned or populated “Service Manager”. So extracting those details, which are there, became particularly difficult.

The solution turned out to be a custom line of Power Query code. I used the community forums and twitter to get the answer… and it consumed a lot of time. Here’s the line of code:

= Table.TransformColumns(#"Added Custom1", {{"Custom", each if Value.Is(,type list) then {0} else [title = "not assigned"], type record}} )

Annoyingly the “secret sauce” is _{0}

More details can be found in the community post discussion on this: https://community.powerbi.com/t5/Power-Query/Extracting-Title-from-SharePoint-Online-list/td-p/1475340

On the journey I found some Power Query (M) blog posts – totally awesome…
https://ssbi-blog.de/blog/technical-topics-english/lists-in-power-query-how-when-and-why/
https://ssbi-blog.de/blog/technical-topics-english/records-in-power-query-how-when-and-why/
https://bengribaudo.com/blog/2018/09/13/4617/power-query-m-primer-part9-types-logical-null-binary

Enjoy.

TrafficCamNZ – Check for update! 6 September 2020

Posted by David Wilson in General.
add a comment

#TrafficCamNZ

Check for update! – Both the Desktop and iPhone/iPad versions of TrafficCamNZ have now been released.

Here’s a reminder of what’s changed:

TrafficCamNZ Desktop
1.3.0
In this version
● Built on the latest macOS – Catalina.
● Image layout on the main view is now the same (left to right) as the TrafficCamNZ Desktop application
● Backend data sync has moved to ‘Ensembles’. Devices each trigger a data sync every 30 seconds. Please allow time for the data sync to complete.
● Default images file updated to only include camera that have received a successful image retrieval.
● Added ability to delete cameras that have a failed last retrieval – implemented as button on the utiity screen – no second chances
● The CoreData database of cameras is AutoSaved every 60 seconds – this also helps with cross device sync
● Changed the size of error text in the images to be more readable
● The size of the camera description at the bottom of images is now larger – scaled to fit the available space
● There’s a new News screen displayed at launch to provide updates on new features and usage tips
● Updates to internet location of the camera file, was Google Sites, now Amazon S3 storage

TrafficCamNZ for iPhone and iPad
1.11.0
In this version
● Improvements to onscreen messages when images are unable to be retrieved – you can now read the errors!
● Increased the size of the text displayed under images to improve readability
● AllCameras now features an increased image size
● Image layout on the main view is now the same (left to right) as the TrafficCamNZ Desktop application
● Default images file updated to only include cameras that have received a successful image retrieval.
● There’s a new News (New Features and Tips) screen displayed at launch to provide updates on new features and usage tips
● Added the ability to get back to the New Features and Tips screen after initial launch
● Updates to internet location of the camera file, was Google Sites, now Amazon S3 storage @ https://trafficcamnz.s3-ap-southeast-2.amazonaws.com/TrafficCamNZCameras.xml
● Backend data sync has moved to ‘Ensembles’. Devices each trigger a data sync every 30 seconds. please allow time for the data sync to complete.
● For those that previously chose to store their TrafficCamNZ data in iCloud – your data will be automatically migrated to local storage when the application is first launched. All cameras will be allocated a Unique ID to allow the multidevice sync to work.
● Multi-device sync – so long as your devices are signed into icloud, then the camera database, including the featured cameras for the main display, are synced across devices. Syncing can take a few minutes (please be patient).

Some further news and tips are built into the applications – details below are incorporated into a news screen in the apps.

– David

TrafficCamNZ – Updates are coming with new Data Sync! 3 September 2020

Posted by David Wilson in General.
add a comment

#TrafficCamNZ
#macOS
#iOS

Both TrafficCamNZ Desktop for Mac and TrafficCamNZ for iOS have been updated – it’s time to get ready for a release. A lot has changed.

TrafficCamNZ Desktop
1.3.0
In this version
● Built on the latest macOS – Catalina.
● Image layout on the main view is now the same (left to right) as the TrafficCamNZ Desktop application
● Backend data sync has moved to ‘Ensembles’. Devices each trigger a data sync every 30 seconds. Please allow time for the data sync to complete.
● Default images file updated to only include camera that have received a successful image retrieval.
● Added ability to delete cameras that have a failed last retrieval – implemented as button on the utiity screen – no second chances
● The CoreData database of cameras is AutoSaved every 60 seconds – this also helps with cross device sync
● Changed the size of error text in the images to be more readable
● The size of the camera description at the bottom of images is now larger – scaled to fit the available space
● There’s a new News screen displayed at launch to provide updates on new features and usage tips
● Updates to internet location of the camera file, was Google Sites, now Amazon S3 storage

TrafficCamNZ for iPhone and iPad
1.11.0
In this version
● Improvements to onscreen messages when images are unable to be retrieved – you can now read the errors!
● Increased the size of the text displayed under images to improve readability
● AllCameras now features an increased image size
● Image layout on the main view is now the same (left to right) as the TrafficCamNZ Desktop application
● Default images file updated to only include cameras that have received a successful image retrieval.
● There’s a new News (New Features and Tips) screen displayed at launch to provide updates on new features and usage tips
● Added the ability to get back to the New Features and Tips screen after initial launch
● Updates to internet location of the camera file, was Google Sites, now Amazon S3 storage @ https://trafficcamnz.s3-ap-southeast-2.amazonaws.com/TrafficCamNZCameras.xml
● Backend data sync has moved to ‘Ensembles’. Devices each trigger a data sync every 30 seconds. please allow time for the data sync to complete.
● For those that previously chose to store their TrafficCamNZ data in iCloud – your data will be automatically migrated to local storage when the application is first launched. All cameras will be allocated a Unique ID to allow the multidevice sync to work.
● Multi-device sync – so long as your devices are signed into icloud, then the camera database, including the featured cameras for the main display, are synced across devices. Syncing can take a few minutes (please be patient).

Some further news and tips are built into the applications – details below are incorporated into a news screen in the apps.

NEWS
There is this new fancy news screen presented in a traditional “Green Screen” – WAIT – read this – you can get back to this screen by clicking the splash bubble at the top of the screen – its next to the preferences button!

IMAGE LAYOUT
The image layout on the iPad screen now matches the layout on the macOS Desktop, this is especially important when you show 16 images on the scren at the same time. Both iPad and macOS will now share the same layout across both devices.

CAMERA SYNC BETWEEN DEVICES
TrafficCamNZ has been internally upgraded to use a new sync technology bewtween devices.
Sync of cameras between devices can take at least two minutes and is dependant on a “save” being completed on the device where a change has been made. One of the new features is an autosave every 30 seconds.

DATA MIGRATION
Your existing camera data will be automatically updated to use the new sync mechanism. It will use a small amount of iCloud storage for this.
For previous users of TrafficCamNZ who chose to use iCloud for your camera storage this feature is not longer being used and your data has been migrated.

DEFAULT CAMERAS
The builtin default cameras that are used as part of the initial load has been cut down to only include valid cameras. Over the years many of the camera sources have changed and no longer exist and thus do not return an image any more. All of the image links present at this time do return an image.

TIPS AND TROUBLE SHOOTING
It is possible to get the sync confused initially, especially if you’re syncing to multiple devices and the storage of both devices is migrated to the new system at the same time. You may see duplicate cameras presented. This is solved by manually deleting one of the cameras (it won’t matter which device you do this on). You’ll also need to allow time for the save and sync across devices to complete. This is helped by having the macOS desktop software autosave every 30 seconds.

Syncing with an iPad. Assuming your macOS desktop version of TrafficCamNZ is where you setup and manage your cameras it maybe best to next delete the old TrafficCamNZ application off the iPad – this will remove the application and the data. Next re-download TrafficCamNZ from the AppStore, on the iPad, run the application to go through the first time install. Let the the cameras Sync across the cloud onto the iPad. This could take from 2 to 5 minutes – depends on how much data you have. Now you’re done. Now make changes on the iPad they will sync back to the desktop or other devices.

These applications are completing the AppStore review and approval process – they should be available for release soon.

– David

TrafficCamNZ – Camera Update URL has changed 9 August 2020

Posted by David Wilson in General.
add a comment

#TrafficCamNZ

The update URL for TrafficCamNZ has changed. It is now:

https://trafficcamnz.s3-ap-southeast-2.amazonaws.com/TrafficCamNZCameras.xml

[URL Updated from original post]

This unexpected changed has occurred because I migrated the Google Site that was holding the file to the new style of Google Site. Oops.
An application update will be issued with a new release of both the macOS Desktop and iOS applications. Until then on iOS you can update the URL if you wish.

This is also a updated file that contains only known working cameras and adds unique identifiers for all cameras which is a required migration path for the new version of the application.

Apologies for any issues this change may cause.

– David

Moments v1.3 has been release on the Mac AppStore 2 August 2020

Posted by David Wilson in General.
add a comment

A new release of Moments has been released.
Critically it fixes a crash on macOS Catalina. The fix deployed is a work around for now. The image details off the camera will not display certain image information.

In addition I’ve been informed that the the software does work with a Nikon D80!

In this version
● Support for macOS 10.15
● Added security permissions requests for Photos
● Some image column information has been removed from the main display as this was causing a crash in 10.15

– David

Power BI – Date Filter Selection 1 July 2020

Posted by David Wilson in General.
add a comment

#PowerBI
#DAX
#DateTime

#UTCNOW

Last month I presented via Zoom at a Wellington Power BI User Group meeting. The subject Date and Time – it’s a recurring theme in Q&A in a number of forums at the moment. If you’ve got questions on that I highly recommend you download an inspect the PBIX file that accompanies this post. The trick then is to publish it to the Power BI service and note the differences (or not) between the dates and times on the Service vs. your desktop.

In that same PBIX file was a TAB for Date Filter Selection that demonstrated a special ability to always filter dates based on a calculated column. The best example of this is where you want to “default” to “Now”… naturally “Now” is a constantly moving target and Power BI doesn’t let you establish moving default values…. but it does and this page demonstrates that work around.

In addition I have also added a filter that allows the user to select the current week (or week ending). This too is demonstrated on that same page.

1. The “User Date” column is a DAX created column. It will contain text of a Date string or “Now!”. Selecting Now! in the filter will select the date row as shown (2 July 2020). If the filter never changes and the user reloads the page on another day, Now will effectively shift days.

2. The “User Date WeekEnding” column a DAX created column. It contains a text string, that looks kinda like a date, that aligns the Date to a weekending (or beginning – you choose). Selecting any given WeekEnding in the filter (shown here in BLUE) filters the date table to be all the days of that week.

Here’s an image of the Date Filter Selection tab.
Below please find the link to the PBIX file for you to inspect and understand.

https://sites.google.com/site/dgwilson65/DateandTime.pbix?attredirects=0&d=1

I’m keen to get feedback on this – has it been useful for you? Please use the comments area.

– David

TrafficCamNZ – Desktop – time for an update 6 June 2020

Posted by David Wilson in General.
add a comment

#TrafficCamNZ
#macOS

TrafficCamNZ Desktop for macOS has received some enhancements recently that I think help improve the look and usability of the program.

So far the changes/enhancements look like this:
● Bug fixes for for background thread initiation when building on a later version of the OS (macOS Catalina) – there’s a good chance a crash may have been exterienced if autorefresh was enabled – that’s now been fixed
● Improvements to messaging when images are unable to be retrieved – you can now read the errors!
● Increased the size of the text displayed under images to improve readability
● Built on the latest macOS – Catalina.
● Fixed some Storyboard constraint errors/warnings – always good housekeeping

You can tell from the screenshot below that it’s now dark and wet outside! You can also see the increased font size of the image description below the images… and that the description now also appears even below the images that have failed to be retrieved. Error messaging is also larger on each image.

– David

David Wilson
https://dgwilson.wordpress.com
https://nz.linkedin.com/in/dgwilson65

PowerBI DAX, Slicers, Disconnected Tables and using Relationships 10 February 2020

Posted by David Wilson in General.
add a comment

#PowerBI

In a previous post I had put forward a solution for user scenario where a SELECT tab presents a list of Companies that the user can choose one company from and on another tab the user is presented with that same company and others in the same Industry.

The solution(s) are not easy because the slicer from the SELECT table is Sync’d to the tab where I want the results to be displayed and by default restricts the display to the single selected company.

The original post solutioned that it could be solved with a “disconnected copy of the company table” and some DAX. Through one of the comments “AkhilAshok” proposed a upgraded solution with a nice clean implementation. It is worth looking into this as there are a couple of tricks to understand and trying to retrofit it into an existing model may cause some grief if you do not understand the implementation in the demo.

2020-02-10 07_17_26-Industry Selection Fix - Power BI Desktop

So if you are looking to implement this I recommend you consider the implementation carefully in terms of how it fits into your model with regard to the relationships of your tables.

The picture above shows (with the red square) my original “disconnected copy of the company table”. The table with the green highlight around it is also a copy of the company table with an active and unactive relationship back to the Company table. Take special notice of the direction of the relationship.

If you are trying to retrofit this into your existing Power BI model you need to ensure that you can do this. For this solution to work the Company selector on the SELECT tab needs to use the “Company_unfilteredCopy” table where previously I was using the “Company” table.

2020-02-10 07_26_06-Industry Selection Fix - Power BI Desktop

The relationship definitions are as follows:

2020-02-10 07_26_57-

2020-02-10 07_27_54-

Two final pieces of the puzzle to make the data present in a matrix.

  1. The DAX – see below
  2. The Matrix setup of the columns – it uses the Company Name and Industry from the original Company table.

 

The DAX:

_Amount_4_Industry_alt =
CALCULATE (
    SUM ( Transactions[Amount] )
    , USERELATIONSHIP ( Company_unFilteredCopy[Industry], Company[Industry] )
    , CROSSFILTER ( Company_unFilteredCopy[Company Name], Company[Company Name], NONE )
)

 

The picture below shows the working solution (on the right). The matrix on the left is the original implementation.

2020-02-10 07_31_02-Industry Selection Fix - Power BI Desktop

The updated pbix file can be downloaded here. https://sites.google.com/site/dgwilson65/Industry%20Selection%20Fix2.zip?attredirects=0&d=1

Good luck on your implementation if you choose to use this.