Skip to content

Instantly share code, notes, and snippets.

@dacbd
Last active December 29, 2022 22:13
Show Gist options
  • Save dacbd/56341a855e1a45c37c732b76e9c706ee to your computer and use it in GitHub Desktop.
Save dacbd/56341a855e1a45c37c732b76e9c706ee to your computer and use it in GitHub Desktop.
Debug CML oneliners
echo 'echo "$(curl https://github.com/'"$GITHUB_ACTOR"'.keys)" >> /home/ubuntu/.ssh/authorized_keys' | base64 -w 0
# or
--cloud-startup-script=$(echo 'echo "$(curl https://github.com/'"$GITHUB_ACTOR"'.keys)" >> /home/ubuntu/.ssh/authorized_keys' | base64 -w 0)
cat /var/log/syslog | awk 'match($0, /GCEMetadataScripts: startup-script:/){print substr($0,RSTART+36) }' | more
tail -n 10000 -f /var/log/syslog | awk 'match($0, /GCEMetadataScripts: startup-script:/){print substr($0,RSTART+36) }'
tail -n 10000 -f /var/log/syslog | awk 'match($0, /startup-script:/){print substr($0,RSTART+16) }'
# include times
tail -n 10000 -f /var/log/syslog | awk 'match($0, /GCEMetadataScripts: startup-script:/){print $0}'
# find cml aws instances:
aws ec2 describe-instances --filters Name=tag:Name,Values=cml-* --region us-west-2 | jq '.Reservations[].Instances[] | select(.State.Name == "running") | .InstanceId'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment