Skip to content

Instantly share code, notes, and snippets.

# builds an authenticated S3 query string without having
# to connect to the server first
class S3QueryString < String
def initialize(path, bucket, options = {})
super()
@access_key_id = options[:access_key_id]
@secret_access_key = options[:secret_access_key]
@bucket = bucket
package com.application.shared.ui.controls
{
import flash.display.DisplayObject;
import flash.display.StageDisplayState;
import flash.events.Event;
import flash.events.FullScreenEvent;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.geom.Rectangle;
Edit the file /var/www/vhosts/:virtual_host/conf/httpd.include
Replace #{server_ip}, :domain_name, :virtual_host, :application, #{application_port} with your own details.
---
<VirtualHost #{server_ip}:80>
ServerName :domain_name:80
ServerAlias *.:domain_name
DocumentRoot /var/www/vhosts/:virtual_host/:application/public
<Directory /var/www/vhosts/:virtual_host/:application/public>
touch /etc/init.d/supervisord.init
--- edit the file to look like the following:
# chkconfig: 345 20 80
# description: Manages processes
/usr/bin/supervisord
---
echo_supervisord_conf > /etc/supervisord.conf #sets up the sample supervisor configuration.
-- now edit the file and add your application details. Here is a sample. Replace :virtual_host with your virtual host name.
[program:myapp]
command=/var/www/vhosts/:virtual_host/application/start.sh
autostart=true
autorestart=true
startretries=3
stdout_logfile=/var/www/vhosts/:virtual_host/application/log/server.log
touch /var/www/vhosts/:virtual_host/application/start.sh
--- edit the file to include the following. Replace :virtual_host and :application.js with your own files.
#! /bin/sh
cd /var/www/vhosts/:virtual_host/application
/usr/local/bin/node :application.js
mkdir -p /var/www/vhosts/:virtual_host/application/log
easy_install supervisor
cd ~/src
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c8.tar.gz
tar xfvz setuptools-0.6c8.tar.gz
cd setuptools-0.6c8
python setup.py build
python setup.py install
mkdir -p ~/src && cd ~/src && git clone git://github.com/ry/node.git
cd node/deps/udns && ./configure && make
cd .. && ./configure && make && make install