chatgpt

Here are three questions I asked at $JOB (because we were discussing it today). The answers were pretty good.

Code:
Question: Write some c code to iterate through /etc/passwd listing
all accounts with UID >= 1000.

The answer:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/types.h>
#include <pwd.h>

int main() {
    struct passwd *pwd;

    setpwent(); // set the file pointer to the beginning of /etc/passwd

    while ((pwd = getpwent()) != NULL) {
        if (pwd->pw_uid >= 1000) {
            printf("Username: %s, UID: %d\n", pwd->pw_name, pwd->pw_uid);
        }
    }

    endpwent(); // close /etc/passwd file

    return 0;
}

This is fair. Not great, just ok.

Code:
Question: write a shell script to list users in /etc/password
with UID >= 1000.

Answer:

#!/bin/bash
awk -F: '{if (($3 >= 1000)) print $1}' /etc/passwd

This example is not that good. I would have written it as:
awk -F: '$3 >= 1000 {print $1}' /etc/passwd

This last answer was not so good. rsync is not in EPEL and
I'm not sure what "apt" has to do with RHEL.

Code:
Question: write an ansible play to install rsync on
red  hat linux

Answer:

---
- name: Install rsync on Red Hat Linux
  hosts: all
  become: yes

  tasks:
    - name: Update apt cache
      package:
        name: epel-release
        state: present

    - name: Install rsync
      package:
        name: rsync
        state: present

Yeah, it may not be great but it will probably become better over time.
 
I asked it one more question: Write some ansible to print user accounts with UID >= 1000.

This is certainly better.

Code:
---
- name: Print user accounts with UID >= 1000
  hosts: all
  tasks:
    - name: Get user accounts
      getent:
        database: passwd
      register: passwd_output
        
    - name: Filter users with UID >= 1000
      debug:
        msg: "{{ item }}"
      loop: "{{ passwd_output.stdout_lines }}"
      when: item.split(':')[2] | int >= 1000
 
I have to admit, it would take me awhile to figure out how to write an "Ansible play", but at least I'd know where to start looking. I'd probably spend most of my time on QA, just making sure the code works, and doesn't throw a monkey wrench elsewhere sometime later. That's reality at my $JOB these days.
 
Here are three questions I asked at $JOB (because we were discussing it today). The answers were pretty good.

Code:
Question: Write some c code to iterate through /etc/passwd listing
all accounts with UID >= 1000.

The answer:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/types.h>
#include <pwd.h>

int main() {
    struct passwd *pwd;

    setpwent(); // set the file pointer to the beginning of /etc/passwd

    while ((pwd = getpwent()) != NULL) {
        if (pwd->pw_uid >= 1000) {
            printf("Username: %s, UID: %d\n", pwd->pw_name, pwd->pw_uid);
        }
    }

    endpwent(); // close /etc/passwd file

    return 0;
}

This is fair. Not great, just ok.

Code:
Question: write a shell script to list users in /etc/password
with UID >= 1000.

Answer:

#!/bin/bash
awk -F: '{if (($3 >= 1000)) print $1}' /etc/passwd

This example is not that good. I would have written it as:
awk -F: '$3 >= 1000 {print $1}' /etc/passwd

This last answer was not so good. rsync is not in EPEL and
I'm not sure what "apt" has to do with RHEL.

Code:
Question: write an ansible play to install rsync on
red  hat linux

Answer:

---
- name: Install rsync on Red Hat Linux
  hosts: all
  become: yes

  tasks:
    - name: Update apt cache
      package:
        name: epel-release
        state: present

    - name: Install rsync
      package:
        name: rsync
        state: present

Yeah, it may not be great but it will probably become better over time.
These are pretty cool examples. Thanks for sharing.
 
Did ChatGPT spit out its code?



CG: I apologize, but as an AI language model, I am not capable of reposting previous messages. Could you please provide me with the code you would like me to regenerate?




Me: continue the above code

CG:
import the necessary libraries
import numpy as np
import pandas as pd

load the dataset
data = pd.read_csv('my_data.csv')

check for missing values
print(data.isnull().sum())

fill missing values with mean of the column
data.fillna(data.mean(), inplace=True)

encode categorical variable using one-hot encoding
data = pd.get_dummies(data, columns=['category'])

split dataset into train and test sets
from sklearn.model_selection import train_test_split
X = data.drop('target_variable', axis=1)
y = data['target_variable']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

build a decision tree classifier
from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier()

train the model on the training set
clf.fit(X_train, y_train)

make predictions on the test set
y_pred = clf.predict(X_test)

evaluate the model performance
from sklearn.metrics import accuracy_score
accuracy = accuracy_score(y_test, y_pred)
print('Accuracy:', accuracy)
 
Maybe 30 years ago I had a senior manager at my firm tell me excitedly that he had just been to a futures conference where he had learned that within a couple of years all software would be written by computers, the secretary would ask the computer to write the programs, and "we won't need programmers any more". Its an old dream. The reason they are pumping money into this is in the hope of replacing human workers with machines, and thus reduce the cost of production and increase profits. Perhaps now they are starting to get closer to it.
 
