Skip to content

Instantly share code, notes, and snippets.

import (
"fmt"
"io"
"net/http"
"os"
)
func Download(url string, filepath string) error {
offset := int64(0)
info, err := os.Stat(filepath)
@Lua12138
Lua12138 / flutter_disable_ssl_validation.js
Created January 26, 2024 03:41
Disable flutter SSL validation by Frida in Android
// cli: frida --runtime v8 -l flutter_disable_ssl_validation.js -f com.my.target.package -H 192.168.0.123:6666
function hook_ssl_verify_result(address) {
console.log('try to hook address:' + address)
Interceptor.attach(address, {
onEnter: function (args) {
console.log("Disabling SSL validation")
}, onLeave: function (retval) {
console.log("Retval: " + retval);
retval.replace(0x1);
}
@Lua12138
Lua12138 / cross-arm.Dockerfile
Created June 30, 2022 07:16
ARM交叉编译环境
FROM debian
RUN apt update && \
apt install -y curl xz-utils make && \
mkdir /toolchain && \
curl -L -o /toolchain/arm.tar.xz "https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz" && \
cd /toolchain && \
xz -d arm.tar.xz && \
tar -xvf /toolchain/arm.tar -C /toolchain && \
rm /toolchain/arm.tar
#!/bin/bash
myip(){
IP_API_1="http://ip-api.com/json"
IP_API_2="https://ipapi.co/json/"
IP_API_RESULT_1=$(curl -s -X GET "${IP_API_1}" | jq -r .query)
if [ -z IP_API_RESULT_1 ]
then
@Lua12138
Lua12138 / docker-compose.yaml
Created March 22, 2022 07:40
Nginx in docker with templates
version: "3"
services:
nginx:
image: nginx:1.21.6-alpine
environment:
- NGINX_ORDER_HOST=sample.com
- NGINX_ORDER_BACKEND=http://sample:8080
volumes:
- "./nginx/templates:/etc/nginx/templates:ro"
@Lua12138
Lua12138 / install_docker_and_compose.sh
Last active March 22, 2022 04:02
Install Docker & Docker-Compose with Debian
#!/bin/sh
apt-get remove docker docker-engine docker.io containerd runc
apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
@Lua12138
Lua12138 / Install-Hyper-V.bat
Created October 4, 2020 05:05
Install Hyper-V with Windows Home Edition (run with Administrator) / Windows 家庭版安装hyper-v(使用管理员身份运行)
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL
project art/
diff --git a/runtime/base/file_magic.cc b/runtime/base/file_magic.cc
index 97563382a..0af1569ad 100644
--- a/runtime/base/file_magic.cc
+++ b/runtime/base/file_magic.cc
@@ -19,7 +19,8 @@
#include <fcntl.h>
{
"log": {
"loglevel": "info"
},
"dns": {
"remark": "此节点配置上游DNS",
"servers": [
"1.2.4.8",
"119.29.29.29"
]