Skip to content

Instantly share code, notes, and snippets.

View hhhaiai's full-sized avatar
♣️
Focusing

hhhaiai hhhaiai

♣️
Focusing
View GitHub Profile
import android.app.AppComponentFactory;
import android.content.pm.ApplicationInfo;
import android.util.Log;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipFile;
@hhhaiai
hhhaiai / 8GB_android-10_compilation-note
Created June 15, 2023 08:14 — forked from mikecriggs/8GB_android-10_compilation-note
Workarounds for building Android 10 on 8GB RAM
Workarounds for building Q on 8GB RAM environment:
1. At the start of the build:
[ 99% 138/139] /mnt/ssd/aosip/out/soong/.bootstrap/bin/soong_build /mnt/ssd/aosip/out/soong/build.ninja
This used to take around 30mins, after enabling zram now it takes around 30secs (thanks to @kdrag0n for the zram idea) which is on par with what happens in 16GB RAM building environments
sudo apt install zram-config for installing zram-config package
sudo nano /etc/fstab and add a # in front of the swap disk if you have one and then reboot
After booting cat /proc/swaps to check if zram is enabled or not
@hhhaiai
hhhaiai / docker_usb_guest_osx.md
Created January 31, 2023 08:33 — forked from stonehippo/docker_usb_guest_osx.md
Getting a USB device to show up in a Docker container on OS X

Getting a USB device to show up in a Docker container on OS X

Some background

I was trying to get the Arduino IDE to work inside a Docker container on OS X. I was able to get the IDE working (see Getting X11 GUI applications to work on OS X with Docker), but I could not figure out how to make the USB port for the Arduino visible.

The solution

I first tried to directly map hardware serial port into the Docker container, doing something like this:

@hhhaiai
hhhaiai / MagiskSupport.md
Created January 13, 2023 01:58 — forked from assiless/MagiskSupport.md
MagiskOnRedroid
setup variables for commands
echo -e "\n
export image=redroid/redroid:11.0.0-amd64
export image_tar=${HOME}/redroid:11.0.0-amd64" >> ${HOME}/.bashrc
source ${HOME}/.bashrc
@hhhaiai
hhhaiai / MagiskSupport.md
Created January 13, 2023 01:58 — forked from assiless/MagiskSupport.md
MagiskOnRedroid
setup variables for commands
echo -e "\n
export image=redroid/redroid:11.0.0-amd64
export image_tar=${HOME}/redroid:11.0.0-amd64" >> ${HOME}/.bashrc
source ${HOME}/.bashrc
@hhhaiai
hhhaiai / install_grpc.md
Last active December 26, 2022 07:21
Install gRPC++ on Ubuntu20.04

Solved step

# install dependencies,it's easy here
sudo apt install -y cmake
# install basic tools
sudo apt install -y build-essential autoconf libtool pkg-config

# clone from github and install it,I installed v1.51.1 here
git clone --recurse-submodules -b v1.51.1 https://github.com/grpc/grpc
cd grpc
@hhhaiai
hhhaiai / install_grpc.md
Created December 26, 2022 07:20
Install gRPC++ on Ubuntu20.04

Solved step

# install dependencies,it's easy here
sudo apt install -y cmake
# install basic tools
sudo apt install -y build-essential autoconf libtool pkg-config

# clone from github and install it,I installed v1.34.1 here
git clone --recurse-submodules -b v1.34.1 https://github.com/grpc/grpc
cd grpc
@hhhaiai
hhhaiai / config.json
Created December 21, 2022 05:58 — forked from wd/config.json
路由器梅林固件上面使用 v2ray 的方案
{
"log": {
"loglevel": "none"
},
"inbound": {
"port": 23456,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
@hhhaiai
hhhaiai / git-config-http-version.md
Created November 9, 2022 10:21 — forked from daopk/git-config-http-version.md
Fix error : RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
git config --global http.version HTTP/1.1
git config --global http.postBuffer 157286400
@hhhaiai
hhhaiai / (Android)UDPReceiverNetwork.kt
Created June 28, 2022 02:22 — forked from gtf35/(Android)UDPReceiverNetwork.kt
通过 UDP 广播局域网自动发现 Android 客户端 IP / Auto find android device ip by UDP broadcast
// Receive desptop`s udp broadcast package on Android, let Android app known desktop device`s ip
package top.gtf35.nekosdk.network
import kotlinx.coroutines.*
import top.gtf35.nekosdk.utils.LogUtil
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.DatagramPacket
import java.net.DatagramSocket
import java.net.InetAddress