Skip to content

Instantly share code, notes, and snippets.

Created July 23, 2013 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6059035 to your computer and use it in GitHub Desktop.
Save anonymous/6059035 to your computer and use it in GitHub Desktop.
Simple CURLOPT_READFUNCTION setup script
#!/bin/bash
# Launch a default Amazon EC2 instance
# Configuration variables
nodeversion="v0.10.13"
basedir=/var/www
# Install PHP
yum install php -y
# Install Node.js
mkdir -p $basedir && cd $basedir
wget http://nodejs.org/dist/$nodeversion/node-$nodeversion-linux-x64.tar.gz
tar xvf node-$nodeversion-linux-x64.tar.gz
ln -s $basedir/node-$nodeversion-linux-x64/bin/node /usr/bin/node
# Download and start test server
wget https://raw.github.com/guzzle/guzzle/master/tests/Guzzle/Tests/Http/server.js
node server.js &
# Output version information
php -v
curl --version
# Install and run test script
wget 'https://gist.github.com/mtdowling/6059009/raw/5cc013a74c157d0b2cad0cab2db434c030d2466e/readfuction_perf.php'
php readfuction_perf.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment