Skip to content

Instantly share code, notes, and snippets.

View iamfaith's full-sized avatar

程序员Faith iamfaith

View GitHub Profile
@iamfaith
iamfaith / zygisk.md
Created January 30, 2024 11:14 — forked from 5ec1cff/zygisk.md
Zygisk 源码分析 #Magisk #Zygisk

Zygisk 源码分析

以下分析基于 Magisk 76ddfeb93a8b3612cd68988323f422e996751e16

由于 Magisk 更新太快了,决定弃坑,自己去看源码罢!

Zygisk 注入到 Zygote 进程

Zygisk 加载是通过替换 app_process ,修改 LD_PRELOAD ,再执行原 app_process 实现的。

@iamfaith
iamfaith / svg2pdf.bash
Created May 1, 2023 10:48 — forked from s417-lama/svg2pdf.bash
Reliable way to convert an SVG file to a PDF file using headless Chrome
#!/bin/bash
#
# Convert an SVG file to a PDF file by using headless Chrome.
#
if [ $# -ne 2 ]; then
echo "Usage: ./svg2pdf.bash input.svg output.pdf" 1>&2
exit 1
fi
@iamfaith
iamfaith / neon.md
Created April 25, 2023 03:55
neon instrinsics quick guide

NEON Intrinsics Quick Guide

NOTE: this guide is adapted from https://github.com/thenifty/neon-guide and provides more comprehensive examples and explanations.

It's good to start from the first few sections of the current ARM NEON documentation

Intro

This section is mainly borrowed from the first 3 sections of the official documentation.

Vector Data Types

NEON vector data types are named according to the following pattern:

@iamfaith
iamfaith / content.md
Created March 24, 2023 08:00 — forked from baymaxium/content.md
如何使用Kubernetes GPU集群自动化深度学习训练?
@iamfaith
iamfaith / WSL-ssh-server.md
Created March 13, 2023 13:05 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@iamfaith
iamfaith / mp_infer.py
Created December 5, 2022 12:45 — forked from priyathamkat/mp_infer.py
Multi GPU inference using `torch.multiprocessing`
import torch
import torch.multiprocessing as mp
from absl import app, flags
from torchvision.models import AlexNet
FLAGS = flags.FLAGS
flags.DEFINE_integer("num_processes", 2, "Number of subprocesses to use")
@iamfaith
iamfaith / tmux-cheatsheet.markdown
Created November 12, 2022 14:23 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@iamfaith
iamfaith / install_nvidia_driver.md
Created September 5, 2022 13:01 — forked from espoirMur/install_nvidia_driver.md
How I fix this issue NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running

I am no longer abe to monitor this post , I have decided to move everything to my personal blog for better monitoring.

Please click here to access the full post

import torch
import numpy as np
import cv2
import pafy
from time import time
class ObjectDetection:
"""
Class implements Yolo5 model to make inferences on a youtube video using Opencv2.
@iamfaith
iamfaith / android_instructions.md
Created April 19, 2022 13:40 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"