Skip to content

Instantly share code, notes, and snippets.

View letroll's full-sized avatar

Julien Quiévreux letroll

View GitHub Profile

CD to a folder like:

mkdir $HOME/Desktop/Backup_Arduino
cd $HOME/Desktop/Backup_Arduino

Set these variables

Arduino Nano Old Bootloader:

@letroll
letroll / aquara_remote_switch_single_rocker.yaml
Last active January 4, 2022 22:00
Aquara remote switch single rocker home assistant blueprint zha
blueprint:
name: Aquara remote switch single rocker
description: Automate the Aquara remote switch single rocker with zha
domain: automation
input:
aquara_remote_switch_single_rocker:
name: Aquara remote switch single rocker
selector:
device:
integration: zha
@letroll
letroll / bash_rc
Last active January 15, 2021 13:27
[log sharedpreference] log current application shared preference #android #adb #log #preference
function logPackageName() {
adb shell dumpsys activity recents | grep 'Recent #0' | cut -d= -f2 | sed 's| .*||' | cut -d '/' -f1
}
function logpref() {
APP_ID=$(logPackageName)
echo "current packageName:$APP_ID"
SHARED_PREF_FILES=$(adb shell "run-as $APP_ID ls /data/data/${APP_ID}/shared_prefs/")
SHARED_PREF_FILE=${SHARED_PREF_FILE[0]}
echo "current preference file:$SHARED_PREF_FILE"
@letroll
letroll / passwd.sh
Created December 8, 2020 08:21
[changement de mot de passe] changement de mot de passe dans une liste de fichier #password #bash #script #proxy
function replaceDas(){
file_list=(
/c/Users/UserName/.leptonrc
)
search=${1}
replace=${2}
echo "replace $search to $replace"
echo "in"
for filename in "${file_list[@]}";
do
@letroll
letroll / readme.md
Last active November 26, 2020 09:12
[Ma config Android Studio] liste des plugins, paramètre non par défaut, etc. #android #android_studio #plugin

#plugin

  • Acejump
  • Auto filling Java Call arguments
  • Hadouken progress bar
  • IdeaVim
  • Key promoter x
  • string manipulation

#configuration ide

@letroll
letroll / getDeviceInfos.sh
Created October 6, 2020 13:26
[android device information] get android device information with adb
#adb shell getprop gsm.baseband.imei
#adb shell "service call iphonesubinfo 1 | cut -c 52-66 | tr -d '.[:space:]'"
#!/bin/bash
# Get the device properties
adb shell getprop | grep "model\|version.sdk\|manufacturer\|ro.serialno\|product.name\|brand\|version.release\|build.id\|security_patch" | sed 's/ro\.//g'
# get the device ime
echo "[device.imei]: [$(adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d'| tr -d '\n' | tr -d '.' | tr -d ' ')]"
# get the device phone number
echo "[device.phonenumber]: [$(adb shell service call iphonesubinfo 19 | awk -F "'" '{print $2}' | sed '1 d'| tr -d '\n' | tr -d '.' | tr -d ' ')]"
.pv : instantiate private val
ANY → $expr$ $expr$= new $expr$();
@letroll
letroll / shell.sh
Created March 12, 2020 09:37
[Android ADB Broadcast] send broadcast from adb #adb #android #broadcast
adb shell am broadcast -a com.whereismywifeserver.intent.TEST
[-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
[--esn <EXTRA_KEY> ...]
[--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
[--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
[--el <EXTRA_KEY> <EXTRA_LONG_VALUE> ...]
[--ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE> ...]
[--eu <EXTRA_KEY> <EXTRA_URI_VALUE> ...]
[--ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>]
@letroll
letroll / script.sh
Last active December 3, 2020 10:41
[adb input] possible input with adb #adb #input #command #line #shell
https://technastic.com/adb-shell-commands-list/
#Insert text (obs: %s means SPACE)
adb shell input text "insert%syour%stext%shere"
#Event codes (82 ---> MENU_BUTTON)
adb shell input keyevent 82
#Tap X,Y position (Settings > Developer Options > Check the option POINTER SLOCATION)
adb shell input tap 500 1450
@letroll
letroll / bash.sh
Created July 9, 2019 08:39
[android keystore creation] create android keystore and alias #android #keystore #alias #certificate
Generate Keystores
To generate keystores for signing Android apps at the command line, use:
$ keytool -genkey -v -keystore my-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
A debug keystore which is used to sign an Android app during development needs a specific alias and password combination as dictated by Google. To create a debug keystore, use:
$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
Keystore name: "debug.keystore"