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!