OpenAI - ChatGPT and the future of mac admins
By George Gonzalez
- 5 minutes read - 944 wordsThis week I got to play a little with OpenAI ChatGPT bot, and wow, we have to talk about this…
Any time there is a fundamental leap in technology, it comes with the usual responses: apprehension, denial and most often fear. OpenAI’s ChatGPT chat bot is no different, it is by no means the first, but it is definitely one of the most advanced that has been opened for the public to try out.
I took it for a spin, looking at it from the angle of how it could impact our field. Here are some of my observations.
No, it will not replace you, (yet)
As mac admins we often need to use scripting to resolve very specific issues. So I thought this may be a good place to start with GPT. Could it script as good as a human counterpart?
I started by asking it:
I need a bash script that will look up the public IP address of my computer and then will output it to a text file.
Seconds later out came this:
#!/bin/bash
# Look up the public IP address of the computer
IP_ADDRESS=$(curl -s http://checkip.dyndns.org | grep -o '[0-97\f1,3131.
[0-97\11,3131. [0-97\£1,3131.[0-9]\51,313')
# Output the IP address to a text file
echo SIP_ADDRESS > ip_address. txt
Followed by the instructions on how to use the script:
To use this script, save it to a file on your computer and make it executable by running the following command:
chmod +× <filename>
Replace with the name of the file where you saved the script. Then, you can run the script by executing the following command:
./<filename>
Looking at the script above, you could think “This is not going to end well, very soon my role will be obsolete.” But not so fast, once you look at this code you realize there are a couple of assumptions made.
- that the device can reach the internet
- that curl is installed
So I decided to ask for the same script but this time highlighting these possibilities.
I need a bash script that will look up the public IP address of my computer and then will output it to a text file. The script should check if the internet is reachable and that it has the binaries needed, if it doesn’t then it should install them.
As you can expect the response was different:
#!/bin/bash
# Check if the internet is reachable
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then
echo "The internet is reachable."
else
echo "The internet is not reachable. Exiting script."
exit 1
fi
# Check if the required binaries are installed
if ! [ -x "$(command -v curl)" ]; then
echo "Installing curl..."
apt-get install curl
fi
# Look up the public IP address of the computer
IP_ADDRESS=$(curl -s http://checkip.dyndns.org | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
# Output the IP address to a text file
echo $IP_ADDRESS > ip_address.txt
After the same “How to Use” instructions from the previous attempt, it also added this comment:
Note that the script uses the apt-get command to install the curl binary. This command is specific to Debian-based systems such as Ubuntu. If you are using a different operating system, you will need to use the appropriate package manager to install the required binaries.
Much better, right?
Yes, this definitely fixes the initial oversights, and it even offers up the suggestion on how to adjust this script if you are using a non Debian-based OS.
Brilliant, but as you can see it could only do what it was asked and not much more. No intuition, no imagination, which, to be fair, is what I expected of it.
I tried this experiment with several other script creation prompts, for example, a script for macOS that would output attached displays and their resolutions. The responses were usable, but how to use these for a Workspace ONE sensor or a JAMF Extension Attribute? Then it got more complicated.
My conclusion
AI is already a part of our lives and our roles. More and more AI and ML is utilized in our tools to surface data for our attention or even remediate issues without our intervention.
It would be foolish to assume that this will not impact our roles. It will. The same way that Virtualization affected data centers, or Containers affected Virtualization. There are, however, things that are still far away for an AI; true innovation, ingenuity, inspiration, aspirational thinking, all of these are qualities it has not yet acquired and even if it did - or ever will- it would take a while to master. Not to mention when code needs to be tested on physical hardware. Think testing a script created by AI on a specific model of a laptop during the DEP enrollment process; for now, we still need a human.
I see this as similar to having a sous-chef. In the examples above, it can help to write the first version of the script and create a foundation that can then be modified and improved upon or adapted. This is not a new concept, for centuries, masters of their craft have been relying on apprentices to do the “manual” labor while they concentrated on the bigger picture or more complex details. Think, Michelangelo and da Vinci. ChatGPT, Github’s Copilot and others will similarly become integrated in our day to day tasks, taking care of some of the more mundane tasks, allowing us the freedom to create even more value for our customers.
This is quite an interesting technology and I can’t wait to see where it takes us. I, for one, welcome our AI overlords.
*OpenAI, GPT, logos etc are all property of OpenAI.