In The Future, ChatGPT Could Be The Cloud … The Future of AI-based Virtualisation

On so, we stand on the brink of a fairly dumb method of machine learning (LLM — Large Language Model) taking aim at many of our existing…

In The Future, ChatGPT Could Be The Cloud … The Future of AI-based Virtualisation

And so, we stand on the brink of a fairly dumb method of machine learning (LLM — Large Language Model) taking aim at many of our existing ways of working. Whether it’s passing exams at university or providing online chatbots, our world of technology will change forever. But, there are secrets within Chat-GPT that show its true power in virtualisation.

One “hack” is to let Chat-GPT create a Linux terminal and where we can enter commands and create a stateful machine. Initally we enter the commands of [here]:

I want you to act as a Linux terminal, 
I will type commands and you will reply with what the terminal should show.
I want you to reply with the terminal output inside a unique code block
and nothing else.
do not write explanations.
do not type commands unless I instruct you to do so.
When I need to tell you something in English I will do so by putting text inside
curly brackets {something like this}.
my first command is pwd.

With these commands entered, we get a Linux terminal and which is stateful:

and now create a new text file named “file3.txt” and add some text to it:

This is interesting, as Chat-GPT is remembering the state of the machine between different chats. Now, let’s push it a little more, and create a Python program of:

import math
i=3
print(f'Log10 of {i} is {math.log10(i)}.')

Once, we enter the program, we will then call up the Python interpreter and see if it runs:

And as you can see, the file has been created, and the log_10 of 3 has been created correctly. In this way, Chat-GPT is able to run the code through a Python interpreter, and properly format the output. And, so Golang is not installed on the Linux instance we are using, so let’s download it with:

and where we see we have downloaded the Golang installer. Now, we can go ahead and install Golang with:

tar -C /usr/local -xzf go1.20.6.linux-amd64.tar.gz

This will install the Golang binary into the /usr/local/bin folder. We can then add this path on the system:

export PATH=$PATH:/usr/local/go/bin

This gives us:

Now we will use an RSA test program in Golang to see if Chat-GPT can get a Golang program compiled and then run it. First we place the rsa.go file on a server and get it with rsa.txt:

We named it with a txt extension as the remote server supports this format. Next we can rename it with a Golang extension:

And, so, we have hit our first bump. It hasn’t copied the file. So, let’s just do a copy and paste of code:

This produces a Golang file:

and we can now compile it with Golang. Unfortunately, it doesn’t quite build it:

But, if we ask it politely, we get:

Now, will it run? Yes:

Wow!

Now let’s go for an RSA program. For this, we need:

echo 'package main

import (
"crypto/rand"
"fmt"
"math/big"
"os"
)

func main() {

p, _ := rand.Prime(rand.Reader, 64)
q, _ := rand.Prime(rand.Reader, 64)

e := new(big.Int).SetInt64(65537)
Mval := "10"

argCount := len(os.Args[1:])

if argCount > 0 {
Mval = os.Args[1]
}

M, _ := new(big.Int).SetString(Mval, 10) // Base 10

N := new(big.Int).Mul(p, q)

C := new(big.Int).Exp(M, e, N)

Pminus1 := new(big.Int).Sub(p, new(big.Int).SetInt64(1))
Qminus1 := new(big.Int).Sub(q, new(big.Int).SetInt64(1))
PHI := new(big.Int).Mul(Pminus1, Qminus1)

d := new(big.Int).ModInverse(e, PHI)

Plain := new(big.Int).Exp(C, d, N)

fmt.Printf("M= %s\n", M)
fmt.Printf("p= %s\n", p)
fmt.Printf("q= %s\n", q)

fmt.Printf("N= %s\n", N)
fmt.Printf("Public: e= %s\n", e)
fmt.Printf("Private: d= %s\n", d)
fmt.Printf("\nCipher C= %s\n", C)
fmt.Printf("\nDecrypt Plain= %s\n", Plain)

}
' > rsa1.go

Chat-GPT then nicely formats the code with:

Adnd will create the rsa1.go program. Now we can compile it:

Double, Wow!

Conclusions

The world of Chat-GPT is upon us, and it will completely change the world of technology. I believe that AI could become the cloud, and where we can script anything that we want. We are at the cusp of something great, and we now need to use it properly.