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 实现的。

我可以用torch给你一个胶囊网络的样例代码,但是请注意,这只是一个简单的示例,可能不适用于所有的数据集和任务。你可以根据你的需要修改和优化代码。
这是一个使用torch实现的胶囊网络的样例代码¹:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
# 定义胶囊层类
import argparse
import socket
import sys
from _thread import *
try:
listening_port = 8000 #config('PORT', cast=int)
except KeyboardInterrupt:
print("\n[*] User has requested an interrupt")
@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:

python -m pip install git+https://github.com/huggingface/transformers.git
python -m pip install sentencepiece peft
利用sentencepiece提供的api修改,具体可以看 google/sentencepiece#121 和 google/sentencepiece#426
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_local
nvidia-smi显示的CUDA版本和nvcc显示的CUDA版本不一致的原因是:
@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