DevOps
read more
Mac安装homepage
1. homepage介绍
官网地址:这里
一个现代化、完全静态、快速、安全、完全代理、高度可定制的应用程序仪表板,集成了 100 多种服务,并可翻译成多种语言。通过 YAML 文件或 Docker 标签发现轻松配置。
2. 为什么要写这个?
因为官网提供的是docker、k8s等安装方式,并没有提供mac本地安装,而我想在自己电脑上有这么一个。所以就要用源码安装了。
3. 普通安装会出来什么问题?
mac新版本用iTrem2的nohup启动后,退出iTrem2后,Session会关闭,导致nohup不成功
4. 如何处理?
4.1 下载源码,切换分支
git clone https://github.com/gethomepage/homepage.git HomePage
git checkout tags/v0.8.9
4.2 确定node版本,编译
# 应该在18以上,我是20
# 到工作目录
npm install -g pnpm
pnpm install
pnpm build
4.3 创建plist
地址:~/Library/LaunchAgents
名称:wiki.micah.homepage.plist 注意,这里必须plist结尾的
内容:xxx表示你的用户目录
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>wiki.micah.homepage</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ThrottleInterval</key>
<integer>60</integer>
<key>EnvironmentVariables</key>
<dict>
<key>HOME_DIR</key>
<string>/Users/xxx</string>
<key>APP_DIR</key>
<string>/Users/xxx/gethomepage/homepage</string>
<key>HOMEPAGE_ALLOWED_HOSTS</key>
<string>homepage.xxxx,localhost:3000</string>
</dict>
<key>ProgramArguments</key>
<array>
<string>/bin/zsh</string>
<string>-c</string>
<string>-l</string>
<string>source $HOME_DIR/.zshrc; /Users/micah/xxx/bin/pnpm start</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/xxx/gethomepage/homepage</string>
<key>StandardOutPath</key>
<string>/Users/xxx/homepage.micah.wiki.node.info.log</string>
<key>StandardErrorPath</key>
<string>/Users/xxx/logs/homepage.micah.wiki.node.error.log</string>
</dict>
</plist>
4.4 加入到启动项目中
# 加入到启动项目
launchctl load ~/Library/LaunchAgents/wiki.micah.homepage.plist
# 从启动项目删除
launchctl unload ~/Library/LaunchAgents/wiki.micah.homepage.plist
DevOps
read more
Mac电脑如何配置有格式的文件夹
# 文件名命名
1. 从下面json多语言化中选择一个Key作为文件夹名
2. 在新建的文件夹名下,创建一个文件`touch .localized`
# 下面的文件地址: `/System/Library/CoreServices/SystemFolderLocalizations/zh_CN.lproj`
# 现在是二进制的,需要转换为其他格式,命令如下:
plutil -convert json SystemFolderLocalizations.strings # 该命令需要有执行权限的地方,不如拷贝到download下
# 更改图标
1. 右击查看“显示简介”
2. 命令行cd到`/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources` 然后输入 `open .`
3. 找到最喜欢的图标,然后`cmd+c`,在简介中的最上面图标点击后`cmd+v`
{
"Saved Searches": "已存储的搜索",
"Relocated Items": "迁移的项目",
"Deleted Users": "已删除的用户",
"Favorites": "个人收藏",
"Public": "公共",
"Compositions": "Compositions",
"Groups": "群组",
"Documents": "文稿",
"Sites": "站点",
"Network": "网络",
"System": "系统",
"My Network": "我的网络",
"Shared Items": "共享的项目",
"My Applications": "我的应用程序",
"Movies": "影片",
"Mail Downloads": "邮件下载",
"Servers": "服务器",
"Server": "服务器",
"Pictures": "图片",
"Shared": "共享",
"Recovered files": "恢复的文件",
"Configuration": "配置",
"Utilities": "实用工具",
"Security": "安全性",
"Incompatible Software": "不兼容的软件",
"Desktop": "桌面",
"Music": "音乐",
"Faxes": "传真",
"Downloads": "下载",
"Users": "用户",
"Guest": "客人",
"Drop Box": "投件箱",
"Web Receipts": "网页收据",
"Library": "资源库",
"Local": "本地",
"Applications": "应用程序"
}