Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| Running command {:args=>["/bin/bash", "-c", "env PYTHONPATH=/usr/lib/ruby/gems/1.9.1/gems/fpm-1.0.1/lib/fpm/package python setup.py --command-packages=pyfpm get_metadata --output=/tmp/package-python-build20131211-11854-1r8ym9h/metadata.json"], :level=>:debug, :file=>"fpm/util.rb", :line=>"48"} | |
| Process is running {:pid=>11859, :level=>:debug, :file=>"fpm/util.rb", :line=>"61"} | |
| Running from scipy source directory. {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"} | |
| usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"} | |
| or: setup.py --help [cmd1 cmd2 ...] {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"} | |
| or: setup.py --help-commands {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"} | |
| or: setup.py cmd --help {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"} | |
| {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"} | |
| error: invalid command 'get_metadata' {:level=>:info, :file=>"cabin/mixins/pipe |
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| #!/bin/sh | |
| # 2021-12-09: | |
| # This script is no longer supported! | |
| # Apple broke all direct downloads without logging with an Apple ID first. | |
| # The number of hoops that a script would need to jump through to login, | |
| # store cookies, and download is prohibitive. | |
| # Now we all must manually download and mirror the files for this to work at all :'-( | |
| OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}') |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/bin/bash | |
| exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
| curl -L https://www.opscode.com/chef/install.sh | sudo bash -s -- -v 10.18.2 | |
| mkdir -p /var/log/chef | |
| mkdir -p /var/backups/chef | |
| mkdir -p /var/run/chef | |
| mkdir -p /var/cache/chef | |
| mkdir -p /var/lib/chef | |
| mkdir /etc/chef | |
| cat - >/etc/chef/bootstrap.json <<EOF |
| # In Chef, when a resource is defined all its variables are evaluated during | |
| # compile time and the execution of the resource takes place in converge phase. | |
| # So if the value of a particular attribute is changed in converge | |
| # (and not in compile) the resource will be executed with the old value. | |
| # Example problem: | |
| # Let's consider this situation where there are two steps involved in a recipe | |
| # Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed | |
| # in converge phase | |
| # Step 2 is a Chef resource that makes use of the node attribute that was |
| module Vagrant | |
| module Provisioners | |
| class ChefClient | |
| def cleanup | |
| env[:ui].info "Attempting to remove client #{env[:vm].config.vm.host_name}" | |
| `knife client show #{env[:vm].config.vm.host_name}` | |
| if $?.to_i == 0 | |
| env[:ui].info "Removing client #{env[:vm].config.vm.host_name}" | |
| `knife client delete #{env[:vm].config.vm.host_name} -y` | |
| end |
This will demonstrate how to upload build files from Travis CI to S3.
NOTE: Keys have been changed to protect the innocent.
Create an S3 ACL policy, see s3_policy.json for an example.