Skip to content

Instantly share code, notes, and snippets.

@picosaur
picosaur / SDL Audio.cpp
Created November 25, 2024 23:32 — forked from cpicanco/SDL Audio.cpp
SDL simple record and playback
#include <SDL.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <ctime>
const int MAX_RECORDING_DEVICES = 10;
@picosaur
picosaur / SDL Audio.cpp
Created November 25, 2024 23:32 — forked from andraantariksa/SDL Audio.cpp
SDL simple record and playback
#include <SDL.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <ctime>
const int MAX_RECORDING_DEVICES = 10;
@picosaur
picosaur / adb_check.sh
Created November 20, 2024 13:16
check android emulator is ready
#!/usr/bin/env bash
# Kill emulator
adb -s emulator-5554 emu kill
# Start the emulator
emulator -avd NexusOne -gpu on -qemu -enable-kvm &
# Don't exit until emulator is loaded
output=''
@picosaur
picosaur / AdbCommands
Created November 18, 2024 14:20 — forked from Pulimet/AdbCommands
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@picosaur
picosaur / keyevents.json
Created November 15, 2024 20:22 — forked from arjunv/keyevents.json
All Android Key Events for usage with adb shell
{
"key_events": {
"key_unknown": "adb shell input keyevent 0",
"key_soft_left": "adb shell input keyevent 1",
"key_soft_right": "adb shell input keyevent 2",
"key_home": "adb shell input keyevent 3",
"key_back": "adb shell input keyevent 4",
"key_call": "adb shell input keyevent 5",
"key_endcall": "adb shell input keyevent 6",
"key_0": "adb shell input keyevent 7",
@picosaur
picosaur / tproxy.sh
Created October 29, 2024 21:58
Transparent proxy with shadowsocks-libev
#!/bin/bash
start_ssredir() {
# please modify MyIP, MyPort, etc.
(ss-redir -s MyIP -p MyPort -m MyMethod -k MyPasswd -b 127.0.0.1 -l 60080 --no-delay -u -T -v </dev/null &>>/var/log/ss-redir.log &)
}
stop_ssredir() {
kill -9 $(pidof ss-redir) &>/dev/null
}
@picosaur
picosaur / 00.install-android-sdk.sh
Created October 22, 2024 09:47 — forked from nhtua/00.install-android-sdk.sh
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@picosaur
picosaur / OVERVIEW.TXT
Created October 19, 2024 20:42 — forked from hfutxqd/OVERVIEW.TXT
adb protocol
Implementation notes regarding ADB.
I. General Overview:
The Android Debug Bridge (ADB) is used to:
- keep track of all Android devices and emulators instances
connected to or running on a given host developer machine
- implement various control commands (e.g. "adb shell", "adb pull", etc.)
@picosaur
picosaur / adb_rotation.sh
Created October 15, 2024 22:09 — forked from whunter/adb_rotation.sh
android device display rotation via adb
# disable auto rotation
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
# force landscape
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
# back to portrait
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
# upside down
@picosaur
picosaur / mount_qcow2.md
Created October 14, 2024 05:37 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8