I tested ChatGPT to see if it could pass a Bash programming exam using questions of its own choosing. My assessment is that the bot scored 1/5 and failed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this in ~/.zshrc | |
# Dependencies: | |
# Ruby | |
# gem install hashdiff | |
# gem install awesome_print | |
hash_diff() { | |
if [[ "$#" -ne 2 ]] ; then | |
echo "Usage: hash_diff YAML_FILE1 YAML_FILE2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import uuid | |
import os | |
import sys | |
from time import strftime, localtime | |
from typing import Generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d89ddb1 (from 95febfb) Merge branch 'master' of ../jenkins into alex/jenkins | |
A .gitignore | |
A .rspec | |
A Gemfile | |
A Makefile | |
A README.md | |
A TODO.md | |
A assets.json | |
A bake.sh | |
A cloudformation/buildbox.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pprint | |
def merge(x,y): | |
return dict(x, **y) | |
ebs_block_device = [{ | |
'device_name': "/dev/sdg", | |
'volume_size': 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
require 'open3' | |
class TerraformTesting | |
@@terraform = "#{ENV['HOME']}/go/bin/terraform" | |
def eval(path, addr, mock_data) | |
command = "#{@@terraform} testing eval #{path} #{addr} -" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Code for my blog post at: | |
# https://alexharv074.github.io/2019/06/09/adventures-in-the-terraform-dsl-part-v-conditional-logic.html | |
t011=/usr/local/bin/terraform | |
t012=/usr/local/bin/terraform012 | |
data() { | |
cat <<EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Using the original template | |
+ sam deploy --template-file packaged.yaml --stack-name HelloWorld --capabilities CAPABILITY_IAM | |
Waiting for changeset to be created.. | |
Failed to create the changeset: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Invalid template property or properties [Api] | |
+ exit 255 | |
## Template after correcting errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test.sh | |
#!/usr/bin/env bash | |
for n in aaa bbb ccc ; do | |
mv $n $n.bak ## Quoting not required if | |
done ## inputs are known. | |
for n in ddd/* ; do | |
mv "$n" "$n.bak" ## Quoting *is* required if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Unit test code | |
run() { | |
case "$SCRIPT" in | |
AlexHarvey) | |
gsed $1 ' | |
1{ | |
/999/d | |
} |
NewerOlder