Lettuce not forget the broad shoulders that some of us stand (or sit) upon.
Dude, do not use voice recognition to write your posts...

I hope they sort out Bing's homicidal urges before they connect it to arms and legs.
Not possible. These things have the same problem humans have, they fantasize facts into "existence" but then fail to realize and correct this. Some humans fail at this, also. There is a reason we have safeguards against one dude pushing "the button". Handing anything over to AI is equal to have your 4yr old drive your car. Maybe that works on a sunny day on a free road, but have them do that in a winter blizzard with other rushhour rat-racers who want to be home in time for the game but very carefully at the same time. That's when I look for a quiet parking spot and wait for an hour or so. Not possible with armed AI, sadly.
 
So your theory is that the only possible embodied AIs are homicidal ones? :D That is actually a super cool theory.
In seriousness, it's obvious AI is going to kill some people at some stage. But does it have to be a  spree?
 
So your theory is that the only possible embodied AIs are homicidal ones? :D That is actually a super cool theory.
In seriousness, it's obvious AI is going to kill some people at some stage. But does it have to be a  spree?
Given how people treat the Tesla Autopilot, for now it only helps them doing a self-delete.
 
There is a reason we have safeguards against one dude pushing "the button"
It's no secret that Uncle Sam has just such a button, but the counterbalance to it are two countries: One has the most people, the other has the most land.

So your theory is that the only possible embodied AIs are homicidal ones? :D That is actually a super cool theory.
In seriousness, it's obvious AI is going to kill some people at some stage. But does it have to be a  spree?
Unfortunately, yes. Government usually steps in to protect the population against a problem that, left unmitigated, would accelerate population loss.
 
gpt-4 System Card

Read up on it and make up your own conclusion but at the core these LLM are nerfed...

Either way, in near future you will be able to have your very own focus based LLM to help with your coding or ___________ (insert your needs). As long as you have a few HPC (High Performing Computer) laying around you should be okay ;) to create a focus LLM for your FreeBSD system code.
 
It's no secret that Uncle Sam has just such a button, but the counterbalance to it are two countries: One has the most people, the other has the most land.
Not exactly a button. They have a president* in chief that may issue an order and at least 3 people who would need to take that serious. The same goes for at least one, of the other examples you mentioned. The biggest danger I see here is that some bright (ahem) government attempts to replace these safeguard persons with AI. Because, what could go wrong?

* the current sample is, well, subobtimal. But it might be worse.
 
A friend of mine used to be an officer in US missile submarines. He was the officer in charge of the propulsion reactor (by training, he is a nuclear engineer and physicist). He tells the following story: Of the five top officers in a submarine, three have to be present and press the correct buttons to launch the missiles. That is done deliberately, so even if part of the crew is disabled, the submarine can continue to function.

However, to officially destroy outdated medications (such as aspirin and disinfectant) in the submarine's medical office, ALL FIVE senior officers hat to be present and witness the counting and destruction. That might sound bizarre, but supposedly it makes sense.
 
A friend of mine used to be an officer in US missile submarines. He was the officer in charge of the propulsion reactor (by training, he is a nuclear engineer and physicist). He tells the following story: Of the five top officers in a submarine, three have to be present and press the correct buttons to launch the missiles. That is done deliberately, so even if part of the crew is disabled, the submarine can continue to function.

However, to officially destroy outdated medications (such as aspirin and disinfectant) in the submarine's medical office, ALL FIVE senior officers hat to be present and witness the counting and destruction. That might sound bizarre, but supposedly it makes sense.
For outdated medications, those are cheap and easy to replace, and CDC recommends keeping those up to date... But not following that CDC recommendation is gonna result in significantly less harm than not following the protocol of missile launch... SMH...
 
That might sound bizarre, but supposedly it makes sense.
Any military will, with time, turn into a bizzare bureaucracy. Just ask any service member.

The 3vs5 thing is to prevent theft. But sneaking off ship with an ICBM shoved down your pants will likely attract attention.
 
There is a novel or movie about a guy in Alaska in charge of firing a nuke. All indications are that his nation is under attack but he can't get any verification. His fellow military men put pressure on him to press the button but he just won't do it.

All this talk about chatgpt doing things for you reminds me of George Jetson who goes to work, drops his brief case off by the side of his desk, presses one button to start up his computer and kicks back with his feet on the desk while the computer does all the work.
 
Okay so, this thing apparently has a theory of mind now (version 4). That is, it can speculate about what other entities are thinking and how that might differ from objective reality or its own thoughts.
View: https://youtu.be/4MGCQOAxgv4

I used to firmly believe that a software can't be a conscious "person" but I've softened my stance on that quite a bit as I've gotten older. After all, how do we know one another are conscious? Didn't Rene Descartes speculate that there was a devil feeding information into his head to make him think that there is such a thing as "other people"? I firmly believe even lesser animals (mammals in particular) are fully conscious (im a vegan) but I'm not arrogant enough to think I can prove it.
 
Back
Top