Start GeoServer with GeoNode extensions
174422
def start_geoserver(options):
    

    from geonode.settings import OGC_SERVER 
    GEOSERVER_BASE_URL = OGC_SERVER['default']['LOCATION']

    url = "http://localhost:8080/geoserver/"
    if GEOSERVER_BASE_URL != url:
        print 'your GEOSERVER_BASE_URL does not match %s' % url
        sys.exit(1)

    download_dir = path('downloaded').abspath()
    jetty_runner = download_dir / os.path.basename(JETTY_RUNNER_URL)
    data_dir = path('geoserver/data').abspath()
    web_app = path('geoserver').abspath()
    log_file = path('geoserver/jetty.log').abspath()

    # @todo - we should not have set workdir to the datadir but a bug in geoserver
    # prevents geonode security from initializing correctly otherwise
    with pushd(data_dir):
        sh(('java -Xmx512m -XX:MaxPermSize=256m'
            ' -DGEOSERVER_DATA_DIR=%(data_dir)s'
            # workaround for JAI sealed jar issue and jetty classloader
            ' -Dorg.eclipse.jetty.server.webapp.parentLoaderPriority=true'
            ' -jar %(jetty_runner)s'
            ' --log %(log_file)s'
            ' --path /geoserver %(web_app)s'
            ' > /dev/null &' % locals()
          ))

    info('Starting GeoServer on %s' % url)

    # wait for GeoServer to start
    started = waitfor(url)
    info('The logs are available at %s' % log_file)

    if not started:
        # If applications did not start in time we will give the user a chance
        # to inspect them and stop them manually.
        info(('GeoServer never started properly or timed out.'
              'It may still be running in the background.'))
        sys.exit(1)
375373
def setup_geoserver(options):
    """"""
    fast = options.get('fast', False)
    download_dir = path('downloaded')
    if not download_dir.exists():
        download_dir.makedirs()

    geoserver_dir = path('geoserver')
    geoserver_bin = path('geoserver_ext/target/geoserver.war')

    if not geoserver_bin.exists():
        geoserver_bin = download_dir / os.path.basename(ROGUE_GEOSERVER_URL)
        grab(ROGUE_GEOSERVER_URL, geoserver_bin, "geoserver binary")

    jetty_runner = download_dir / os.path.basename(JETTY_RUNNER_URL)
    grab(JETTY_RUNNER_URL, jetty_runner, "jetty runner")

    data_dir = download_dir / os.path.basename(DATA_DIR_URL)
    grab(DATA_DIR_URL, data_dir, "data dir")

    if not geoserver_dir.exists():
        geoserver_dir.makedirs()

        webapp_dir = geoserver_dir
        if not webapp_dir:
            webapp_dir.makedirs()

        print 'extracting geoserver'
        z = zipfile.ZipFile(geoserver_bin, "r")
        z.extractall(webapp_dir)

        # Set the geonode auth config to dev port 8000
        sh("perl -pi.back -e 's/localhost/localhost:8000/g;' geoserver/data/security/auth/geonodeAuthProvider/config.xml")
1065918
def setupNodding(self):
        
        g = get_root(self).globals

        if not self.nod():
            # re-enable clear mode box if not drift
            if not self.isDrift():
                self.clear.enable()

            # clear existing nod pattern
            self.nodPattern = {}
            self.check()
            return

        # Do nothing if we're not at the GTC
        if g.cpars['telins_name'] != 'GTC':
            messagebox.showerror('Error', 'Cannot dither WHT')
            self.nod.set(False)
            self.nodPattern = {}
            return

        # check for drift mode and bomb out
        if self.isDrift():
            messagebox.showerror('Error', 'Cannot dither telescope in drift mode')
            self.nod.set(False)
            self.nodPattern = {}
            return

        # check for clear not enabled and warn
        if not self.clear():
            if not messagebox.askokcancel('Warning',
                                          'Dithering telescope will enable clear mode. Continue?'):
                self.nod.set(False)
                self.nodPattern = {}
                return

        # Ask for nod pattern
        try:
            home = expanduser('~')
            fname = filedialog.askopenfilename(
                title='Open offsets text file',
                defaultextension='.txt',
                filetypes=[('text files', '.txt')],
                initialdir=home)

            if not fname:
                g.clog.warn('Aborted load from disk')
                raise ValueError

            ra, dec = np.loadtxt(fname).T
            if len(ra) != len(dec):
                g.clog.warn('Mismatched lengths of RA and Dec offsets')
                raise ValueError

            data = dict(
                ra=ra.tolist(),
                dec=dec.tolist()
            )
        except:
            g.clog.warn('Setting dither pattern failed. Disabling dithering')
            self.nod.set(False)
            self.nodPattern = {}
            return

        # store nodding on ipars object
        self.nodPattern = data
        # enable clear mode
        self.clear.set(True)
        # update
        self.check()
