Skip to content

Instantly share code, notes, and snippets.

View farhanarrafi's full-sized avatar
🤹‍♂️
Multi-threading

Farhan Ar Rafi farhanarrafi

🤹‍♂️
Multi-threading
View GitHub Profile
@farhanarrafi
farhanarrafi / AppleDevices.m
Created October 31, 2022 06:05 — forked from acalism/AppleDevices.m
How to get Device Model and Model Name(Human readable)
// see my comments
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@farhanarrafi
farhanarrafi / Android_flash_instructions.md
Last active December 9, 2021 04:38
Instructions for flashing AOSP firmware into Android device

Android device flashing instructions

This guide covers the steps for flashing Android firmware into hardware device. These steps can be used to flash AOSP build into a hardware device. Please follow the steps in order.

Unlock device for firmware flash:

Please follow the instructions on the Flashing Devices page for unlocking the device.

Boot device into bootloader:

@farhanarrafi
farhanarrafi / mysql2sqlite.sh
Created April 18, 2021 17:02 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@farhanarrafi
farhanarrafi / README.txt
Created May 27, 2020 17:32 — forked from Cyberek/README.txt
Starting Kodi automatically on Raspbian Jessie and Stretch
So you were able to install Kodi via "sudo apt-get install kodi" but have no idea how to force it to autostart on boot?
You have tried all those googled solutions such as adding kodi-standalone to .bashrc, creating init.d script but nothing worked?
This is the right place to get the answer.
For some reason, the current version of Kodi doesnt provide 2 important files:
/etc/init.d/kodi
/etc/default/kodi
@farhanarrafi
farhanarrafi / AdbCommands
Created September 16, 2019 08:59 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@farhanarrafi
farhanarrafi / OSM_map_tiles_download.sh
Created July 5, 2019 15:07
Script to download map tiles from Open Street Maps for offline rendering
#!/bin/sh
# Script to download map tiles from Open Street Maps
# Author: Farhan Ar Rafi
# number of tiles in x and y direction
# this will be 2^Z
N=7
# sleep time between downloads
SLEEP=3
@farhanarrafi
farhanarrafi / adb+
Created September 25, 2018 08:04 — forked from christopherperry/adb+
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@farhanarrafi
farhanarrafi / DefaultPermissionGrantPolicy.java
Last active June 14, 2018 08:39
Changes necessary for changing application to system application.
// File DefaultPermissionGrantPolicy.java in frameworks/base/services/core/java/com/android/server/pm/
// Add the floowing code below the other declarations:
private static final Set<String> POCKETALK_PERMISSIONS = new ArraySet<>();
static {
POCKETALK_PERMISSIONS.add(Manifest.permission.READ_EXTERNAL_STORAGE);
POCKETALK_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
POCKETALK_PERMISSIONS.add(Manifest.permission.RECORD_AUDIO);
POCKETALK_PERMISSIONS.add(Manifest.permission.ACCESS_FINE_LOCATION);