/labs/tiles/12 | |
/labs/tiles/13 | |
/labs/tiles/14 | |
/labs/tiles/15 | |
/labs/tiles/16 | |
/labs/tiles/17 | |
/labs/tiles/19 |
#!/bin/bash | #!/bin/bash |
#this script should be run from a fresh git checkout from github | #this script should be run from a fresh git checkout from github |
#ami base must have yum install lighttpd-fastcgi, git, tomcat6 | #ami base must have yum install lighttpd-fastcgi, git, tomcat6 |
#php-cli php-gd tomcat6-webapps tomcat6-admin-webapps svn maven2 | #php-cli php-gd tomcat6-webapps tomcat6-admin-webapps svn maven2 |
#postgres postgres-server php-pg | #postgres postgres-server php-pg |
#http://www.how2forge.org/installing-lighttpd-with-php5-and-mysql-support-on-fedora-12 | #http://www.how2forge.org/installing-lighttpd-with-php5-and-mysql-support-on-fedora-12 |
cp /root/aws.php /tmp/ | sh busuiphp.sh |
mkdir /var/www/lib/staticmaplite/cache | sh busuidb.sh |
chcon -h system_u:object_r:httpd_sys_content_t /var/www | sh busuiotp.sh |
chcon -R -h root:object_r:httpd_sys_content_t /var/www/* | |
chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache | |
chmod -R 777 /var/www/lib/staticmaplite/cache | |
chcon -R -t httpd_sys_content_rw_t /var/www/labs/tiles | |
chmod -R 777 /var/www/labs/tiles | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ | |
-O /var/www/cbrfeed.zip | |
createdb transitdata | |
createlang -d transitdata plpgsql | |
psql -d transitdata -f /var/www/lib/postgis.sql | |
# curl https://github.com/maxious/ACTBus-ui/raw/master/transitdata.cbrfeed.sql.gz -o transitdata.cbrfeed.sql.gz | |
#made with pg_dump transitdata | gzip -c > transitdata.cbrfeed.sql.gz | |
gunzip /var/www/transitdata.cbrfeed.sql.gz | |
psql -d transitdata -f /var/www/transitdata.cbrfeed.sql | |
#createuser transitdata -SDRP | |
#password transitdata | |
#psql -d transitdata -c \"GRANT SELECT ON TABLE agency,calendar,calendar_dates,routes,stop_times,stops,trips TO transitdata;\" | |
#psql -d transitdata -c "GRANT SELECT,INSERT ON TABLE myway_observations,myway_routes,myway_stops,myway_timingdeltas TO transitdata;" | |
#psql -d transitdata -c "GRANT SELECT,INSERT,UPDATE ON TABLE myway_routes,myway_stops TO transitdata;" | |
##psql -d transitdata -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO transitdata;" | |
php /var/www/updatedb.php | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ | |
-O /tmp/Graph.obj | |
rm -rfv /usr/share/tomcat6/webapps/opentripplanner* | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-webapp.war \ | |
-O /usr/share/tomcat6/webapps/opentripplanner-webapp.war | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-api-webapp.war \ | |
-O /usr/share/tomcat6/webapps/opentripplanner-api-webapp.war | |
/etc/init.d/tomcat6 restart | |
createdb transitdata | |
createlang -d transitdata plpgsql | |
psql -d transitdata -f /var/www/lib/postgis.sql | |
# curl https://github.com/maxious/ACTBus-ui/raw/master/transitdata.cbrfeed.sql.gz -o transitdata.cbrfeed.sql.gz | |
#made with pg_dump transitdata | gzip -c > transitdata.cbrfeed.sql.gz | |
gunzip /var/www/transitdata.cbrfeed.sql.gz | |
psql -d transitdata -f /var/www/transitdata.cbrfeed.sql | |
#createuser transitdata -SDRP | |
#password transitdata | |
#psql -d transitdata -c "GRANT SELECT ON TABLE agency,calendar,calendar_dates,routes,stop_times,stops,trips TO transitdata;" | |
#psql -d transitdata -c "GRANT SELECT,INSERT ON TABLE myway_observations,myway_routes,myway_stops,myway_timingdeltas TO transitdata;" | |
#psql -d transitdata -c "GRANT SELECT,INSERT,UPDATE ON TABLE myway_routes,myway_stops TO transitdata;" | |
##psql -d transitdata -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO transitdata;" | |
php /var/www/updatedb.php |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ | |
-O /tmp/Graph.obj | |
/etc/init.d/tomcat6 stop | |
rm -rfv /usr/share/tomcat6/webapps/opentripplanner* | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-webapp.war \ | |
-O /usr/share/tomcat6/webapps/opentripplanner-webapp.war | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-api-webapp.war \ | |
-O /usr/share/tomcat6/webapps/opentripplanner-api-webapp.war | |
/etc/init.d/tomcat6 restart | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/testing/Graph.obj \ | |
-O /tmp/Graph.obj | |
/etc/init.d/tomcat6 stop | |
rm -rfv /usr/share/tomcat6/webapps/opentripplanner* | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/testing/opentripplanner-webapp.war \ | |
-O /usr/share/tomcat6/webapps/opentripplanner-webapp.war | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/testing/opentripplanner-api-webapp.war \ | |
-O /usr/share/tomcat6/webapps/opentripplanner-api-webapp.war | |
/etc/init.d/tomcat6 restart | |
cp /root/aws.php /tmp/ | |
mkdir /var/www/lib/staticmaplite/cache | |
chcon -h system_u:object_r:httpd_sys_content_t /var/www | |
chcon -R -h root:object_r:httpd_sys_content_t /var/www/* | |
chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache | |
chmod -R 777 /var/www/lib/staticmaplite/cache | |
chcon -R -t httpd_sys_content_rw_t /var/www/labs/tiles | |
chmod -R 777 /var/www/labs/tiles | |
chcon -R -t httpd_sys_content_rw_t /var/www/lib/openid-php/oid_store | |
chmod -R 777 /var/www/lib/openid-php/oid_store | |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ | |
-O /var/www/cbrfeed.zip |
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> | |
<!-- Single graph --> | |
<import resource="classpath:org/opentripplanner/api/application-context.xml" /> | |
<bean id="graphBundle" class="org.opentripplanner.model.GraphBundle"> | |
<property name="path" value="/tmp/" /> | |
</bean> | |
</beans> | |
<?php | |
function getScheme() | |
{ | |
$scheme = 'http'; | |
if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { | |
$scheme .= 's'; | |
} | |
return $scheme; | |
} | |
function getTrustRoot() | |
{ | |
return sprintf("%s://%s:%s%s/", | |
getScheme(), $_SERVER['SERVER_NAME'], | |
$_SERVER['SERVER_PORT'], | |
dirname($_SERVER['PHP_SELF'])); | |
} | |
// Includes required files | |
set_include_path(get_include_path() . PATH_SEPARATOR . $labsPath."lib/openid-php/"); | |
require_once "Auth/OpenID/Consumer.php"; | |
require_once "Auth/OpenID/FileStore.php"; | |
require_once "Auth/OpenID/AX.php"; | |
function login() | |
{ | |
// Just tested this with/for Google, needs trying with others ... | |
$oid_identifier = 'https://www.google.com/accounts/o8/id'; | |
// Create file storage area for OpenID data | |
$store = new Auth_OpenID_FileStore('lib/openid-php/oid_store'); | |
// Create OpenID consumer | |
$consumer = new Auth_OpenID_Consumer($store); | |
// Create an authentication request to the OpenID provider | |
$auth = $consumer -> begin($oid_identifier); | |
// Create attribute request object | |
// See http://code.google.com/apis/accounts/docs/OpenID.html#Parameters for parameters | |
// Usage: make($type_uri, $count=1, $required=false, $alias=null) | |
$attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/contact/email', 2, 1, 'email'); | |
$attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/namePerson/first', 1, 1, 'firstname'); | |
$attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/namePerson/last', 1, 1, 'lastname'); | |
// Create AX fetch request | |
$ax = new Auth_OpenID_AX_FetchRequest; | |
// Add attributes to AX fetch request | |
foreach($attribute as $attr) { | |
$ax -> add($attr); | |
} | |
// Add AX fetch request to authentication request | |
$auth -> addExtension($ax); | |
$_SESSION['returnURL'] = curPageURL(); | |
// Redirect to OpenID provider for authentication | |
$url = $auth -> redirectURL(getTrustRoot(), $_SESSION['returnURL']); | |
header('Location: ' . $url); | |
} | |
function auth() | |
{ | |
if ($_SESSION['authed'] == true) return true; | |
// Create file storage area for OpenID data | |
$store = new Auth_OpenID_FileStore('lib/openid-php/oid_store'); | |
// Create OpenID consumer | |
$consumer = new Auth_OpenID_Consumer($store); | |
// Create an authentication request to the OpenID provider | |
$response = $consumer -> complete($_SESSION['returnURL']); | |
if ($response -> status == Auth_OpenID_SUCCESS) { | |
// Get registration informations | |
$ax = new Auth_OpenID_AX_FetchResponse(); | |
$obj = $ax -> fromSuccessResponse($response); | |
$email = $obj -> data['http://axschema.org/contact/email'][0]; | |
var_dump($email); | |
if ($email != "maxious@gmail.com") { | |
die("Access Denied"); | |
} else { | |
$_SESSION['authed'] = true; | |
} | |
} else { | |
login(); | |
} | |
} | |
if ($_REQUEST['janrain_nonce']) auth(); | |
?> |
<?php | <?php |
// Copyright 2009 Google Inc. All Rights Reserved. | // Copyright 2009 Google Inc. All Rights Reserved. |
$GA_ACCOUNT = "MO-22173039-1"; | $GA_ACCOUNT = "MO-22173039-1"; |
$GA_PIXEL = "/lib/ga.php"; | $GA_PIXEL = "/lib/ga.php"; |
function googleAnalyticsGetImageUrl() | function googleAnalyticsGetImageUrl() |
{ | { |
global $GA_ACCOUNT, $GA_PIXEL; | global $GA_ACCOUNT, $GA_PIXEL; |
//if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return ""; | //if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return ""; |
$url = ""; | $url = ""; |
$url.= $GA_PIXEL . "?"; | $url.= $GA_PIXEL . "?"; |
$url.= "utmac=" . $GA_ACCOUNT; | $url.= "utmac=" . $GA_ACCOUNT; |
$url.= "&utmn=" . rand(0, 0x7fffffff); | $url.= "&utmn=" . rand(0, 0x7fffffff); |
$referer = $_SERVER["HTTP_REFERER"]; | $referer = $_SERVER["HTTP_REFERER"]; |
$query = $_SERVER["QUERY_STRING"]; | $query = $_SERVER["QUERY_STRING"]; |
$path = $_SERVER["REQUEST_URI"]; | $path = $_SERVER["REQUEST_URI"]; |
if (empty($referer)) { | if (empty($referer)) { |
$referer = "-"; | $referer = "-"; |
} | } |
$url.= "&utmr=" . urlencode($referer); | $url.= "&utmr=" . urlencode($referer); |
if (!empty($path)) { | if (!empty($path)) { |
$url.= "&utmp=" . urlencode($path); | $url.= "&utmp=" . urlencode($path); |
} | } |
$url.= "&guid=ON"; | $url.= "&guid=ON"; |
return str_replace("&", "&", $url); | return str_replace("&", "&", $url); |
} | } |
function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) | function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) |
{ | { |
global $labsPath; | global $labsPath,$serviceAlertsEnabled; |
echo ' | echo ' |
<!DOCTYPE html> | <!DOCTYPE html> |
<html lang="en"> | <html lang="en"> |
<head> | <head> |
<meta charset="UTF-8"> | <meta charset="UTF-8"> |
<meta name="viewport" content="width=device-width, initial-scale=1"> | <meta name="viewport" content="width=device-width, initial-scale=1"> |
<title>' . $pageTitle . '</title> | <title>' . $pageTitle . '</title> |
<meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" /> | <meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" /> |
<link rel="dns-prefetch" href="//code.jquery.com"> | <link rel="dns-prefetch" href="//code.jquery.com"> |
<link rel="dns-prefetch" href="//ajax.googleapis.com"> | <link rel="dns-prefetch" href="//ajax.googleapis.com"> |
<link rel="stylesheet" href="' . $labsPath . 'css/jquery-ui-1.8.12.custom.css" />'; | <link rel="stylesheet" href="' . $labsPath . 'css/jquery-ui-1.8.12.custom.css" />'; |
if (isDebugServer()) { | if (isDebugServer()) { |
$jqmcss = $labsPath . 'css/jquery.mobile-1.0b2.css'; | $jqmcss = $labsPath . 'css/jquery.mobile-1.0b2.css'; |
$jqjs = $labsPath . 'js/jquery-1.6.2.min.js'; | $jqjs = $labsPath . 'js/jquery-1.6.2.min.js'; |
$jqmjs = $labsPath . 'js/jquery.mobile-1.0b2.js'; | $jqmjs = $labsPath . 'js/jquery.mobile-1.0b2.js'; |
} | } |
else { | else { |
$jqmcss = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css"; | $jqmcss = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css"; |
$jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"; | $jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"; |
$jqmjs = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js"; | $jqmjs = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js"; |
} | } |
echo '<link rel="stylesheet" href="' . $jqmcss . '" /> | echo '<link rel="stylesheet" href="' . $jqmcss . '" /> |
<script src="'.$jqjs.'"></script> | <script src="'.$jqjs.'"></script> |
<script>$(document).bind("mobileinit", function(){ | <script>$(document).bind("mobileinit", function(){ |
$.mobile.ajaxEnabled = false; | $.mobile.ajaxEnabled = false; |
}); | }); |
</script> | </script> |
<script src="'.$jqmjs.'"></script> | <script src="'.$jqmjs.'"></script> |
<script src="' . $labsPath . 'js/jquery.ui.core.min.js"></script> | <script src="' . $labsPath . 'js/jquery.ui.core.min.js"></script> |