0%

SD卡分区

将SD卡分区,通过fdisk命令分区为2个区,100M的boot区,剩下的rootfs区,boot区
boot区格式化为fat格式,rootfs格式化为ext4
将boot挂在到/mnt/boot位置

1
2
sudo mkfs.vfat /dev/sdb1
sudo mount /dev/sdb1 /mnt/boot

准备树莓派Boot文件

1
2
3
git clone https://github.com/raspberrypi/firmware.git
cd firmware
cp -R boot/* /mnt/boot
Read more »

1. 创建虚拟磁盘

1
dd if=/dev/zero of=15g.img bs=1M count=15360 # 15GB

2. 挂载img

1
2
sudo losetup -l # 查看当前loop设备
sudo losetup /dev/loop0 15g.img # 挂在到空闲的loop0上

3. img分区

通过fdisk对img分区
执行:

1
sudo fdisk /dev/loop0
Read more »

安裝和更新 V2Ray

地址:
https://github.com/v2fly/fhs-install-v2ray

1
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

安裝最新發行的 geoip.dat 和 geosite.dat

1
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh)

移除 V2Ray

1
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --remove
Read more »

1. V8编译历程

1.1 前言

  1. 编译V8第一步就是保证能访问Google,当然不仅仅是为了查阅资料,最最重要的是V8源码下载的需要。
  2. 访问 https://v8.dev/docs ,V8官网可查看到Building V8 from source 根据所写一步步来就好。

1.2 编译环境搭建

V8源码通过depot_tools工具来管理,首先下载这个工具,作者以/Users/*/Documents/test/v8 目录为工作目录。

由于需要访问国外站,在获取depot_tools前需要做一些不可描述的事情:

1
$ export http_proxy="http://127.0.0.1:8001"; export HTTP_PROXY="http://127.0.0.1:8001"; export https_proxy="http://127.0.0.1:8001"; export HTTPS_PROXY="http://127.0.0.1:8001"
Read more »

主要任务

  • 分类(classification):将实例数据划分到合适的类别中。
    • 应用实例:判断网站是否被黑客入侵(二分类 ),手写数字的自动识别(多分类)
  • 回归(regression):主要用于预测数值型数据。
    • 应用实例:股票价格波动的预测,房屋价格的预测等。

监督学习(supervised learning)

必须确定目标变量的值,以便机器学习算法可以发现特征和目标变量之间的关系。在监督学习中,给定一组数据,我们知道正确的输出结果应该是什么样子,并且知道在输入和输出之间有着一个特定的关系。 (包括:分类和回归)

非监督学习(unsupervised learing)

在机器学习,无监督学习的问题是,在未加标签的数据中,试图找到隐藏的结构。因为提供给学习者的实例是未标记的,因此没有错误或报酬信号来评估潜在的解决方案。

Read more »

1. 安装python3虚拟环境

此步骤根据需求而定,为了不影响系统Python环境,这里建立了虚拟环境。

1
2
3
cd ~
python3 -m venv .p3env
source ~/.p3env/bin/activate

2 修改pip源

为了能加速下载Python依赖,这里修改了pip源,这步也可根据自己的需求来。
可参考清华大学的pip源设置:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

临时设置

1
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

全局设置

1
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Read more »

Nginx安装和使用

Ubuntu 安装Nginx

1
2
sudo apt update
sudo apt install nginx

启动服务

nginx 所有服务

1
2
sudo service nginx
Usage: nginx {start|stop|restart|reload|force-reload|status|configtest|rotate|upgrade}

启动

1
sudo service nginx start
Read more »

Linux 内核编译

准备Linux kernel 源码

下载地址:

https://www.kernel.org/

1
2
3
xz -d linux-5.10.12.tar.xz
tar xvf linux-5.10.12.tar
cd linux-5.10.12
安装依赖
1
2
3
4
5
6
7
sudo apt-get install build-essential
sudo apt-get install libelf-dev
sudo apt-get install libncurses-dev
sudo apt-get install flex
sudo apt-get install bison
sudo apt install kernel-package build-essential libncurses5-dev fakeroot
sudo apt install libssl-dev
编译源码
1
2
make menuconfig
make bzImage -j8
Read more »

https://developer.android.com/ndk/guides/cmake?hl=zh-cn

https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk

NDK 通过工具链文件支持 CMake。工具链文件是用于自定义交叉编译工具链行为的 CMake 文件。用于 NDK 的工具链文件位于 NDK 中的 /build/cmake/android.toolchain.cmake 内。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#/bin/bash

export ANDROID_NDK=/opt/env/android-ndk-r14b

rm -r build
mkdir build && cd build

cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DANDROID_ABI="armeabi-v7a" \
-DANDROID_NDK=$ANDROID_NDK \
-DANDROID_PLATFORM=android-22 \
..

make && make install

cd ..
Read more »

一、 Flutter 混合开发

Flutter 环境配置

1. Flutter 整体架构

flutter

Read more »