I asked ChatGPT to write me a bash script, and it worked (mostly), why do I need to know how to code?

By now, ChatGPT has become pretty well known ( as of 18th Dec 2022). I’ve messed around with basic questions, but today I wanted to start to write a script that I could use with “OverSight” on Mac (https://objective-see.org/products/oversight.html). When you turn on your camera/mic, it can fire off a script with arguments.

In this post I’ll show you what I asked ChatGPT, what it gave me and if it worked! And if Google helped me or not, and if learning to code (or just knowing logic), is still worthwhile.

Continue reading “I asked ChatGPT to write me a bash script, and it worked (mostly), why do I need to know how to code?”

VMware ESXi – How to Remove an NFS Share that’s ‘In Use’

I recently moved house, and as part of that a few things on my network changed. My NAS (A Synolofy DS8J) changed it’s IP Address. This caused an issue when ESXi was trying to get hold of the datastore.

So, now this needs to be removed and replaced – I came across this error:

Remove Datastore 
Description 
State 
Errors 
haTask-ha-host-vim.hostDatastoreSystem.removeDatastore-3885 
Removes a datastore frorn a host 
Failed - The resource •NAS' is in use. 
Cannot remove datastore 'NAS' because One or more virtual machines are stil registered on it.

After a bit of frantic Googling, I came across: https://kb.vmware.com/s/article/2008507

Accessing the CLI was needed to resolve this, so jump into the ESXi CLI and run:

esxcli storage nfs list
Vol urne 
NAS 
Name 
Host 
192 . 168.1. 180 
Share 
/vol umel/esx 
Accessible 
false 
Mounted 
false 
Read-Only 
fal se 
i SPE 
false 
Hardnare Acceleration 
Unknown

Now you have the name, in this case “NAS”, we can call the following to remove it.

esxcli storage nfs remove -v=NAS

Sorted!

Easily Automate your Lab with the vCenter API

I’m fortunate enough to have a small Intel NUC powering my labbing efforts for both home and work use. When I joined Okta, I decided to set up a separate AD/Firewall VM to keep things apart from my home lab AD I’d been using in the past.

I also decided that I didn’t need these VMs running over night so I thought I’d suspend them after ‘working hours’. So at 9am, I wanted the VMs to resume, and at around 5:30/6, have them suspend.

In this post, we will explore how to use the vCenter API called by a Python script to suspend and resume a set of VMs on a schedule.

Continue reading “Easily Automate your Lab with the vCenter API”

WordPress – How to fix Jetpack connection errors, Fonts and Icons showing as squares with NGINX

I recently migrated https://blog.eucse.com/blog from running on Apache to Nginx. I found it helped a lot with utilization and speed (combined with a few more tweaks), but one thing I noticed after was Jetpack wouldn’t load correctly, and some fonts and icons were showing as squares.

See examples of what I was seeing below:

Resolution

Access Control Allow Origin settings in NGINX!


       location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
               add_header Access-Control-Allow-Origin "*";
       }

Add the above to your server block, run nginx -t to test, and then restart nginx to set it.

Say hello to a working site!

Thanks to https://support.maxcdn.com/hc/en-us/articles/360036555812 and https://docs.presscustomizr.com/article/233-social-icons-showing-up-as-squares for the assistance!

How to correctly encode special characters for PHP cURL using Postman

I’ve recently been working with a REST API for a project, where we had to provide a filter that needed quote marks in it.

/api/v1/users?filter=status+eq+"ACTIVE"+or+status+eq+"DEPROVISIONED"

When I was passing this via my PHP API wrapper, this was giving me no end of heck. I spent ages looking for how to escape those “”‘s, and after testing with Postman that this worked great like this, for some reason I notice an option in Postman I’d never clicked before.

‘Code’

Just up there by Save on the top right.

Then like an idiot, I realised I just needed to use the ASCII code for “, and I’d have been fine. Copy and pasted this into the function call going to my API wrapper, and we have liftoff.

If you want to be even smarter, you can have Postman generate all the code needed when you have a working call in the app! This would have saved me HOURS in the past if I’d known this.

Enjoy!

vfuse: How to solve “Error: VMware Fusion.app is not running”

I have been recently building some new VMs for Catalina for testing, and I was having the below error:


Error: VMware Fusion.app is not running

This was frustrating the hell out of me, as Fusion was 100% running, so I uninstalled vfuse, reinstalled it from homebrew so I knew I had the right version (2.2.6). I’m running Fusion Pro 11.5.6, I could not work out WTF was going on.

I then went to the vfuse source code (as you do) to see how the script determines the Fusion application path.

Continue reading “vfuse: How to solve “Error: VMware Fusion.app is not running””

Set all Horizon Client’s to Auto-Connect, or not without user involvement

** DISCLAIMER **This is not intended for use on a production platform, VMware does not recommend amending or touching the View ADAM database manually. You will not receive support if anything fails after amending this. This blog is a learning exercise only.

At VMware, I’m responsible for looking after the whole Workspace ONE and Horizon suite (our Digital Workspace/End User Computing solutions). Most of my work is supporting the Unified Endpoint Management (UEM) and Access solutions, but more recently I’ve been assisting with some Horizon questions.

With that, I was presented an interesting question. How can we set all existing Horizon clients to not automatically connect to a desktop pool? In cases where only 1 pool is assigned, or reset any users who have set this option manually.

Never fear, there is a way! With our good friend PowerShell we can go in and make changes to the View ADAM Database which is within ADSI.

Continue reading “Set all Horizon Client’s to Auto-Connect, or not without user involvement”

Intel NUC from 32 to 64GB RAM!

Since the start of the the year I’ve been mulling over what upgrades to my Home Lab are in order. I’m doing a lot more VMware Horizon learning/testing and I’m prepping to take VCP-DCV, so I needed some capacity to make some cool things happen.

I was planning on buying a new NUC to get some extra capacity, but I decided to invest in a RAM upgrade instead. Considerably less cost outlay, less extra initial power consumption and theres a good possibly this extra headroom will be enough.

I’m going to do another post on my home lab setup, but for today I went successfully from 32 to 64GB RAM in my NUC7I7DNHE primary node.

Continue reading “Intel NUC from 32 to 64GB RAM!”

macOS Custom Enrolment with Workspace ONE, Okta and more

Post first appeared on the EUCSE.com blog at https://blog.eucse.com/macos-custom-enrolment-workspace-one-okta/

WWDC 2019 brought with it a whole host of new enterprise features for Apple’s OS’s, including macOS 10.15 Catalina. One of the most importnat in my opinion is called ‘Enrolment Customisation’. This is essentially a page during the DEP process where an MDM can present any web content. In our case, this was a perfect place to put a SAML authentication page.

We released our support for this feature in Workspace ONE UEM 1909 (our Sept 2019 release). All Workspace ONE UEM release notes can be found here. 

Continue reading “macOS Custom Enrolment with Workspace ONE, Okta and more”