477624
def setup_geoserver(options):
    from geonode.settings import INSTALLED_APPS, OGC_SERVER
    """"""
    # only start if using Geoserver backend
    _backend = os.environ.get('BACKEND', OGC_SERVER['default']['BACKEND'])
    if (_backend == 'geonode.qgis_server'
            or 'geonode.geoserver' not in INSTALLED_APPS):
        return

    download_dir = path('downloaded')
    if not download_dir.exists():
        download_dir.makedirs()

    geoserver_dir = path('geoserver')

    geoserver_bin = download_dir / \
        os.path.basename(dev_config['GEOSERVER_URL'])
    jetty_runner = download_dir / \
        os.path.basename(dev_config['JETTY_RUNNER_URL'])

    grab(
        options.get('geoserver', dev_config['GEOSERVER_URL']), geoserver_bin,
        "geoserver binary")
    grab(
        options.get('jetty', dev_config['JETTY_RUNNER_URL']), jetty_runner,
        "jetty runner")

    if not geoserver_dir.exists():
        geoserver_dir.makedirs()

        webapp_dir = geoserver_dir / 'geoserver'
        if not webapp_dir:
            webapp_dir.makedirs()

        print 'extracting geoserver'
        z = zipfile.ZipFile(geoserver_bin, "r")
        z.extractall(webapp_dir)

    _install_data_dir()
4587
def start(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The start action must be called with -a or --action.'
        )

    log.info('Starting node %s', name)

    return vm_action(name, kwargs={'action': 'resume'}, call=call)
735460
def start_wsgi_server(port, addr='', registry=REGISTRY):
    """"""
    app = make_wsgi_app(registry)
    httpd = make_server(addr, port, app, handler_class=_SilentHandler)
    t = threading.Thread(target=httpd.serve_forever)
    t.daemon = True
    t.start()
875283
private function startServer()
    {
        if ($this->resource !== null) {
            return;
        }

        $this->writeln(PHP_EOL);
        $this->writeln('Starting PhantomJS Server.');

        $command = $this->getCommand();

        if ($this->config['debug']) {
            $this->writeln(PHP_EOL);

            // Output the generated command.
            $this->writeln('Generated PhantomJS Command:');
            $this->writeln($command);
            $this->writeln(PHP_EOL);
        }

        $descriptorSpec = [
            ['pipe', 'r'],
            ['file', $this->getLogDir() . 'phantomjs.output.txt', 'w'],
            ['file', $this->getLogDir() . 'phantomjs.errors.txt', 'a'],
        ];

        $this->resource = proc_open($command, $descriptorSpec, $this->pipes, null, null, ['bypass_shell' => true]);

        if (!is_resource($this->resource) || !proc_get_status($this->resource)['running']) {
            proc_close($this->resource);
            throw new ExtensionException($this, 'Failed to start PhantomJS server.');
        }

        // Wait till the server is reachable before continuing.
        $max_checks = 10;
        $checks = 0;

        $this->write('Waiting for the PhantomJS server to be reachable.');
        while (true) {
            if ($checks >= $max_checks) {
                throw new ExtensionException($this, 'PhantomJS server never became reachable.');
            }

            $fp = @fsockopen('127.0.0.1', $this->config['port'], $errCode, $errStr, 10);
            if ($fp) {
                $this->writeln('');
                $this->writeln('PhantomJS server now accessible.');
                fclose($fp);
                break;
            }

            $this->write('.');
            $checks++;

            // Wait before checking again.
            sleep(1);
        }

        // Clear progress line writing.
        $this->writeln('');
    }
