Send Wake ok Lan packet to an host
@param models\LAN\LanInterface $lanInterface
@param models\LAN\LanHost $lanHost
@param string $password
@return bool
198509
public function wakeOnLan( models\LAN\LanInterface $lanInterface, models\LAN\LanHost $lanHost, $password = ''){
        $service = sprintf( self::API_WAKE_ON_LAN, $lanInterface->getName());
        $rest = $this->getService( $service);
        $rest->PUT([
            'mac'       => $lanHost->getId(),
            'password'  => $password,
        ]);

        return $rest->getSuccess();
    }
596100
private function executeSend(InputInterface $input, OutputInterface $output)
    {
        $message = $input->getOption(self::OPTION_SEND);
        $output->writeln(sprintf(self::WELCOME_SEND, $message, $this->getName()));

        $port = file_get_contents($this->getFilePath());

        $pingSock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
        socket_sendto($pingSock, $message . PHP_EOL, strlen($message), 0, '127.0.0.1', $port);
    }
1074326
public function send(RequestInterface $request, MessageInterface $response)
    {
        $cacheKey = $this->generateCacheKeyForRequest($request);

        if ($this->cache->contains($cacheKey)) {
            $this->hits++;

            $cachedResponse = unserialize($this->cache->fetch($cacheKey));
            /* @var $cachedResponse \Buzz\Message\Response */

            $response->setContent($cachedResponse->getContent());
            $response->setHeaders($cachedResponse->getHeaders());

            return;
        }

        $this->misses++;

        $this->client->send($request, $response);

        $this->cache->save($cacheKey, serialize($response), $this->lifetime);
    }
1071451
def sendport(host, port) # :nodoc:
      af = (@sock.peeraddr)[0]
      if af == "AF_INET"
        cmd = "PORT " + (host.split(".") + port.divmod(256)).join(",")
      elsif af == "AF_INET6"
        cmd = sprintf("EPRT |2|%s|%d|", host, port)
      else
        raise FTPProtoError, host
      end
      voidcmd(cmd)
    end
1355447
public static function encryptWithPassword(
        string $plaintext,
        string $password,
        string $ad = '',
        string $format = null
    ): string {
        return self::encrypt($plaintext, $password, $ad, $format, true);
    }
1346888
final public static function setSMTP (string $host, string $username, string $password, string $SMTPSecure, int $port) : \stdClass
	{
		return (object) $SMTPConfig = [
			'host' 			=> $host,
			'username' 		=> $username,
			'password' 		=> $password,
			'SMTPSecure' 	=> $SMTPSecure,
			'port' 			=> $port
		];
	}
1033192
public function login($username = '', $password = '')
    {
        if (!$this->connected) {
            $this->setError('Not connected to POP3 server');
        }
        if (empty($username)) {
            $username = $this->username;
        }
        if (empty($password)) {
            $password = $this->password;
        }

        // Send the Username
        $this->sendString("USER $username" . static::LE);
        $pop3_response = $this->getResponse();
        if ($this->checkResponse($pop3_response)) {
            // Send the Password
            $this->sendString("PASS $password" . static::LE);
            $pop3_response = $this->getResponse();
            if ($this->checkResponse($pop3_response)) {
                return true;
            }
        }

        return false;
    }
1225317
public function send(\Psr\Http\Message\ResponseInterface $response) :bool
    {
        $http_line = sprintf(
            'HTTP/%s %s %s',
            $response->getProtocolVersion(),
            $response->getStatusCode(),
            $response->getReasonPhrase()
        );

        header($http_line, true, $response->getStatusCode());

        foreach ($response->getHeaders() as $name => $values) {
            foreach ($values as $value) {
                header("$name: $value", false);
            }
        }

        $stream = $response->getBody();

        if ($stream->isSeekable()) {
            $stream->rewind();
        }

        while (!$stream->eof()) {
            echo $stream->read(1024 * 8);
        }
        return true;
    }
750857
def a_send_password(password, ctx):
    
    if password:
        ctx.ctrl.send_command(password, password=True)
        return True
    else:
        ctx.ctrl.disconnect()
        raise ConnectionAuthenticationError("Password not provided", ctx.ctrl.hostname)
640182
public static function create($host, $port, $password)
    {
        $connection = ConnectionFactory::create($host, $port, $password);

        return new Messenger($connection);
    }
615157
public function connect($host, $port, Connection $connection, $timeout = 5)
    {
        $deferred = new Deferred();
        $this->disconnect()
            ->then(function () use ($deferred, $host, $port, $connection, $timeout) {
                $this->establishConnection($host, $port, $connection, $timeout)
                    ->then(function () use ($deferred) {
                        $deferred->resolve($this);
                    })
                    ->otherwise(function (\Exception $error) use ($deferred) {
                        $deferred->reject($error);
                    });
            })
            ->otherwise(function () use ($deferred) {
                $deferred->reject($this);
            });

        return $deferred->promise();
    }
256201
public function setNewPassword(string $newPassword, string $timezone): bool {
		
		$this->pwReset = NULL;
		$this->hash = static::getHashedPasswordWithSalt($newPassword);
		
		if (!$this->store()) {
			return FALSE;
		}
		
		// creates session for this user
		$this->createSession($timezone);
		$this->resetFaults();
		
		return TRUE;
		
	}
464440
public function connect($host, $ssl = false, $port = 21, $timeout = 90)
    {
        if ($ssl) {
            $this->connection = @ftp_ssl_connect($host, $port, $timeout);
        } else {
            $this->connection = @ftp_connect($host, $port, $timeout);
        }

        if ($this->connection == null) {
            throw new Exception('Unable to connect');            
        } else {
            return $this;
        }
    }
1103669
protected function sendData($host, $port, $message)
    {
        $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);

        return socket_sendto($socket, $message, strlen($message), 0, $host, $port);
    }
1353473
public function connect($host, $ssl = false, $port = 21, $timeout = 90)
    {
        if ($ssl) {
            $this->conn = @$this->ftp->ssl_connect($host, $port, $timeout);
        } else {
            $this->conn = @$this->ftp->connect($host, $port, $timeout);
        }
        if (!$this->conn) {
            throw new FtpException('Unable to connect');
        }

        return $this;
    }
880921
public static function isPortOpen($host, $port, $protocol)
    {
        $protocol = strtolower($protocol);
        
        if ($protocol != 'tcp' && $protocol != 'udp')
        {
            $errMsg = 'Unrecognized protocol [' . $protocol . '] ' . 
                      'please specify [tcp] or [udp]';
            throw new \Exception($errMsg);
        }
        
        if (empty($host))
        {
            $host = self::getPublicIp();
        }

        foreach ($ports as $port)
        {
            $connection = @fsockopen($host, $port);

            if (is_resource($connection))
            {
                $isOpen = true;
                fclose($connection);
            }

            else
            {
                $isOpen = false;
            }
        }
        
        return $isOpen;
    }
1008244
public function setPassword($password)
        {
            if ($this->validatePassword($password) === false) {
                throw new Exception("Password \"$password\" is not a valid HTTP password.");
            }

            $oldPassword     = $this->_password;
            $this->_password = $password;

            return $oldPassword;
        }