0%

HPM

OpenHarmony HPM 指的是 “Harmony Package Manager”

HPM Part

Module level HPM Part:用于实现模块或 Part 的复用。分发的内容可以是源码或二进制文件。通常,这样的 HPM Part 对应着一个代码仓库,是代码仓库的一个版本。

hugo

theme: next

  1. install hugo
  2. create a new site hugo new site <sitename>
  3. add theme Usage of next theme
    • download theme file: git clone https://github.com/xtfly/hugo-theme-next.git next
    • copy next directory to themes directory in your hugo site
    • move config.toml to the root directory in your hugo site, and modify it to the actual information for your site.
    • create some markdown files in directory(content/post), like https://github.com/xtfly/xtfly.github.io/tree/hugo/content
    • start hugo server in root directory: hugo server
    • open browser: http://localhost:1313/
  4. start server hugo server --bind 0.0.0.0 --baseURL http://10.0.0.7:1313

框架

[blog]$ ls
archetypes  config.toml  content  data  layouts  public  resources  static  themes

博客内容

  1. 将你写的博客内容markdown文档所在目录链接到 content 目录,链接文件命名为 post
  2. 将你的about目录链接到 content 目录,链接文件名为 about
[blog]$ tree content/
content/
├── about -> /home/lv/post/about
└── post -> /home/lv/post

博客发布

将博客发布内容路径链接为 hugo 的根目录, 链接文件命名为 public

100BASE-TX

iPerf - The ultimate speed test tool for TCP, UDP and SCTP

  • Test the limits of your network + Internet neutrality test

编译安装 iperf

windows 端直接下载二进制文件

  • iPerf 3.1.3 (8 jun 2016 - 1.3 MiB for Windows Vista 64bits to Windows 10 64bits)

嵌入式平台需要从源码[[交叉编译]]安装

关键命令

# 清空文件系统缓存, 测试读写命令之前需要执行该命令
sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"
# dd 写入速度测试
dd if=/dev/zero of=./test_write count=200 bs=1024k
# dd 读取速度测试
dd if=./test_write of=/dev/null bs=1024k

测试脚本

#!/bin/bash

# 检查是否提供了足够的参数
if [ $# -lt 1 ]; then
    echo "Usage: $0 test_count"
    exit 1
fi


# ANSI颜色码
green_color="\e[32m"  # 绿色
red_color="\e[31m"    # 红色
reset_color="\e[0m"    # 重置颜色

total_iterations=$1
# 初始化计数器
write_success_count=0
write_failure_count=0
read_success_count=0
read_failure_count=0
echo "Total number of iterations: $total_iterations"


for ((i=1; i<=$total_iterations; i++)); do

	# 清空文件系统缓存
	sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"

	# 执行dd写入测试
	if dd if=/dev/zero of=./test_write count=200 bs=1024k 2>&1 | grep -q "records in"; then
	    write_speed=$(dd if=./test_write of=/dev/null bs=1024k 2>&1 | awk '/copied/ {print $(NF-1), $NF}')
	    echo "write speed: $write_speed"
	    ((write_success_count++))
	else
	    echo "write failed"
	    ((write_failure_count++))
	fi

	# 再次清空文件系统缓存
	sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"

	# 执行dd读取测试
	if dd if=./test_write of=/dev/null bs=1024k 2>&1 | grep -q "records in"; then
	    read_speed=$(dd if=./test_write of=/dev/null bs=1024k 2>&1 | awk '/copied/ {print $(NF-1), $NF}')
	    echo "read  speed: $read_speed"
	    ((read_success_count++))
	else
	    echo "read failed"
	    ((read_failed_count++))
	fi
	echo "----------------"

done


# 输出总的测试次数、成功次数和失败次数
echo "Total number of tests: $total_iterations"
echo -e "${green_color}Number of write successful tests: $write_success_count${reset_color}"
echo -e "${green_color}Number of read  successful tests: $read_success_count${reset_color}"
echo -e "${red_color}Number of write failed tests: $write_failure_count${reset_color}"
echo -e "${red_color}Number of read  failed tests: $read_failure_count${reset_color}"

系统基本信息

[baihao@vstation ~]$ screenfetch

 ██████████████████  ████████     baihao@vstation
 ██████████████████  ████████     OS: Manjaro 20.2.1 Nibia
 ██████████████████  ████████     Kernel: x86_64 Linux 5.9.16-1-MANJARO
 ██████████████████  ████████     Uptime: 17m
 ████████            ████████     Packages: 1220
 ████████  ████████  ████████     Shell: bash 5.1.0
 ████████  ████████  ████████     Resolution: 1920x951
 ████████  ████████  ████████     DE: Xfce4
 ████████  ████████  ████████     WM: Xfwm4
 ████████  ████████  ████████     WM Theme: Matcha-sea
 ████████  ████████  ████████     GTK Theme: Matcha-sea [GTK2]
 ████████  ████████  ████████     Icon Theme: Papirus-Maia
 ████████  ████████  ████████     Font: Noto Sans 10
 ████████  ████████  ████████     Disk: 241G / 674G (37%)
                                  CPU: Intel Core i7-10510U @ 2x 2.304GHz
                                  GPU: llvmpipe (LLVM 11.0.0, 256 bits)
                                  RAM: 2134MiB / 3935MiB

wps + fcitx5 无法输入中文

参考

环境

ubuntu 18.04 x64

依赖工具

配置流程

jdk 安装

sudo apt install openjdk-8-jdk openjdk-8-jdk-headless openjdk-8-jre openjdk-8-jre-dcevm openjdk-8-jre-headless

通常android编译环境能够正常工作jdk环境已经ok.

$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

universal-ctags

ubuntu 自带包管理器安装的 ctagsexuberant-ctags, 如果已经安装请先通过如下命令卸载

代码下载

OpenHarmony源代码以 [[HPM]] 部分的形式提供,可以通过以下任意方式获取:

  1. 从Gitee代码库获取源码。您可以使用repo或git工具从代码仓库下载最新的代码。

环境准备

下载repo工具

user110@server005:~/bin$  curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
user110@server005:~/bin$  chmod +x repo

添加环境变量中

user110@server005:~/bin$ vim ~/.bashrc
# add code
PATH=$PATH:$HOME/bin
export REPO_URL=‘git://10.20.6.145/git-repo’ # repo 源地址
user110@server005:~/bin$ source ~/.bashrc

上传 ssh public key

拉代码

初始化

user110@server005:~/delete$ repo init -u <ssh://user112@10.20.6.136:29418/platform/manifest.git> -b <branch> -m <manifest_xml>
-u:表示git仓库地址
-m:表示具体的xml文件
-b:表示指定特殊的分支

同步

user110@server005:~/delete$ repo sync –j8

工作流

创建开发分支

repo start <branch_name> -all

修改

修改代码

安装

For ubuntu

# smbclient 用来测试 samba 服务
sudo apt install samba smbclient

For arch

sudo pacman -Sy samba smbclient

配置文件

/etc/samba/smb.conf 末尾追加如下内容:

注意这里的 [share] windows 映射网络驱动器的时候路径为: \\<ubuntu ip>\share

[share]
path = /home/username/Public
public = yes
writable = yes
valid users = username //映射时的登陆名
create mask = 0644
force create mode = 0644
directory mask = 0755
force directory mode = 0755
available = yes

设置密码

sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a username
# then insert password

重启 samba 服务

For ubuntu