This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package appiumworkaround; | |
import io.appium.java_client.windows.WindowsDriver; | |
import java.io.IOException; | |
import java.net.URI; | |
import java.net.http.HttpClient; | |
import java.net.http.HttpRequest; | |
import java.net.http.HttpResponse; | |
import lombok.AccessLevel; | |
import lombok.NoArgsConstructor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started by user admin | |
Building in workspace /var/jenkins_home/workspace/Blog_sample/Mirror_git | |
[WS-CLEANUP] Deleting project workspace... | |
[WS-CLEANUP] Done | |
Cloning the remote Git repository | |
Cloning repository https://github.com/adelarcubs/repo_base | |
> git init /var/jenkins_home/workspace/Blog_sample/Mirror_git # timeout=10 | |
Fetching upstream changes from https://github.com/adelarcubs/repo_base | |
> git --version # timeout=10 | |
using GIT_ASKPASS to set credentials adelarcubs github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Forma de resolver o ssh-agent no docker | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
#Git no jenkins deixa sem branch | |
git checkout master | |
#Verifica quais branchs estão criadas no repositório e depois baixa elas localmente | |
git branch -r | grep -v '\->' | grep -v 'master' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
#Adiciona o repositório clone | |
git remote add origin-mirror [email protected]:adelarcubs/repo_base_copy.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userEmail = '[email protected]'; | |
$userPassword = '123456'; | |
// Using Doctrine for example | |
$user = $repository->findByEmail($userEmail); | |
if(!$user) { | |
// User not found | |
// LOGIN ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userEmail = '[email protected]'; | |
$userPassword = '123456'; | |
// Using Doctrine for example | |
$user = $repository->findByEmail($userEmail); | |
if(!$user) { | |
// User not found | |
// LOGIN ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
for($cost = 4; $cost <= 18; $cost++){ | |
$start = microtime(true); | |
password_hash("test", PASSWORD_DEFAULT, ['cost' => $cost]); | |
$end = microtime(true); | |
echo 'Cost: ' . $cost . ' Time cost: ' . ($end - $start) . "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userEmail = '[email protected]'; | |
$userPassword = '123456'; | |
// Using Doctrine for example | |
$user = $repository->findByEmail($userEmail); | |
if(password_verify($userPassword, $user->getPassword())){ | |
$options = ['cost' => 10]; | |
if(password_needs_rehash($user->getPassword(), PASSWORD_DEFAULT, $options)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userEmail = '[email protected]'; | |
$userPassword = '123456'; | |
// Using Doctrine for example | |
$user = $repository->findByEmail($userEmail); | |
if(password_verify($userPassword, $user->getPassword())){ | |
// DO LOGIN | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userPassword = '123456'; | |
$options = ['cost' => 10]; | |
$hash = password_hash($userPassword, PASSWORD_DEFAULT, $options); | |
// save $hash as password on database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a sample build configuration for PHP. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Dockerhub as your build environment. | |
image: phpunit/phpunit:5.0.3 | |
pipelines: | |
default: | |
- step: | |
script: # Modify the commands below to build your repository. |
NewerOlder