Skip to content

Instantly share code, notes, and snippets.

@willycedric
willycedric / webdriverio.appium.native.swipe.js
Created February 15, 2023 12:00 — forked from wswebcreation/webdriverio.appium.native.swipe.js
This gist holds some methods I use to do swiping on iOS and Android
/**
* Here you'll find some swipe methods for a native iOS or Android app
* which can be used when you are using webdriver.io
*
* I work a lot based on percentages, so it is working on all screens and all devices
* and I hope you understand how to use it based on the docs.
*
* Feel free to use it for all kinds of purposes, a star is much appreciated ;-)
*
* Grtz,
@willycedric
willycedric / playbook_centos_install_docker.yaml
Created January 12, 2023 16:06 — forked from yonglai/playbook_centos_install_docker.yaml
An Ansible playbook to install docker-ce on Centos
---
- name: Install docker
gather_facts: No
hosts: default
tasks:
- name: Install yum utils
yum:
name: yum-utils
state: latest
#!/bin/bash
###
# Requires Null Keyboard https://play.google.com/store/apps/details?id=com.wparam.nullkeyboard
# Author: Volodymyr Shymanskyy
###
brightness=$(adb shell settings get system screen_brightness)
ime=$(adb shell settings get secure default_input_method)
@willycedric
willycedric / Disable_ipv6_ubuntu
Created February 8, 2022 14:48
Why apt-get update fail to connecting to dl.google.com?
When I have this problem, I disable IPv6 in Ubuntu and that fix the problem, in order to do that, please follow these steps:
To disable IPv6, you have to open /etc/sysctl.conf using any text editor and add the following lines at the end:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
If IPv6 is still enabled, then the problem is that sysctl.conf is still not activated.
In that case, open a terminal(Ctrl+Alt+T) and type the command:
@willycedric
willycedric / birthday_problem.py
Created January 26, 2022 15:44
birthday_problem.py
import random
num_people_in_room = 20 #Change This Number
#Simulate a room with a certain number of people
def simulate(num_people):
birthdays = []
print("Here's what our room looks like:\n")
months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
@willycedric
willycedric / Repeat.java
Created November 4, 2021 20:57 — forked from fappel/Repeat.java
JUnit 4 TestRule to run a test repeatedly for a specified amount of repititions
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention( RetentionPolicy.RUNTIME )
@Target( {
java.lang.annotation.ElementType.METHOD
} )
public @interface Repeat {
public abstract int times();
@willycedric
willycedric / gist:44980bca9b24d6b41768a9069cfe17a5
Created July 21, 2021 09:04
How to allow css and javascript in jenkins report
Windows Jenkins server
A permanent fix is to change a line in [Jenkins directory]\jenkins.xml (for me it's at C:\Jenkins\jenkins.xml)
<executable>java.exe</executable>
<arguments>[arguments are here]</arguments>
Add the following argument to the whitespace-separated list of arguments:
-Dhudson.model.DirectoryBrowserSupport.CSP=
-Dfile.encoding=UTF-8
@willycedric
willycedric / xvfb.service
Created November 18, 2020 16:23 — forked from mylk/xvfb.service
Xvfb systemd script
# /etc/systemd/system/xvfb.service
[Unit]
Description=X virtual framebuffer
[Service]
Type=simple
User=root
ExecStart=/usr/bin/Xvfb :99 -ac
@willycedric
willycedric / selenium.service
Created November 18, 2020 16:21 — forked from mylk/selenium.service
Selenium standalone server systemd script
# /etc/systemd/system/selenium.service
# assumes selenium server and chromedriver exist in the following paths:
# /var/selenium/selenium-server-standalone-2.45.0.jar
# /var/selenium/chromedriver
[Unit]
Description=Selenium Standalone Server
Requires=xvfb.service
After=xvfb.service
@willycedric
willycedric / grid_status
Created November 13, 2020 17:02
Selenium grid status (prior to v4)
#!/usr/bin/env bash
# check-grid.sh
set -e
HOST="localhost"
PORT="4444"
echoerr() { echo "$@" 1>&2; }