April 6, 2017

February 18, 2017

[SOLVED]Error response status: 6 Selenium error: no such session (Chrome selenium tests on gitlab runner)

Selenium tests with chrome on gitlab gave me this error "Error response status: 6 Selenium error: no such session". I order to fix it

Install virtual display
apt-get install -qq -y xvfb

#try to fool google-chrome to run without sandbox
mv /usr/bin/google-chrome /usr/bin/google-chrome-orig \
    && echo '#!/bin/bash' > /usr/bin/google-chrome \
    && echo '/usr/bin/google-chrome-orig --no-sandbox --disable-setuid-sandbox --allow-sandbox-debugging "$@"' >> /usr/bin/google-chrome  \
    && chmod +x /usr/bin/google-chrome

Before starting your test start virtual display
Xvfb :0 -ac +extension RANDR -screen 0 1366x768x24 &

than run your test in
xvfb-run polymer test -l chrome

Make your own or use my docker image
https://hub.docker.com/r/printminion/polymer-tester/

Example dockerfile: https://github.com/printminion/polymer-tester/blob/master/Dockerfile


Error:
(node:4444) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Installing and starting Selenium server for local browsers
Selenium server running on port 38917
Web server running on port 2000 and serving from /builds/printminion-group/canvas-editor-base
chrome 56                Tests failed: {"message":"[get(\"http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0\")] Error response status: 6 Selenium error: no such session\n  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 38 milliseconds\nBuild info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'\nSystem i...
Test run ended in failure: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c

chrome 56 (error)                    

Error: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c

error:   cli runtime exception: Error: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c
error:   Error: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c
    at /usr/local/lib/node_modules/polymer-cli/node_modules/web-component-tester/runner/steps.js:151:27
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/polymer-cli/node_modules/web-component-tester/runner/steps.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:103:7)
ERROR: Build failed: exit code 1

January 10, 2017

[SOLVED]Docker API connection refused 127.0.0.1:2376

Create a file called /etc/systemd/system/docker-tcp.socket to make Docker available on a TCP socket on port 2375.

[Unit]
Description=Docker Socket for the API

[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service

[Install]
WantedBy=sockets.target


Then enable this new socket:

systemctl enable docker-tcp.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker
Test that it's working:

docker -H tcp://127.0.0.1:2375 ps


Source: https://coreos.com/os/docs/latest/customizing-docker.html

August 1, 2016

[SOLVED] Create copy of Raspberry PI SD-Card


sudo fdisk -l

Take note of how the SD card is identified.
In my case it is /dev/sdb1.
Then:
sudo dd bs=4M if=/dev/sdb | gzip > /home/your_username/image`date +%d%m%y`.gz

This will compress the image using gzip.
To restore the backup on SD card:
sudo gzip -dc /home/your_username/image.gz | sudo dd bs=4M of=/dev/sdb

June 3, 2016

[SOLVED]Renew ssl letsencrypt certificate on bitnami server

#!/bin/bash
#renew ssl letsencrypt certificate on bitnami server
#https://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802/edit

sudo /opt/bitnami/ctlscript.sh stop apache
cd /home/user/certbot
#./certbot-auto certonly --standalone -w /opt/bitnami/apache2/conf/ -d example
.com -d www.example.com
./certbot-auto renew
sudo cp /etc/letsencrypt/live/example.com/fullchain.pem /opt/bitnami/apache2/conf/server.crt
sudo cp /etc/letsencrypt/live/example.com/privkey.pem /opt/bitnami/apache2/conf/server.key
sudo /opt/bitnami/ctlscript.sh start apache


Gisthttps://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802

June 2, 2016

[SOLVED] Set hostname to to terminal window




Add this to your .bashrc file:

show only hostname

PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME}\007"'

show user@hostname and path

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

Source: http://tldp.org/HOWTO/Xterm-Title-4.html

February 13, 2016

[SOLVED]Create CRC list of files in directory recursively on Busybox (Synology)

Create CRC list of files in directory recursively on Busybox (Synology)

  find -type f -print0 | xargs -0 cksum > checklist.chk

 exclude Synology's @eaDir-Dirs
  find -type f ! -path "*/@eaDir/*" -print0 | xargs -0 cksum > checklist.chk

 You can also try to install md5sum via ipkg