Let's say you want to host domains first.com and second.com.
Create folders for their files:
| @service.run | |
| def getmap(conn, tablename, the_geom="geom", bbox=''): | |
| """ """ | |
| session.forget(response) | |
| js = """ | |
| var url = "%(url)s"; | |
| var gargs = "%(bbox)s" && '?bbox='+"%(bbox)s"; | |
| var dynSource = new ol.source.Vector({ | |
| url: url + gargs, | |
| format: new ol.format.GeoJSON(), |
| #!/bin/bash | |
| echo 'Requires Ubuntu = 16.04 and installs Nginx + uWSGI + Web2py' | |
| # Check if user has root privileges | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "You must run the script as root or using sudo" | |
| exit 1 | |
| fi | |
| # parse env vars | |
| WEB2PY_PASS="${WEB2PY_PASS:-0}" | |
| NOPASSWORD="${NOPASSWORD:-0}" |
| import pygame | |
| from pygame import locals | |
| import socket | |
| import atexit | |
| pygame.init() | |
| pygame.joystick.init() # main joystick device system | |
| try: |
| var SerialPort = require("serialport").SerialPort, | |
| express = require('express'), | |
| bodyParser = require('body-parser'); | |
| // initialize a sample request function | |
| //This request will be posted once the server is started | |
| var request = require('request'); | |
| request({ | |
| method: 'POST', |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| ''' | |
| Inspired by: | |
| * http://weeklybuild.com/2014/07/07/mjpeg-bottle-gstreamer/ | |
| * http://www.ridgesolutions.ie/index.php/2014/11/24/streaming-mjpeg-video-with-web2py-and-python/ | |
| * https://gist.github.com/n3wtron/4624820 | |
| ''' |
| #!/bin/bash | |
| git clone --recursive https://github.com/web2py/web2py.git web2py_temp | |
| cd web2py_temp | |
| git checkout tags/R-2.11.2 | |
| git submodule update --init --recursive | |
| python scripts/make_min_web2py.py ../web2py | |
| mv applications/admin ../web2py/applications/ | |
| cd ../ | |
| rm -rf web2py_temp |
| #!/bin/sh | |
| # Script to turn a generic Debian Squeeze box into an Eden server | |
| # with Apache & MySQL | |
| # Update system | |
| apt-get update | |
| #apt-get upgrade -y | |
| # Install Admin Tools | |
| apt-get install -y unzip | |
| # Install Git | |
| apt-get install -y git-core |
| #!/usr/bin/python | |
| import sys | |
| import usb.core | |
| import usb.util | |
| import time | |
| import os | |
| import pygame | |
| from pygame.locals import* | |
| def mapnum(x, in_min, in_max, out_min, out_max): |
| import time | |
| def print_rows(rows): | |
| print time.ctime() | |
| for row in rows: | |
| print row | |
| db = DAL('sqlite://cache_test.db', pool_size=0) | |
| db.define_table('t1', Field('name',type='string')) |