Skip to content

Instantly share code, notes, and snippets.

to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@ugreek85
ugreek85 / worker_global_scope.cc
Created August 16, 2024 16:09
Run js code inside any type of worker for chromium
//void WorkerGlobalScope::RunWorkerScript() {
// ...
//if (ScriptState* script_state = ScriptController()->GetScriptState()) {
// v8::HandleScope handle_scope(script_state->GetIsolate());
String source_code(
"console.log('Custom JS code executed in WorkerGlobalScope'); "
"console.log('worker.userAgent', navigator.userAgent);");
Script* injected_script =
@ugreek85
ugreek85 / service.md
Created November 17, 2023 13:50 — forked from tniessen/service.md
Using the "service" tool with ADB and why to avoid it

As it turns out, it is not trivial to control the audio volume of an Android device using ADB. At the time of writing, the only way appears to be using the service tool. Actually, the service command allows to "connect" to a number of services (104 on Android 6.0.1) and invoke functions. Not knowing much about this tool, I managed to completely mute all sounds and speakers of my Nexus 5, and I was stuck without any sound for quite some time. I did not find a way to unmute the sound from within the system UI, so I got to dive a little deeper into this.

If you know which service you want to use, you then need to find its interface declaration. The command

service list

gives you a list of all services with the associated interfaces, if applicable:

...

26 backup: [android.app.backup.IBackupManager]

@ugreek85
ugreek85 / webgl-detect-gpu.js
Created November 14, 2023 09:02 — forked from cvan/webgl-detect-gpu.js
use JavaScript to detect GPU used from within your browser
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}
@ugreek85
ugreek85 / UsbCecConnection.java
Created September 1, 2023 12:17 — forked from sdabet/UsbCecConnection.java
Send simple HDMI-CEC commands from an Android app via Pulse-Eight's USB-CEC adapter
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.util.Log;
import com.felhr.usbserial.UsbSerialDevice;
import com.felhr.usbserial.UsbSerialInterface;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ugreek85
ugreek85 / Android_Emulator_AWS_EC2_ARM64_2022.txt
Created January 12, 2023 15:19 — forked from atyachin/Android_Emulator_AWS_EC2_ARM64_2022.txt
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)