1274013
def startup(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Starting up local node'
        return ret

    __salt__['trafficserver.startup']()

    ret['result'] = True
    ret['comment'] = 'Starting up local node'
    return ret
646208
function startNode(node) {
            var navNode = emptyNavigationBarNode(node);
            pushChild(parent, navNode);
            // Save the old parent
            parentsStack.push(parent);
            parent = navNode;
        }
787116
function startServer() {
    this._flo = flo(
      // The path to watch (see `setOptions(…)`).
      this.config.publicPath,
      // The config-provided fb-flo options + a generic watch glob
      // (all JS/CSS, at any depth) inside the watched path.
      extend(
        pick(this.config, FB_FLO_OPTIONS),
        { glob: ['**/*.js', '**/*.css'] }
      ),
      // Our resolver method (it was properly bound upon construction).
      this.resolver
    );
  }
212314
function nodeDomainInitialized(reset) {
        initState()
            .done(function () {
                var inProgress = updateJsonHandler.get(updateProgressKey);
                if (inProgress && reset) {
                    setUpdateStateInJSON(updateProgressKey, !reset)
                        .always(checkUpdateStatus);
                 } else if (!inProgress) {
                    checkUpdateStatus();
                }
            });
    }
691734
def _startStationsNode(self, name, attrs):
        """"""

        if name == 'station':
            self._stationId = attrs.get('id')
            self._callSign = None
            self._stationName = None
            self._affiliate = None
            self._fccChannelNumber = None
1060267
def start(port, root_directory, bucket_depth):
    """"""
    application = S3Application(root_directory, bucket_depth)
    http_server = httpserver.HTTPServer(application)
    http_server.listen(port)
    ioloop.IOLoop.current().start()
491262
function start (settings) {

  settings = settings || {};

  // Populate security values with the corresponding files.
  if (settings.secure) {
    settings.passphrase = settings.passphrase || '1234';
    settings.key = settings.key || 'https.key';
    settings.cert = settings.cert || 'https.crt';
    settings.ca = settings.ca || [];
  }

  settings.port = settings.port || (settings.secure ? 443 : 80);

  return startServer(settings);
}
491506
private static void startServer() throws Exception {
          JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
          sf.setResourceClasses(TileFetcher.class);

          List<Object> providers = new ArrayList<Object>();
          // add custom providers if any
          providers.add(new org.apache.cxf.jaxrs.provider.JAXBElementProvider());
          providers.add(new org.apache.cxf.jaxrs.provider.json.JSONProvider());
          sf.setProviders(providers);

          sf.setResourceProvider(TileFetcher.class,
                  new SingletonResourceProvider(new TileFetcher(), true));
          sf.setAddress(ENDPOINT_ADDRESS);

          server = sf.create();

     }
1230434
public static void start(FsSettings settings, ElasticsearchClient esClient) {
        // We create the service only one
        if (httpServer == null) {
            // create a resource config that scans for JAX-RS resources and providers
            // in fr.pilato.elasticsearch.crawler.fs.rest package
            final ResourceConfig rc = new ResourceConfig()
                    .registerInstances(
                            new ServerStatusApi(esClient, settings),
                            new UploadApi(settings, esClient))
                    .register(MultiPartFeature.class)
                    .register(RestJsonProvider.class)
                    .register(JacksonFeature.class)
                    .register(new CORSFilter(settings.getRest()))
                    .packages("fr.pilato.elasticsearch.crawler.fs.rest");

            // create and start a new instance of grizzly http server
            // exposing the Jersey application at BASE_URI
            httpServer = GrizzlyHttpServerFactory.createHttpServer(URI.create(settings.getRest().getUrl()), rc);
            logger.info("FS crawler Rest service started on [{}]", settings.getRest().getUrl());
        }
    }
1290546
function(node) {
            var nodeList = this.getElementsByTagNameNS(node, this.gmlns,
                                                   "coordinates");
            var coordString;
            var coords, beginPoint = null, endPoint = null;
            if (nodeList.length > 0) {
                coordString = nodeList[0].firstChild.nodeValue;
                coords = coordString.split(" ");
                if (coords.length == 2) {
                    beginPoint = coords[0].split(",");
                    endPoint = coords[1].split(",");
                }
            }
            if (beginPoint !== null && endPoint !== null) {
                return new OpenLayers.Bounds(parseFloat(beginPoint[0]),
                    parseFloat(beginPoint[1]),
                    parseFloat(endPoint[0]),
                    parseFloat(endPoint[1]) );
            }
        }