Skip to content

Instantly share code, notes, and snippets.

@n5i
n5i / gist:d6ac82c85b53291cfce77c186a871d60
Created February 10, 2017 00:13
Run headless selenium in background
nohup xvfb-run --server-args="-screen 0, 1280x1024x8" java -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 > /dev/null 2>&1 &
@n5i
n5i / gist:e811900eceb56cf991150e2e1385bbb1
Created February 9, 2017 14:16
Create firefox profile for selenium
cd /your/profile
zip -r profile *
base64 profile.zip > profile.zip.b64
@n5i
n5i / gist:596f33d7cf5d3e9571137e0c3eee0cd5
Created February 9, 2017 01:30
Run selenium standalone with firefox profile
java -Dwebdriver.firefox.profile=selenium -jar lenium-server-standalone-3.0.1.jarport 4444
@n5i
n5i / gist:e1df1ca5b928dd98ffda6f0dd6f3585c
Created January 31, 2017 02:20
jasmine protractor logger
var log4js = require('log4js');
var logger = log4js.getLogger();
logger.debug(msg);
@n5i
n5i / test.java
Created October 22, 2016 14:31
Delay with Neo4j plugin
@Procedure("test.slowQuery")
public void slowQuery(@Name("delay") Number Delay ) throws InterruptedException
{
long started = System.currentTimeMillis();
while (System.currentTimeMillis() - started < Delay.intValue()) {
Thread.sleep(5);
if( transaction.getReasonIfTerminated() != null ){
return;
}
}
@n5i
n5i / gist:fd61cb493d27027e0d572c12f1242b0e
Created October 9, 2016 13:47
JMeter + websokets on ubuntu
1. Donload JMeter.
2. Download the latest versions of libs from here:
http://mvnrepository.com/artifact/org.eclipse.jetty.websocket/websocket-server/9.1.1.v20140108
http://mvnrepository.com/artifact/org.eclipse.jetty/jetty-io/9.1.1.v20140108
http://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util/9.1.1.v20140108
http://mvnrepository.com/artifact/org.eclipse.jetty.websocket/websocket-api/9.1.1.v20140108
http://mvnrepository.com/artifact/org.eclipse.jetty.websocket/websocket-client/9.1.1.v20140108
http://mvnrepository.com/artifact/org.eclipse.jetty.websocket/websocket-common/9.1.1.v20140108
@n5i
n5i / gist:9898d6035c2839938a6afa21d8e47675
Last active July 8, 2016 14:48
Install golang 1.6 at CentOS 7
# Install golang 1.4 from epel repo which is used for installing golang 1.6 (sudo)
yum install golang
# Set up paths
sudo ln -s /usr/lib/golang/bin/linux_amd64/go /usr/lib/golang/bin
export GOROOT_BOOTSTRAP=/usr/lib/golang
# Download the golang sources
# In the current example the sorces are downloaded to the root folder of a user with the name "go"
git clone https://go.googlesource.com/go
@n5i
n5i / gist:826f7b7e1249e253df71
Created February 11, 2016 15:12
Install golang 1.5.3 at CentOS 7
// https://golang.org/doc/install/source
// == Preparation ==
// Golang should be installed. Epel repo might be necessary
yum install golang
// Create a link to golang. Without it installer fails. Sudo might be required
ln -s /usr/lib/golang/bin/linux_amd64/go /usr/lib/golang/bin/go
@n5i
n5i / gist:a21c47b370ddbbad38a8
Created November 6, 2015 15:28
Start headless selenium without logs
nohup xvfb-run java -jar selenium-server-standalone-2.48.2.jar >/dev/null 2>&1
@n5i
n5i / gist:e45392901c2d7d5bba15
Created November 6, 2015 06:49
Update author of the last commit
git commit --amend --author "New Author Name <[email protected]>"
// OR
git -c user.name="New Author Name" -c [email protected] commit --amend --reset-author