Posts with tag service

create a quick action to open folder in terminal

2024-05-14
macososservice快速操作,服务,终端

os: mac14.5create a quick action to open folder in terminal创建快速操作以右键在终端中打开文件夹打开 Automator app,又称自动操作新建文件在“选取文稿类型”窗口中选择“快速操作”,点击“选取”在左侧栏目中拖拽“实用工具 - 运行 Apple Script”到右侧空白处在顶部栏目中选择“工作流程接收到 自动(无)” “位于 访达.app”添加以下脚本:on run {input, parameters} tell application "Finder" set currentFolder to (folder of the front window as alias) end tell tell application "iTerm" activate try set currentSession to current session of current window on error create window with default profile set currentSession to current session of current window end try tell currentSession write text "cd " & quoted form of POSIX path of currentFolder end tell end tell return input end run保存取个名字killall Finder 重启 Finder 后,右键一个文件夹,在“快速操作”栏目中寻找是否有对应服务。Optional在设置 - 键盘 - 键盘快捷键 - 服务 - 通用 中为你的服务增加快捷键,(双击快捷键图标后键入新快捷键)比如 cmd +

start-service-at-boot

2024-03-27
osserviceubuntu

Sol 1查看如下教程,注意,需要 sudo su nvidia -c 'bash /home/nvidia/Workspace/autoaim_startup.sh' 以用 nvidia 环境:tested ref: https://www.linode.com/docs/guides/start-service-at-boot/Tested in 2023, on Nvidia AGX. No problem.Sol 2sudo vim /etc/systemd/system/my_script.service[Unit] Description=My Custom Script After=network.target [Service] Type=simple ExecStart=/path/to/your/script.sh Restart=on-failure User=your_username # 可选,指定运行用户(如 root 或普通用户). 似乎不需要 [Install] WantedBy=multi-user.targetchmod +x /path/to/your/script.shsudo systemctl daemon-reload # 重新加载 systemd 配置 sudo systemctl enable my_script # 开机自启动 sudo systemctl start my_script # 立即运行查看状态和日志sudo systemctl status xxx journalctl [--user] -u xxx.service -

No more posts to load.