$ sudo sed -e 's|http://archive.ubuntu.com|https://mirrors.ustc.edu.cn|g' \
-e 's|http://security.ubuntu.com|https://mirrors.ustc.edu.cn|g' \
-i.bak /etc/apt/sources.list
This file contains hidden or 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
docker run -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock -v jenkins-data:/var/jenkins_home jenkinsci/blueocean |
This file contains hidden or 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 com.sahajamit.selenium.ws; | |
import org.json.JSONObject; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.logging.LogEntries; | |
import org.openqa.selenium.logging.LogType; | |
import org.openqa.selenium.logging.LoggingPreferences; | |
import org.openqa.selenium.remote.CapabilityType; | |
import org.openqa.selenium.remote.DesiredCapabilities; |
This file contains hidden or 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
ChromeOptions options = new ChromeOptions(); | |
options.setExperimentalOption("useAutomationExtension", false); | |
options.addArguments(Arrays.asList("--start-maximized")); | |
options.setBinary("<chromebinary path>"); | |
DesiredCapabilities crcapabilities = DesiredCapabilities.chrome(); | |
crcapabilities.setCapability(ChromeOptions.CAPABILITY, options); | |
crcapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); | |
System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, System.getProperty("user.dir") + "/target/chromedriver.log"); |
This file contains hidden or 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.sendWSMessage(wsURL,this.buildGeoLocationMessage("27.1752868","78.040009")); | |
private void sendWSMessage(String url,String message) throws IOException, WebSocketException, InterruptedException { | |
JSONObject jsonObject = new JSONObject(message); | |
final int messageId = jsonObject.getInt("id"); | |
if(ws==null){ | |
ws = new WebSocketFactory() | |
.createSocket(url) | |
.addListener(new WebSocketAdapter() { | |
@Override | |
public void onTextMessage(WebSocket ws, String message) { |
This file contains hidden or 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
String wsURL = this.getWebSocketDebuggerUrl(); | |
private String getWebSocketDebuggerUrl() throws IOException { | |
String webSocketDebuggerUrl = ""; | |
File file = new File(System.getProperty("user.dir") + "/target/chromedriver.log"); | |
try { | |
Scanner sc = new Scanner(file); | |
String urlString = ""; | |
while (sc.hasNextLine()) { | |
String line = sc.nextLine(); |
This file contains hidden or 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
https://github.com/aerokube/selenoid/releases/tag/1.7.1 | |
https://aerokube.com/selenoid/latest/#_using_selenoid_without_docker | |
https://aerokube.com/cm/latest/ | |
https://aerokube.com/selenoid-ui/latest/ | |
./selenoid_darwin_amd64 -conf ./browsers.json -disable-docker -capture-driver-logs | |
./selenoid-ui_darwin_amd64 --period 5s |
This file contains hidden or 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
# Show a current active git branch in the shell prompt | |
export PS1='\t \[\033[01;32m\]\u\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] ' | |
# Shortcat for the pretty git log. Can be extended with the commit count parameter (last -10, last -35) | |
alias last='git log --graph --all --oneline --decorate ' |
This file contains hidden or 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
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
This file contains hidden or 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 example; | |
import org.openqa.selenium.JavascriptExecutor; | |
import org.openqa.selenium.support.events.EventFiringWebDriver; | |
public class WaitUtil { | |
public static void checkPendingRequests(final String context, final EventFiringWebDriver driver) { | |
final int timeoutInNumberOfTries = 50; | |
try { |