Puts everything on the chosen server
483548
public function compile() {
		$this->start('Compiling to '. $this->host);

		// fix path
		$this->localProj	= self::path($this->localProj);
		$this->remoteProj	= rtrim($this->remoteProj, DIRECTORY_SEPARATOR);
		
		// Work from project
		if(isset($this->localProj) && is_dir($this->localProj))
			chdir($this->localProj);
		
		// documentation
		if(isset($this->localDoc))
			$this->start('Creating Documentation from ' . $this->localDoc)->makeDoc()->finish();
		
		// twig templates
		if(isset($this->localTpl))
			$this->start('Creating JS Templates from ' . $this->localTpl)->makeTpl()->finish();
		
		
		// static files
		$localStatic = self::path(sys_get_temp_dir()) . 'data' . time() . DIRECTORY_SEPARATOR;
		$this->wipe[] = $localStatic;
		
		foreach($this->remoteStatic as $type => $trash) {
			if(method_exists($this, $type)) {
				$this->tmp[ $type ] = $localStatic . $type . DIRECTORY_SEPARATOR;
				self::readyDir( $this->tmp[ $type ] );

				// process static files
				$this->start('Processing '. $type)->$type()->finish();
				
			} elseif(!empty($this->localStatic[ $type ])) {
					// just moved the folder
					$this->tmp[ $type ] = self::path(current ($this->localStatic[ $type ]));
					
					// remove if not there
					if(!file_exists($this->tmp[ $type ])) 
						unset ($this->remoteStatic[ $type ]);
			}
		}

		// run through static files then upload them
		$this->start('Uploading Static')->uploadStatic()->finish();

		// upload project
		$cmd = [
			'pscp',
			'-p',									// preserve attributes
			'-r',									// copy recursively
			'-q',									// silent
			//'-sftp',								// for use of SFTP protocal
			'-batch',								// non interactive
			'-C',									// enable compression
			'-i', static::safeDir($this->ppk),						// Private key file to access server
		];
		
		// Directory to upload
		foreach($this->localCopy as $name)
			$cmd[] = static::safeDir($this->localProj . $name);
		
		// host:path on server to save data
		$cmd[] = $this->host .':'. $this->remoteProj;
		
		$this->start('Uploading Project')->runLocal($cmd)->finish();

		// config
		if(!isset($this->s3) && !empty($this->remoteStatic)) {
			// reset file permissions
			$cmd = array();
			foreach($this->remoteStatic as $type => $path) {
				$cmd[] = 'chmod 774 -R '. $path;
				// $cmd[] = 'chown mo:www-data -R '. $path;
			}
			
			$this->start('Updating Server Enviroment')->runRemote( $cmd )->finish();
		}

		// clean up
		$this	->start('Cleaning up');
			foreach($this->wipe as $dir)
				self::wipeDir($dir, true);
		$this	->finish();
		
		// finally
		$this->finish();
	}
