Skip to content

Instantly share code, notes, and snippets.

View daluu's full-sized avatar

David Luu daluu

View GitHub Profile
package appiumworkaround;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
blotus /
Last active September 12, 2023 09:02
IPs exploiting the log4j2 CVE-2021-44228 detected by the crowdsec community

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

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

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:
Map<String, Object> args = new HashMap<>();
args.put("direction", "up");
driver.executeScript("mobile: swipe", args);
MobileElement source = (MobileElement) new WebDriverWait(driver, 30)
driver.addCommand(HttpMethod.POST, String.format("/session/%s/plugin/actions/swipe", driver.getSessionId()), "swipe");
driver.execute("swipe", ImmutableMap.of("elementId", source.getId(), "percentage", 50));
MobileElement slider = driver.findElementByAccessibilityId("slider");
Point source = slider.getLocation();
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
Sequence sequence = new Sequence(finger, 1);
PointerInput.Origin.viewport(), source.x, source.y));
sequence.addAction(new Pause(finger, ofMillis(600)));
xgqfrms / apple m1
Last active February 21, 2023 19:44
apple m1 navigator.userAgent
View apple m1

apple m1 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 /
Last active October 22, 2023 13:23
Create Ubuntu and Windows VMs with QEMU on Apple Silicon

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