APP开发
未读
AndroidSdk和Adb常用命令
## Android SDK与ADB常用命令摘要
本文汇总了Android开发和调试中常用的命令行工具,分为两大板块。
**包管理器(sdkmanager)**:用于管理SDK组件。包括列出所有可用包、查看已安装包、安装指定版本构建工具/CMake/模拟器/平台工具、卸载不再需要的组件等操作。
**虚拟机管理(avdmanager)**:支持创建、删除Android虚拟设备。可指定系统镜像、API级别及架构(arm64-v8a)。启动时可通过参数控制冷启动或清除数据。若遇硬件加速错误,需在Windows功能中启用Hyper-V并重启。
**ADB命令**:完成设备连接与应用部署。常用操作包括查看已连接设备、通过IP地址连接无线调试设备、指定设备安装APK等。这些命令是日常Android开发中进行真机或模拟器调试的基础工具。
问题记录
未读
排查Linux根目录文件总占用小,但磁盘空间使用率高的问题
## 摘要
本文介绍如何排查Linux系统中“根目录文件总占用小,但磁盘空间使用率高”的异常问题。
**原因分析**:当文件被删除后,若有相关进程仍在运行,该文件占用的磁盘空间不会自动释放,导致df显示空间不足。
**解决方案**:使用lsof命令查找已删除但未释放的文件,按进程分组统计大小,然后重启相关进程即可回收空间。
作者提供了一个自动化脚本`showNoFreeDeletedFiles.sh`,通过`lsof | grep deleted`定位已删除文件,分析每个PID对应的文件总大小,帮助运维人员快速定位需要重启的进程,从而有效释放被占用的磁盘空间。
好玩的APP
未读
搭建个人音乐库
# 个人音乐库搭建方案摘要
本文介绍如何搭建个人音乐库,整合三款开源工具实现完整的音乐管理与播放体验。
**核心组件:**
1. **Navidrome**:开源音乐流服务器,负责音乐文件的存储与流媒体服务,支持多用户访问和丰富的元数据管理。
2. **音流**:跨平台音乐播放器客户端,支持Windows、Android、iOS系统,可连接Navidrome服务实现无缝音乐播放体验。
3. **Music Tag Web**:音乐标签编辑器,支持批量自动修正音频文件的曲名、专辑、艺术家、封面及歌词等信息,兼容MP3、FLAC、WAV等十余种格式。
**部署方式:**
通过Docker容器化部署,配置文件简洁明了。Navidrome映射音乐文件夹与数据目录;Music Tag Web默认端口8002,账号密码为admin。
该方案适合NAS用户或自建音乐服务器爱好者,可实现音乐文件管理、自动整理及多端同步播放的完整闭环。
好玩的APP
未读
icloudpd
## 摘要
本文介绍如何通过Docker容器工具icloudpd实现iCloud照片的每日定时同步下载。
**核心步骤**:首先使用`chmod -R 777 iCloud`赋予文件夹权限,随后执行`sync-icloud.sh --Initialise`完成初始化(约需2分钟),最后通过两步验证完成认证连接。
**有效期说明**:iCloud认证有效期为90天,过期后需重新认证以恢复同步功能。
**Docker配置要点**:docker-compose文件中需配置apple_id(Apple ID邮箱)、时区、同步间隔(默认86400秒)、自动删除开关、中国区iCloud标识及文件夹结构模板等参数。配置目录用于存储认证Cookie,下载目录指定本地存储路径。
**项目地址**:github.com/boredazfcuk/docker-icloudpd
问题记录
未读
linux遍历指定目录下log文件内容以查找内容
## 文章摘要
本文介绍两个Linux日志搜索脚本,均用于在多个指定目录下查找.log文件中的特定内容。
**find-log.sh**:遍历10个不同业务模块的日志目录(pms、personal、order、goods、finance、logger、jd、recharge、orange、perform),根据传入的过滤关键词搜索匹配的日志行,并输出文件名及匹配内容。
**find-errlog.sh**:功能与第一个脚本类似,但增加了ERROR级别日志的过滤。搜索时先匹配关键词,再筛选ERROR类型,并额外显示匹配行后的50行上下文,便于定位错误根因。
两个脚本均使用Bash编写,通过数组存储目标目录列表,结合grep、sed等命令实现日志检索,可显著提升排查多服务日志的效率。
问题记录
未读
nginx代理设置允许跨域请求
## 摘要
本文介绍在Nginx代理服务器中配置允许跨域请求的方法。通过在location块中添加特定的响应头配置,实现对跨域访问的支持。主要配置包括:
1. **隐藏原有跨域头**:使用`proxy_hide_header`清除后端可能设置的`Access-Control-Allow-Origin`
2. **添加跨域响应头**:设置允许来源、请求头和HTTP方法均为通配符`*`
3. **优化预检请求**:对OPTIONS请求直接返回204状态码,避免不必要的代理转发
完整配置以api.test.com域名为例,监听80和443端口,反向代理到本地8100端口。配置中同时包含了SSL证书验证目录设置和安全访问限制(如禁止访问.git、.env等敏感文件)。此配置适用于前后端分离架构中API服务的跨域需求。
问题记录
未读
Windows10在启动时自动运行的应用
Windows10在启动时自动运行的应用 步骤: 选择“开始”按钮 ,然后滚动查找你希望在启动时运行的应用。 右键单击该应用,选择 “更多” ,然后选择 “打开文件位置” 。 此操作会打开保存应用快捷方式的位置。 如果没有“打开文件位置”选项,这意味着该应用无法在启动时运行。 文件位置打开后,按 W
技术栈
未读
Git初始流程
{"id":"06686898a6e465244589f9f1209f3b75","type":"message","role":"assistant","model":"MiniMax-M2.5-highspeed","content":[{"thinking":"The user asks: \"你是一个专业的文章摘要总结助手,请根据文章内容生成简洁明了的摘要,字数控制在200字左右。\"\n\nThey provide a Chinese article about \"Git初始流程\" with SSH and Git repository steps. So we need to produce a concise summary in Chinese, about 200 characters. It should capture key points: generating SSH key, configuring SSH config to avoid connection timeout, initializing a local git repo, setting remote origin, setting upstream branch, committing and pushing.\n\nMake sure about 200 characters. Could be ~200 Chinese characters, not words.\n\nWe need to produce a concise summary, about 200 characters, Chinese.\n\nThe user also gave code snippets. Summaries should be plain text.\n\nWe need to generate a summary.\n\nPotential summary: \"本文介绍Git初始化和SSH配置流程。首先使用ssh-keygen生成RSA密钥,然后创建~/.ssh/config文件,指定Host、端口443等以避免连接超时。随后在本地执行git init初始化仓库,使用git remote add添加远程仓库地址,git branch --set-upstream-to设置上游分支,最后git add .、git commit和git push完成提交和推送。\"\n\nCheck length. Let's count characters: \"本文介绍Git初始化和SSH配置流程。首先使用ssh-keygen生成RSA密钥,然后创建~/.ssh/config文件,指定Host、端口443等以避免连接超时。随后在本地执行git init初始化仓库,使用git remote add添加远程仓库地址,git branch --set-upstream-to设置上游分支,最后git add .、git commit和git push完成提交和推送。\"\n\nCount characters manually: We'll approximate length. Chinese characters count as 1 each; ASCII code like \"ssh-keygen\", \"RSA\", etc count each as 1 char. But overall it's probably less than 200 characters. Let's count:\n\n\"本文介绍Git初始化和SSH配置流程。\" That's about 13? Let's count: 本(1)文2介3绍4G5i6t7初8始9化10和11S12S13H14配15置16流17程18。 So 18 characters inc punctuation.\n\n\"首先使用ssh-keygen生成RSA密钥,然后创建~/.ssh/config文件,指定Host、端口443等以避免连接超时。\" Let's count: 首1先2使3用4 s5 s6 h7 -8 k9 e10 y11 g12 e13 n14 生15成16 R17 S18 A19 密20钥21 ,22 然23 后24 创25 建26 ~27 /28 .29 s30 s31 h32 /33 c34 o35 n36 f37 i38 g39 文40 件41 ,42 指43 定44 H45 o46 s47 t48 、49 端50 口51 4 5 2 3 etc? Actually 443 is three digits, each count as a character: 4 5 3? That's three digits. So we need count individually: 4 is one, 5 second, 3 third. So after 端 (?), we have 4,5,3. But let's continue. \"等\" is one. So \"等以避免连接超时\". Let's count precisely. But approximate number is maybe ~50 characters. Then \"随后在本地执行git init初始化仓库,使用git remote add添加远程仓库地址,git branch --set-upstream-to设置上游分支,最后git add .、git commit和git push完成提交和推送。\" That also maybe ~80. So total maybe around 150. That's fine.\n\nThe user wants \"200字左右\" which can be ~200 Chinese characters. So we could produce summary about 180-200 characters.\n\nWe can also add a bit more explanation: \"配置SSH config是为了让Git通过443端口而非默认22端口访问GitHub,解决防火墙导致的超时问题。\" etc. We can incorporate.\n\nLet's produce a concise summary within 200 Chinese characters, perhaps around 190 characters.\n\nMake sure it's not too verbose, but covers main points: generate SSH key, config file, init repo, set remote, upstream branch, commit, push.\n\nAdd mention that config file ensures connectivity.\n\nWe can write:\n\n\"本文概述Git初始化的关键步骤:①使用ssh‑keygen生成4096位RSA密钥对;②在~/.ssh/config中配置Host为github.com,使用Hostname为ssh.github.com、端口443,以解决22端口超时问题;③本地执行git init创建仓库;④使用git remote add添加远程仓库地址;⑤通过git branch --set‑upstream‑to将本地分支关联到远程主分支;⑥git add .、git commit‑m提交信息后执行git push完成推送。\"\n\nLet's count characters.\n\n\"本文概述Git初始化的关键步骤:①使用ssh‑keygen生成4096位RSA密钥对;②在~/.ssh/config中配置Host为github.com,使用Hostname为ssh.github.com、端口443,以解决22端口超时问题;③本地执行git init创建仓库;④使用git remote add添加远程仓库地址;⑤通过git branch --set‑upstream‑to将本地分支关联到远程主分支;⑥git add .、git commit‑m提交信息后执行git push完成推送。\"\n\nCount characters (including punctuation, numbers, letters). Let's count manually.\n\nFirst part: \"本文概述Git初始化的关键步骤:\" Count: 本1 文2 概3 述4 G5 i6 t7 初8 始9 化10 的11 关12 键13 步14 骤15 :16 So 16 characters.\n\nThen \"①使用ssh‑keygen生成4096位RSA密钥对;\" Let's count: ① is a symbol, but it's one. So:\n\n\"①\"1 \"使用\"2? Actually \"使用\" is two characters, \"使\" and \"用\". Let's count each.\n\nWe'll do step by step.\n\nWe'll count each Chinese character as 1, each Latin letter/digit also 1. We'll treat \"ssh‑keygen\" includes hyphen maybe considered one char, and \"ssh\" is three letters, \"keygen\" is six letters, hyphen maybe one.\n\n\"①使用ssh‑keygen生成4096位RSA密钥对;\"\n\nBreakdown:\n\n① =1\n使 =2\n用 =3\ns =4\ns =5\nh =6\n‑ (hyphen) =7\nk =8\ne =9\ny =10\ng =11\ne =12\nn =13\n生 =14\n成 =15\n4 =16\n0 =17\n9 =18\n6 =19\n位 =20\nR =21\nS =22\nA =23\n密 =24\n钥 =25\n对 =26\n; =27\n\nSo that part 27 characters.\n\nNext part: \"②在~/.ssh/config中配置Host为github.com,使用Hostname为ssh.github.com、端口443,以解决22端口超时问题;\"\n\nLet's count.\n\n② =1\n在 =2\n~ =3\n/ =4\n. =5\ns =6\ns =7\nh =8\n/ =9\nc =10\no =11\nn =12\nf =13\ni =14\ng =15\n中 =16\n配 =17\n置 =18\nH =19\no =20\ns =21\nt =22\n为 =23\ng =24\ni =25\nt =26\nh =27\nu =28\nb =29\n. =30\nc =31\no =32\nm =33\n, =34\n使 =35\n用 =36\nH =37\no =38\ns =39\nt =40\nn =41\na =42\nm =43\ne =44\n为 =45\ns =46\ns =47\nh =48\n. =49\ng =50\ni =51\nt =52\nh =53\nu =54\nb =55\n. =56\nc =57\no =58\nm =59\n、 =60\n端 =61\n口 =62\n4 =63\n4 =64\n3 =65\n, =66\n以 =67\n解 =68\n决 =69\n2 =70\n2 =71\n端 =72\n口 =73\n超 =74\n时 =75\n问 =76\n题 =77\n; =78\n\nSo that part 78 characters.\n\nNext: \"③本地执行git init创建仓库;\"\n\n③ =1\n本 =2\n地 =3\n执 =4\n行 =5\ng =6\ni =7\nt =8\n = space? Actually there is no space. Actually \"git\" includes letters: g i t. Then a space? The text shows \"git init\". There's a space between git and init. We count space? Usually spaces count as characters. Let's count it. So after \"git\" there is a space. Then \"init\". So we need to include the space. Let's count properly.\n\nWe'll break down:\n\n③ =1\n本 =2\n地 =3\n执 =4\n行 =5\ng =6\ni =7\nt =8\n(space) =9\ni =10\nn =11\ni =12\nt =13\n创 =14\n建 =15\n仓 =16\n库 =17\n; =18\n\nSo 18 characters.\n\nNext: \"④使用git remote add添加远程仓库地址;\"\n\n④ =1\n使 =2\n用 =3\ng =4\ni =5\nt =6\n(space) =7\nr =8\ne =9\nm =10\no =11\nt =12\ne =13\n(space) =14\na =15\nd =16\nd =17\n添 =18\n加 =19\n远 =20\n程 =21\n仓 =22\n库 =23\n地 =24\n址 =25\n; =26\n\nSo 26 characters.\n\nNext: \"⑤通过git branch --set‑upstream‑to将本地分支关联到远程主分支;\"\n\n⑤ =1\n通 =2\n过 =3\ng =4\ni =5\nt =6\n(space) =7\nb =8\nr =9\na =10\nn =11\nc =12\nh =13\n(space) =14\n- =15\n- =16\ns =17\ne =18\nt =19\n‑ =20 (the hyphen)\nu =21\np =22\ns =23\nt =24\nr =25\ne =26\na =27\nm =28\n‑ =29\nt =30\no =31\n将 =32\n本 =33\n地 =34\n分 =35\n支 =36\n关 =37\n联 =38\n到 =39\n远 =40\n程 =41\n主 =42\n分 =43\n支 =44\n; =45\n\nSo 45 characters.\n\nNext: \"⑥git add .、git commit‑m提交信息后执行git push完成推送。\"\n\n⑥ =1\ng =2\ni =3\nt =4\n(space) =5\na =6\nd =7\nd =8\n(space) =9\n. =10\n、 =11\ng =12\ni =13\nt =14\n(space) =15\nc =16\no =17\nm =18\nm =19\ni =20\nt =21\n‑ =22\nm =23\n提 =24\n交 =25\n信 =26\n息 =27\n后 =28\n执 =29\n行 =30\ng =31\ni =32\nt =33\n(space) =34\np =35\nu =36\ns =37\nh =38\n完 =39\n成 =40\n推 =41\n送 =42\n。 =43\n\nSo 43 characters.\n\nNow sum all characters:\n\nFirst segment: 16\nSecond: 27 =\u003e total 43\nThird: 78 =\u003e total 121\nFourth: 18 =\u003e total 139\nFifth: 26 =\u003e total 165\nSixth: 45 =\u003e total 210\nSeventh: 43 =\u003e total 253\n\nTotal ~253 characters, exceeding 200. Need to reduce to around 200 characters.\n\nWe need to condense more, maybe combine some steps and remove some details.\n\nSimplify: Instead of enumerating each step in full detail, use concise phrasing.\n\nGoal: ~200 characters. Let's aim for around 190 characters.\n\nLet's propose a revised summary:\n\n\"本文介绍Git初始化的关键流程:①使用ssh‑keygen生成RSA密钥;②在~/.ssh/config中配置Host为github.com、Hostname为ssh.github.com、端口443,解决22端口超时;③本地git init创建仓库;④git remote add添加远程地址;⑤git branch --set‑upstream‑to关联本地分支到远程主分支;⑥git add .、git commit‑m提交后git push推送。\"\n\nNow count characters.\n\nWe'll count again:\n\n\"本文介绍Git初始化的关键流程:①使用ssh‑keygen生成RSA密钥;②在~/.ssh/config中配置Host为github.com、Hostname为ssh.github.com、端口443,解决22端口超时;③本地git init创建仓库;④git remote add添加远程地址;⑤git branch --set‑upstream‑to关联本地分支到远程主分支;⑥git add .、git commit‑m提交后git push推送。\"\n\nWe need to count.\n\nBreak into parts:\n\n\"本文介绍Git初始化的关键流程:\" Count:\n\n本1 文2 介3 绍4 G5 i6 t7 初8 始9 化10 的11 关12 键13 流14 程15 :16\n\nSo 16 characters.\n\nNow part after colon: \"①使用ssh‑keygen生成RSA密钥;\"\n\n① =1\n使 =2\n用 =3\ns =4\ns =5\nh =6\n‑ =7\nk =8\ne =9\ny =10\ng =11\ne =12\nn =13\n生 =14\n成 =15\nR =16\nS =17\nA =18\n密 =19\n钥 =20\n; =21\n\nSo 21 characters.\n\nRunning total: 16 + 21 = 37.\n\nNext: \"②在~/.ssh/config中配置Host为github.com、Hostname为ssh.github.com、端口443,解决22端口超时;\"\n\nWe'll count carefully.\n\n② =1\n在 =2\n~ =3\n/ =4\n. =5\ns =6\ns =7\nh =8\n/ =9\nc =10\no =11\nn =12\nf =13\ni =14\ng =15\n中 =16\n配 =17\n置 =18\nH =19\no =20\ns =21\nt =22\n为 =23\ng =24\ni =25\nt =26\nh =27\nu =28\nb =29\n. =30\nc =31\no =32\nm =33\n、 =34\nH =35\no =36\ns =37\nt =38\nn =39\na =40\nm =41\ne =42\n为 =43\ns =44\ns =45\nh =46\n. =47\ng =48\ni =49\nt =50\nh =51\nu =52\nb =53\n. =54\nc =55\no =56\nm =57\n、 =58\n端 =59\n口 =60\n4 =61\n4 =62\n3 =63\n, =64\n解 =65\n决 =66\n2 =67\n2 =68\n端 =69\n口 =70\n超 =71\n时 =72\n; =73\n\nThus 73 characters.\n\nRunning total: 37 + 73 = 110.\n\nNext: \"③本地git init创建仓库;\"\n\n③ =1\n本 =2\n地 =3\ng =4\ni =5\nt =6\n(space?) Actually \"git init\" includes a space. But there is no space after \"git\"? The text shows \"git init\". So we have \"本地git init创建仓库\". That is \"本地\"+\"git\"+\" init\"? Actually \"本地git init创建仓库\". There is no space between \"本地\" and \"git\"? It says \"本地git init创建仓库\". So \"本地\" then \"git\". So we need to count \"本地g\". Actually characters: \"本\" (1), \"地\" (2), \"g\" (3), \"i\" (4), \"t\" (5), \" \" maybe no space? Actually after \"git\" there is a space? The phrase \"git init\" includes a space. So after \"git\" there is a space, then \"init\". So let's parse \"本地git init创建仓库\". The string: 本 (1), 地 (2), g (3), i (4), t (5), space (6), i (7), n (8), i (9), t (10), 创 (11), 建 (12), 仓 (13), 库 (14), ; (15). So total 15 characters.\n\nThus 15 characters.\n\nRunning total: 110 + 15 = 125.\n\nNext: \"④git remote add添加远程地址;\"\n\n④ =1\ng =2\ni =3\nt =4\n(space) =5\nr =6\ne =7\nm =8\no =9\nt =10\ne =11\n(space) =12\na =13\nd =14\nd =15\n添 =16\n加 =17\n远 =18\n程 =19\n地 =20\n址 =21\n; =22\n\nThus 22 characters.\n\nRunning total: 125 + 22 = 147.\n\nNext: \"⑤git branch --set‑upstream‑to关联本地分支到远程主分支;\"\n\n⑤ =1\ng =2\ni =3\nt =4\n(space) =5\nb =6\nr =7\na =8\nn =9\nc =10\nh =11\n(space) =12\n- =13\n- =14\ns =15\ne =16\nt =17\n‑ =18\nu =19\np =20\ns =21\nt =22\nr =23\ne =24\na =25\n‑ =26\nt =27\no =28\n关 =29\n联 =30\n本 =31\n地 =32\n分 =33\n支 =34\n到 =35\n远 =36\n程 =37\n主 =38\n分 =39\n支 =40\n; =41\n\nThus 41 characters.\n\nRunning total: 147 + 41 = 188.\n\nNext: \"⑥git add .、git commit‑m提交后git push推送。\"\n\n⑥ =1\ng =2\ni =3\nt =4\n(space) =5\na =6\nd =7\nd =8\n(space) =9\n. =10\n、 =11\ng =12\ni =13\nt =14\n(space) =15\nc =16\no =17\nm =18\nm =19\ni","signature":"4bfcbc846e92908320220a2403596c6d847941b220ff797854f90ad3ac4731da","type":"thinking"}],"usage":{"input_tokens":295,"output_tokens":4096},"stop_reason":"max_tokens","base_resp":{"status_code":0,"status_msg":""}}
问题记录
未读
Docker拉取镜像太慢
本文介绍了三种加速 Docker 镜像拉取的方案。
1. **国内镜像源**:在 `/etc/docker/daemon.json` 中添加阿里云、网易等镜像地址,Docker 会优先从国内节点获取镜像,显著提升下载速度。
2. **配置代理**:在 `daemon.json` 同时加入 `proxies` 项,指定 http/https 代理(如本机 127.0.0.1:7890),适用于需要通过代理访问外网的场景,可进一步优化跨地域拉取。
3. **离线迁移**:若已有镜像,先在源机器使用 `docker save -o image.tar image:tag` 导出为 tar 文件,再通过 scp/rsync 等方式拷贝至目标机器,最后在目标机器执行 `docker load -i image.tar` 加载,绕过网络限制实现快速部署。
三种方法分别从网络、代理和离线三个角度解决拉取慢的问题,可根据实际环境灵活选用或组合使用。
Java知识三千问
未读
Java-类中为什么要加序列化ID
## 摘要
本文介绍了Java类中序列化ID(serialVersionUID)的作用与意义。在对象序列化和反序列化过程中,序列化ID主要用于确保类的版本兼容性。
**主要作用包括:**
- **版本兼容性控制**:当类结构发生变化(增删字段或修改字段类型)时,显式声明的序列化ID可防止反序列化时出现InvalidClassException。
- **防止反序列化失败**:未指定序列化ID时,类结构变化会导致自动生成的ID改变,使反序列化失败。
- **主动版本管理**:开发者可手动维护序列化ID,更好地控制类的版本迭代。
- **提升代码稳定性**:显式指定序列化ID可避免自动生成ID带来的潜在问题,增强代码可维护性。
**添加方式**:在实现Serializable接口的类中声明私有静态常量`serialVersionUID`即可,且一旦设定应保持稳定,避免随意的版本号变更。