Skip to content

Instantly share code, notes, and snippets.

View robot9706's full-sized avatar
🐢

Bence robot9706

🐢
  • Hungary
View GitHub Profile
@robot9706
robot9706 / Endpoints.txt
Created August 24, 2020 19:55
Video Grabber
Interfaces: x14
IF #0, ep: x2
EP 0.0, TYPE: IRQ, DIR: IN
EP 0.1, TYPE: IRQ, DIR: OUT
IF #1, ep: x1
EP 1.0, TYPE: IRQ, DIR: IN
IF #2, ep: x1
EP 2.0, TYPE: BULK, DIR: IN
IF #3, ep: x1
EP 3.0, TYPE: ISOC!, DIR: IN
@robot9706
robot9706 / driver.txt
Created March 24, 2020 12:11
Custom driver installation
bcdedit.exe /set loadoptions DISABLE_INTEGRITY_CHECKS (?)
bcdedit.exe -set TESTSIGNING ON
(PROGRAM FILES x86)\Windows Kits\10\Tools\x64> devcon install (PATH TO .inf) (device name)
example: devcon install avscamera.inf root\AvsCamera
@robot9706
robot9706 / nrf51822 programming
Created March 8, 2020 20:52
Programming an nrf51822 using OpenOCD
openocd.cfg:
source [find interface/stlink-v2.cfg]
transport select hla_swd
set WORKAREASIZE 0x4000
source [find target/nrf51.cfg]
Erase flash & flash SoftDevice:
halt
nrf51 mass_erase
program s110_nrf51822_6.0.0_softdevice.hex verify
@robot9706
robot9706 / LicheePI Nano
Last active December 20, 2019 16:17
LicheePI Nano stuff
https://wiki.sipeed.com/en/lichee/nano.html
http://nano.lichee.pro/
UART0:
E1 TX
E0 RX
root / licheepi
@robot9706
robot9706 / JVM FlightRecorder
Created December 8, 2019 00:12
FlightRecorder
-XX:+UnlockDiagnosticVMOptions -XX:+FlightRecorder
@robot9706
robot9706 / lego_remote.txt
Created August 19, 2019 13:32
LEGO RF car remote control
Freq: 27.145MHz
Packet: 4x LONG (SYNC) + COMMANDx SHORT
LONG: 1500us (on) / 500us (off)
SHORT: 500us (on) / 500us (off)
TP2: 40 (shorts)
TP1: 10
@robot9706
robot9706 / TV-Box.json
Created August 18, 2019 22:02
IR Remote settings for a TV Box.
{
"Buttons": [
[
{
"Color": -65536,
"IR": {
"Frequency": 38028,
"Pattern": [
8956,
4477,
List all packages with APK locations:
pm list packages -f
Create a backup of an app (including /data/data files):
adb backup -f backup.bak -noapk [package name]
Get foreground app:
dumpsys window windows | grep -E 'mCurrentFocus' | cut -d '/' -f1 | sed 's/.* //g'
Take screenshot:
@robot9706
robot9706 / Is installed from GooglePlay
Created July 20, 2019 13:42
Checks if an Android app is installed from Google
//https://stackoverflow.com/questions/48369912/check-if-an-application-is-installed-from-google-play
protected static boolean installedFromMarket(WeakReference<? extends Context> weakContext) {
boolean result = false;
Context context = weakContext.get();
if (context != null) {
try {
String installer = context.getPackageManager().getInstallerPackageName(context.getPackageName());
// if installer string is not null it might be installed by market
//Get ores
String[] allOres = OreDictionary.getOreNames();
List<String> ores = new ArrayList<String>();
for(String ore : allOres) {
if (ore.startsWith("ore")) {
ores.add(ore);
}
}
ores.size();