Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
adb shell pm disable-user --user 0 com.oneplus.opbackup
@Voronenko
Voronenko / group_policy.json
Created January 11, 2022 16:27
Allow group members to assume specific role
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "123",
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": [
The command you are looking for is ddccontrol, available from the regular Ubuntu repository.
WARNING! ddccontrol sends data over the i2c bus, which is inherently a dangerous thing to do. Most i2c devices are very low-level and very dumb, one misplaced command can be enough to brick them or at least freeze the computer. That said, DDC/CI is a somewhat standardized, quite established and quite old technology, so the risks is not too high.
For this reason, by default, i2c devices are only accessible to root. You will most likely need to prefix all commands below with sudo. (I have voluntarily not done it to ensure you read the instructions and not blindly copy/paste them.)
Probing your monitor
The first thing to do is to probe the various i2c buses in your computer (mine has 11 such buses...), searching for the one that is actually on the graphics card, connected to the screen.
The ddccontrol -p command does that, and shows what it found. Sample output from my computer:
@Voronenko
Voronenko / pull_apk.md
Created December 23, 2021 14:40 — forked from oozzal/pull_apk.md
Pull Apk from device
  1. Determine the package name of the app, e.g. "com.example.someapp". Skip this step if you already know the package name.

adb shell pm list packages

Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

  1. Get the full path name of the APK file for the desired package.
To query a small set of log groups:
Open the Amazon CloudWatch console.
In the navigation pane, choose Metrics.
For each of your log groups, select the IncomingBytes metric, and then choose the Graphed metrics tab.
For Statistic, choose Sum.
For Period, choose 30 Days.
Choose the Graph options tab and choose Number.
At the top right of the graph, choose custom, and then choose Absolute. Select a start and end date that corresponds with the last 30 days.
To query hundreds of log groups:
---
auth_enabled: true
common:
storage:
s3:
bucketnames: loki-00,loki-01,loki-02,loki-03,loki-04,loki-05,loki-06,loki-07,loki-08,loki-09
endpoint: ceph:7480
region: US
access_key_id:xxx
@Voronenko
Voronenko / getAppVersion.sh
Created November 21, 2021 21:08 — forked from martinschneider/getAppVersion.sh
Bash script to extract version information from APK and IPA files
#/bin/bash
#
# Extract the app version number from an APK/IPA file (on Linux)
#
# Required tools: aapt, plistutil, xmllint
#
# Usage:
# ------
# getAppVersion.sh android pathToApk
# getAppVersion.sh ios pathToIpa AppName.app
@Voronenko
Voronenko / How to Install JDK MacOS Homebrew.md
Created November 17, 2021 13:53 — forked from gwpantazes/How to Install JDK MacOS Homebrew.md
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@Voronenko
Voronenko / Bash Script Header.sh
Created November 11, 2021 15:06
bash bash bash
#!/bin/bash
#!/usr/bin/env bash
@Voronenko
Voronenko / wakeup_python.sh
Created November 2, 2021 19:30
Here is a Python script that does wake on lan (if your MAC address is01-23-45-67-89-0a:
#!/usr/bin/env python
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto('\xff'*6+'\x01\x23\x45\x67\x89\x0a'*16, ('192.168.1.255', 80))