Skip to content

Instantly share code, notes, and snippets.

metagpt "Create the terraform to manage and AWS Organizations account for a company that is going to manage multiple AWS accounts."
2024-05-03 12:15:41.651 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to /Users/hustonjs/libs/github.com/james-huston/terraform-base
2024-05-03 12:15:56.797 | INFO | metagpt.team:invest:90 - Investment: $3.0.
2024-05-03 12:15:56.799 | INFO | metagpt.roles.role:_act:391 - Alice(Product Manager): to do PrepareDocuments(PrepareDocuments)
2024-05-03 12:15:56.885 | INFO | metagpt.utils.file_repository:save:57 - save to: /Users/hustonjs/libs/github.com/james-huston/terraform-base/workspace/20240503121556/docs/requirement.txt
2024-05-03 12:15:56.887 | INFO | metagpt.roles.role:_act:391 - Alice(Product Manager): to do WritePRD(WritePRD)
2024-05-03 12:15:56.888 | INFO | metagpt.actions.write_prd:run:86 - New requirement detected: Create the terraform to manage and AWS Organizations account for a company that is going to manage multiple AWS
@james-huston
james-huston / aws-assume-role.sh
Last active April 28, 2017 14:25
Assume role using the AWS cli and add creds to a profile for use in other commands.
#!/bin/bash
ROLE_ARN="$1"
AWS_PROFILE="$2"
ROLE_JSON="$(aws sts assume-role --role-arn ${ROLE_ARN} --role-session-name ${AWS_PROFILE}-deploy)"
SECRETKEYREGEX='"SecretAccessKey": "([^"]*)"'
ACCESSKEYREGEX='"AccessKeyId": "([^"]*)"'
TOKENREGEX='"SessionToken": "([^"]*)"'

Keybase proof

I hereby claim:

  • I am james-huston on github.
  • I am hustonjs (https://keybase.io/hustonjs) on keybase.
  • I have a public key whose fingerprint is A5CD 7690 264C 9787 A94D 132D 72B0 7387 82E2 4EB9

To claim this, I am signing this object:

function ls {
RAND=$[ 1 + $[ RANDOM % 20 ]]
if [ $RAND == 1 ]
then
osascript -e 'set volume 7'
say "god I wish had not left my computer unlocked" &
fi
/bin/ls "$@"
}
@james-huston
james-huston / node
Created February 2, 2016 15:08
generic node with controlled GC
node --gc_global --optimize_for_size --max_old_space_size=960 --use_idle_notification --always_compact --max_executable_size=64 --gc_interval=100 --expose_gc server.js
#!/bin/bash
sudo yum update -y
sudo yum install -y ruby
sudo yum install -y aws-cli
cd /home/ec2-user
aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1
chmod +x ./install
sudo ./install auto
@james-huston
james-huston / installiojs.sh
Created August 7, 2015 21:04
Install iojs on amazon instance
#!/bin/bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
chmod u+x ~/.nvm/nvm.sh
source ~/.bashrc
nvm install iojs-v3.0.0
nvm alias default iojs-v3.0.0
@james-huston
james-huston / installnode.sh
Created June 22, 2015 21:12
install node binary quick and dirty like
#!/bin/bash
cd /tmp
wget http://nodejs.org/dist/v0.12.5/node-v0.12.5-linux-x64.tar.gz
tar -xvzf node-v0.12.5-linux-x64.tar.gz
sudo cp -r node-v0.12.5-linux-x64/bin/* /usr/local/bin/
sudo cp -r node-v0.12.5-linux-x64/lib/* /usr/local/lib/
rm -rf /tmp/node-v0.12.5*
@james-huston
james-huston / message.sh
Last active August 29, 2015 14:14
Generate an image with text in it to look like an sms using ImageMagick
#!/bin/bash
cat test.txt | \
convert -background '#44aff7' -fill white -size 250x5000 -trim +repage -font AvantGarde-Book -pointsize 16 caption:@- miff:- |\
#convert -background blue \
# -size $((`identify -format %w test_tmp.png` + 20))x$((`identify -format %h test_tmp.png` + 20)) \
# xc: test_tmp.png -flatten test.png
convert - -bordercolor '#44aff7' -border 10x10 test.png
@james-huston
james-huston / haproxy.conf
Created December 23, 2014 18:03
haproxy.conf polling and sockets with sticky sessions using url param
global
maxconn 32768
quiet
# Performance turning
tune.maxaccept -1
stats socket /tmp/haproxy.sock mode 0666 level admin
log 127.0.0.1 local0 notice
log 127.0.0.1 local0 debug