Skip to content

Instantly share code, notes, and snippets.

View daluu's full-sized avatar

David Luu daluu

View GitHub Profile
View AppiumWokaround.java
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;
@blotus
blotus / log4j_exploitation_attempts_crowdsec.md
Last active September 12, 2023 09:02
IPs exploiting the log4j2 CVE-2021-44228 detected by the crowdsec community
View log4j_exploitation_attempts_crowdsec.md

This list is no longer updated, thus the information is no longer reliable.

You can see the latest version (from october 2022) here

@hosuaby
hosuaby / cypress-partial.js
Created December 3, 2021 20:14
Primitive load-balancer to run Cypress specs in parallel on CI without recording
View cypress-partial.js
/**
* Primitive load-balancer to split Cypress specs across multiple runners. This script assumes that
* all your specs are in the folder '<project root>/cypress/integration'. It uses the number of
* tests per spec file as sole criteria to split specs between runners.
*
* This script accepts two arguments: the total number of runners and the index (starting from 0) of
* the current runner. Example:
* $ node cypress-partial.js 5 2
* This command asks for specs to give to the third runner of five runners.
* The output of the script is a coma-separated list of specs that can be given to Cypress. Example:
View gesture3.java
Map<String, Object> args = new HashMap<>();
args.put("direction", "up");
driver.executeScript("mobile: swipe", args);
View gestures2.java
MobileElement source = (MobileElement) new WebDriverWait(driver, 30)
.until(elementToBeClickable(MobileBy.AccessibilityId("slider")));
driver.addCommand(HttpMethod.POST, String.format("/session/%s/plugin/actions/swipe", driver.getSessionId()), "swipe");
driver.execute("swipe", ImmutableMap.of("elementId", source.getId(), "percentage", 50));
View gestures1.java
MobileElement slider = driver.findElementByAccessibilityId("slider");
Point source = slider.getLocation();
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
Sequence sequence = new Sequence(finger, 1);
sequence.addAction(finger.createPointerMove(ofMillis(0),
PointerInput.Origin.viewport(), source.x, source.y));
sequence.addAction(finger.createPointerDown(PointerInput.MouseButton.MIDDLE.asArg()));
sequence.addAction(new Pause(finger, ofMillis(600)));
sequence.addAction(finger.createPointerMove(ofMillis(600),
@xgqfrms
xgqfrms / apple m1 navigator.userAgent.md
Last active February 21, 2023 19:44
apple m1 navigator.userAgent
View apple m1 navigator.userAgent.md

apple m1 navigator.userAgent

navigator.userAgent;

// Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36

The User-Agent string for Big Sur's Safari running on Apple Silicon (ARM) still says "Mac OS X 10_16" and, curiously, claims to be "Intel":

View apple80211
iPhoneX-test:/usr/local/bin root# apple80211
apple80211 interface_name [-qvh] -cmd[=new_val]
-q: Quiet mode. Produce script-friendly output.
-h: Verbose help.
-v: Verbose output.
-40int=[true/false] Get/Set 40 MHz intolerance.
-2g_chain_disable=[0/1,0/1] Get/Set 2Ghz shared chain disable and reassoc. [disabled,reassoc]
-acl_add=[mac addr,] Comma separated list of mac addresses to add to ACL list for the interface
-acl_flush Remove all entries from the ACL list for the interface
-acl_list List entries in the ACL list for the interface
@citruz
citruz / QEMU_ON_M1.md
Last active October 22, 2023 13:23
Create Ubuntu and Windows VMs with QEMU on Apple Silicon
View QEMU_ON_M1.md

Running Linux and Windows on M1 with QEMU

30.11.2020: Updated with the new patchseries and instructions for Windows

02.12.2020: Added tweaks

08.12.2020: Updated with patchseries v4

31.01.2020: Updated with patchseries v6

View Vue-Workshop.md