43528
def flushall(host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.flushall()
1139482
def nginx(ctx, hostname):
    """"""

    install_nginx(ctx.obj['dbhost'], ctx.obj['dbname'], ctx.obj['port'], hostname)
482796
public final void server() {
    String port = parsedArguments.getString("port");
    String model = parsedArguments.getString(MODEL);
    String lexer = parsedArguments.getString("lexer");
    String dictTag = parsedArguments.getString("dictTag");
    String dictPath = parsedArguments.getString("dictPath");
    String clearFeatures = parsedArguments.getString("clearFeatures");
    String outputFormat = parsedArguments.getString("outputFormat");
    String lang = parsedArguments.getString("language");
    Properties serverproperties = setNameServerProperties(port, model, lang,
        lexer, dictTag, dictPath, clearFeatures, outputFormat);
    new NERTaggerServer(serverproperties);
  }
848064
def optparse(*args)
      opts = OptionParser.new

      opts.banner = "usage: #{$0} [options]"

      opts.on('-H','--host HOST',"The host to run the server on","Default: #{@host}") do |host|
        @host = host
      end

      opts.on('-p','--port PORT',"The port to run the server on","Default: #{@port}") do |port|
        @port = port.to_i
      end

      opts.on('--s','--server NAME','Rack handler to run the server under') do |handler|
        @handler = handler
      end

      opts.on('-h','--help','Display the help output') do
        puts opts
        exit
      end

      begin
        opts.parse!(args)
      rescue OptionParser::InvalidOption => e
        STDERR.puts e.message
        STDERR.puts opts
        exit -1
      end
    end
1268097
function() {
  setups = {}
  model.servers = []
  model.headers = []
  model.ui = _.clone(uidefaults)
  model.controls = _.clone(controldefaults)

  if (DEBUG) { console.log('discover started') }
  wampsession.publish('discover', [])
  setTimeout(function () {
    if (DEBUG) { console.log('discover ended') }
    model.servers = _.values(setups)
  }, 500)
}
1131166
protected function setServer()
	{
		$server = $this->config->get('gateway.zarinpal.server', 'germany');
		switch ($server) {
			case 'iran':
				$this->serverUrl = $this->iranServer;
				break;
                
			case 'test':
				$this->serverUrl = $this->sandboxServer;
				$this->gateUrl = $this->sandboxGateUrl;
				break;

			case 'germany':
			default:
				$this->serverUrl = $this->germanyServer;
				break;
		}
	}
530573
def configure_server():
    '''
    
    '''

    home = os.path.expanduser('~')
    if os.path.isfile(os.path.join(home, '.transfer', 'config.yaml')):
        with open(os.path.join(home, '.transfer', 'config.yaml'), 'r') as fp:
            config = yaml.load(fp.read())
    else:
        config = []

    project_name = input('Name your project: ')
    existing_project = None
    for project in config:
        if project_name == project['name']:
            existing_project = project_name
    if existing_project is not None:
        print(colored('Project ' + project_name + ' already exists', 'red'))
        overwrite = str_input('Would you like to overwrite this project? (yes or no) ', ['yes', 'no'])
        if overwrite == 'no':
            return
        else:
            config = [project for project in config if project_name != project['name']]

    api_port = int_input('port for local prediction API (suggested: 5000)', 1024, 49151)
    print('Select image resolution:')
    print('[0] low (224 px)')
    print('[1] mid (448 px)')
    print('[2] high (896 px)')
    img_resolution_index = int_input('choice', 0, 2, show_range = False)
    if img_resolution_index == 0:
        img_size = 1
    elif img_resolution_index == 1:
        img_size = 2
    else:
        img_size = 4
    num_categories = int_input('number of image categories in your model', 0, 10000000)

    weights = False
    while weights == False:
        server_weights = os.path.expanduser(input('Select weights file: '))
        if os.path.isfile(server_weights):
            weights = True
        else:
            print('Cannot find the weight file: ', server_weights)

    project = {'name': project_name,
               'api_port': api_port,
               'img_size': img_size,
               'number_categories': num_categories,
               'server_weights': server_weights}

    config.append(project)
    store_config(config)
    print('')
    print(colored('Project configure saved!', 'cyan'))
    print('')
    print('To start the server:')
    print('')
    print(colored('    transfer --prediction-rest-api --project ' + project_name, 'green'))
    print('or')
    print(colored('    transfer --prediction-rest-api -p ' + project_name, 'green'))
1257266
def server_customizations():
    ''''''

    username = env.user
    env.user = 'root'

    # create user
    all_users = run('cut -d: -f1 /etc/passwd').split()
    if username not in all_users:

        host = env.host

        run(flo('adduser {username}'))

        # add user to the sudo group, cf. http://askubuntu.com/a/7484
        #run('sudo adduser {username} sudo'.format(**locals()))
        # http://jeromejaglale.com/doc/unix/ubuntu_sudo_without_password
        append('/etc/sudoers', flo('{username} ALL=(ALL) NOPASSWD: ALL'),
               use_sudo=True)

        # set up password-less login
        local(flo('ssh-copy-id -i ~/.ssh/id_rsa.pub  {username}@{host}'))

        env.user = username

        # Disable service apache2 httpd, cf. http://askubuntu.com/a/355102
        sudo('update-rc.d apache2 disable')
    else:
        print(magenta(flo(' nothing to do, user {username} already exists')))
        env.user = username
316260
def upload_settings():
    ""
    local_path = os.path.join(curdir, 'settings/{0}.py'.format(env.host))
    if os.path.exists(local_path):
        remote_path = os.path.join(env.path, 'varify/conf/local_settings.py')
        put(local_path, remote_path)
    elif not confirm(yellow('No local settings found for host "{0}". Continue anyway?'.format(env.host))):
        abort('No local settings found for host "{0}". Aborting.'.format(env.host))
939589
def put(
    state, host, local_filename, remote_filename,
    user=None, group=None, mode=None, add_deploy_dir=True,
):
    '''
    
    '''

    # Upload IO objects as-is
    if hasattr(local_filename, 'read'):
        local_file = local_filename

    # Assume string filename
    else:
        # Add deploy directory?
        if add_deploy_dir and state.deploy_dir:
            local_filename = path.join(state.deploy_dir, local_filename)

        local_file = local_filename

        if not path.isfile(local_file):
            raise IOError('No such file: {0}'.format(local_file))

    mode = ensure_mode_int(mode)
    remote_file = host.fact.file(remote_filename)

    # No remote file, always upload and user/group/mode if supplied
    if not remote_file:
        yield (local_file, remote_filename)

        if user or group:
            yield chown(remote_filename, user, group)

        if mode:
            yield chmod(remote_filename, mode)

    # File exists, check sum and check user/group/mode if supplied
    else:
        local_sum = get_file_sha1(local_filename)
        remote_sum = host.fact.sha1_file(remote_filename)

        # Check sha1sum, upload if needed
        if local_sum != remote_sum:
            yield (local_file, remote_filename)

            if user or group:
                yield chown(remote_filename, user, group)

            if mode:
                yield chmod(remote_filename, mode)

        else:
            # Check mode
            if mode and remote_file['mode'] != mode:
                yield chmod(remote_filename, mode)

            # Check user/group
            if (
                (user and remote_file['user'] != user)
                or (group and remote_file['group'] != group)
            ):
                yield chown(remote_filename, user, group)
1341383
def server(port):
    """"""
    args = ['python', 'manage.py', 'runserver']
    if port:
        args.append(port)
    run.main(args)
606691
@Override
    public Server chooseServer(Object key) {
        Server server = super.chooseServer(key);
        if (server == null) {
            return null;
        }
        server.setPort(port);

        return server;
    }
205343
public function setupCommand() {
		$serverPublicKeyString = Files::getFileContents('resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoServer.pub', FILE_TEXT);
		if ($serverPublicKeyString === FALSE) {
			$this->outputLine('Could not open resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoServer.pub, exiting.');
			$this->quit(1);
		}

		$serverPublicKeyFingerprint = $this->rsaWalletService->registerPublicKeyFromString($serverPublicKeyString);
		$this->outputLine('Registered sso demo server public key');

		$clientPrivateKeyString = Files::getFileContents('resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoClient.key', FILE_TEXT);
		if ($clientPrivateKeyString === FALSE) {
			$this->outputLine('Could not open resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoClient.key, exiting.');
			$this->quit(2);
		}

		$clientPublicKeyFingerprint = $this->rsaWalletService->registerKeyPairFromPrivateKeyString($clientPrivateKeyString);
		$this->outputLine('Registered demo client key pair');

		$globalSettings = $this->yamlSource->load(FLOW_PATH_CONFIGURATION . '/Settings');
		$globalSettings['Flowpack']['SingleSignOn']['Client']['client']['publicKeyFingerprint'] = $clientPublicKeyFingerprint;
		$globalSettings['Flowpack']['SingleSignOn']['Client']['server']['DemoServer']['publicKeyFingerprint'] = $serverPublicKeyFingerprint;
		$this->yamlSource->save(FLOW_PATH_CONFIGURATION . '/Settings', $globalSettings);
		$this->outputLine('Updated settings');
	}
999555
function(virtualIps) {

        if (!virtualIps) {
            return;
        }

        var self = this;

        self.virtualIps = [];

        _.each(virtualIps, function(virtualIp) {
            self.virtualIps.push(new rackspace.VirtualIp(virtualIp));
        });
    }
290082
private static void registerServer(Server server, Database db) {

        if (!serverMap.containsKey(server)) {
            serverMap.put(server, new HashSet());
        }

        HashSet databases = (HashSet) serverMap.get(server);

        databases.add(db);
    }
678482
def set_server(self, pos, key, value):
        """"""
        self._ports_list[pos][key] = value